Google EmbeddingGemma 2: One Open Model Under 600 MB Searches Text, Code, Photos, Audio, and VideoNote · digest for November 24
Compact mobile processor on a circuit board unifying visual and text streams into a single vector core
Note3 sections≈ 5 min

Google EmbeddingGemma 2: One Open Model Under 600 MB Searches Text, Code, Photos, Audio, and Video

Finding a specific second in a vacation video or a line in a voice memo right on your phone—with no internet and no cloud—now takes just one open model. Google DeepMind released EmbeddingGemma 2 under Apache 2.0 with no gated access forms. On a Pixel 11 Pro, the full quantized build uses around 567 MB of RAM, and text-only mode takes roughly 191 MB.

Five Formats on One Semantic Map

Until recently, local search across different file types required a whole zoo of tools: one model for text, CLIP or SigLIP for images, Whisper to transcribe audio, and separate vector databases. EmbeddingGemma 2 maps everything into a single 768-number space. Feed it text, code, a photo, audio, or video, and you get back an embedding—a set of coordinates on one shared map of meaning. Related items land close together, so cross-modal search works out of the box: a text query or voice note finds the exact video frame right away. You can even mix text, photos, and video in one input.

The model doesn't answer questions itself; it is a search engine, not a chatbot. In local RAG (pulling facts from your files before an AI replies), you pair it with a chat model like Gemma 4. They share the same tokenizer and audio encoder, cutting memory use when running side by side. Live offline demos Instant Media Search and Video Moments Finder are already inside Google AI Edge Gallery.

Modular Design and the "Matryoshka" Trick

The 740M-parameter model is built from three independent blocks: 270M for text and code, 170M for images and video frames, and 300M for audio. You load only what you need: docs and code take 270M, and adding screenshots brings it to 440M. Under the hood sits the Gemma 4 architecture with bidirectional attention (every word sees the whole context) trained via two-stage distillation from the larger Gemini Embedding 2 "teacher."

To save database space, it uses MRL (Matryoshka Representation Learning), packing the core meaning into the first numbers of the vector. Without retraining, you can chop the 768-number vector down to 512, 256, or 128 dimensions and shrink your index.

EmbeddingGemma 2 Accuracy Under MRL Vector Compression

Cutting down to 256 numbers saves a lot of storage with barely any accuracy loss, making it the sweet spot for multimodal search. Pushing down to 128 hits image, video, and audio search hard (as seen on the MSEB audio test too), so save that aggressive cut for pure text.

Running in Python, 8K Context, and a Few Gotchas

The context window quadrupled to 8,192 tokens across all formats. One request fits around 29 photos (or up to 114 if you cap the visual budget at 70 tokens each), 58 video frames at 1 fps, or ~5.5 minutes of audio. On code search, the model jumped nearly 10 points over v1 while holding steady across 100+ languages.

Google EmbeddingGemma 2 results on the MTEB Code benchmark (Source: blog.google)

Weights are up on Hugging Face, Kaggle, and in GGUF (Ollama tags embeddinggemma-2, embeddinggemma-2:270m, embeddinggemma-2:440m, llama.cpp, LM Studio, MLX, LiteRT), plus browser support via Transformers.js. Here is how to run it in Python:

import torch
from sentence_transformers import SentenceTransformer

# float16 overflows model activations; use bfloat16 or float32
dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float32

# Keep only text and code (270M) by disabling vision and audio
model = SentenceTransformer(
    "google/embeddinggemma-2",
    model_kwargs={"torch_dtype": dtype},
    config_kwargs={"vision_config": None, "audio_config": None},
)

# Truncate vector to 256 dims (3x savings) and L2-normalize
q_emb = model.encode(
    "How does MRL compression work?",
    prompt_name="SearchQuery",
    truncate_dim=256,
    normalize_embeddings=True,
)
d_emb = model.encode(
    "MRL packs the main meaning into the start of the embedding vector.",
    prompt_name="Document",
    truncate_dim=256,
    normalize_embeddings=True,
)
print(model.similarity(q_emb, d_emb))

This snippet dodges three traps listed in the official model card. Never run it in float16: activations overflow and silently produce NaN or broken vectors, so stick to bfloat16 or float32. If you slice vectors manually, remember to re-apply L2 normalization and keep dimensions identical between queries and your database. Finally, text inputs require task prefixes (SearchQuery, CodeRetrieval, Document), whereas photos, video, and audio go straight in with no prefix.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 4