EmbeddingGemma 2: On-Device Multimodal Embeddings in Under 600MB of RAM

·10 min read·Evergreen Tools Team

Google DeepMind launched EmbeddingGemma 2 on October 6, 2026: a compact, open-weight embedding model released under the Apache 2.0 license that natively maps text, code, images, video and audio into a single, unified 768-dimensional vector space. It is built on the Gemma 4 architecture and scales from 270 million parameters for text and code up to 740 million for full multimodality. For developers building local search and media retrieval, it removes the latency and memory overhead of chaining separate captioning, speech-to-text and text-embedding models. Here is what it does and how to use it, with working code from the official developer guide.

Abstract AI visual

One model, one 768-dimensional space, five modalities

What launched, and why it matters

EmbeddingGemma 2 is a sub-1B embedding model with an unusual property: it is natively multimodal. Rather than bolting a captioner and a speech-to-text model in front of a text embedder, it maps text, code, images, video frames and audio directly into one 768-dimensional space, so content of very different kinds can be compared with a single dot product. It is built on the Gemma 4 architecture and released under the Apache 2.0 license, meaning it can be used in commercial products. The first EmbeddingGemma had surpassed 20 million downloads, so this is an upgrade to a model developers already depend on, not a novelty. Version 2 keeps that audience and widens the door.

# Install sentence-transformers with the extra modality encoders.
pip install -U "sentence-transformers[image,audio,video]" transformers

Why chaining models was the old tax

Before a model like this, building local multimodal search meant a pipeline: caption images, transcribe audio, then embed all the text and hope nothing is lost in translation between modalities. Every hop added latency, memory and a place for the meaning to leak. EmbeddingGemma 2 replaces the chain with modular encoders that project into a shared space. Because when paired with Gemma 4 it shares the same text tokenizer and audio encoder architecture, an on-device RAG pipeline can run both models with a lower combined memory footprint. The practical result is that cross-modal retrieval becomes a single-model problem instead of an integration project.

# Load the full multimodal model (740M params).
from sentence_transformers import SentenceTransformer

MODEL_ID = "google/embeddinggemma-2"
model = SentenceTransformer(MODEL_ID)

# Or load only what you need - disabled encoders never enter memory.
text_only = SentenceTransformer(
    MODEL_ID,
    config_kwargs={"vision_config": None, "audio_config": None},  # 270M
)
A laptop showing code

Local codebase indexing and agentic code search on-device

Modular by design, and cheap to store

The model's footprint is a dial, not a fixed cost. You can load only what you need: 270M parameters for text and code, 440M for text plus vision, 570M for text plus audio, or 740M for full multimodality - all projecting into the same compatible vector space. On top of that, Matryoshka Representation Learning lets you truncate output vectors from 768 dimensions down to 512, 256 or 128. At 256 dimensions, Google reports most of the full quality is retained on text and code and about 95% on image, video and speech retrieval, at a third of the storage; 128 dimensions cuts storage 6x. In bfloat16, a million 768-dimensional vectors take roughly 1.5GB, while truncating to 128 dimensions needs just 250MB. That dial is what makes on-device retrieval affordable at all. Every code block above is drawn from Google's own developer guide.

# Retrieve with task prompts: encode queries and documents differently.
query = "What causes the northern lights?"
document = "The northern lights are caused by charged particles from the sun."

query_emb = model.encode(query, prompt_name="SearchQuery")
doc_emb = model.encode(document, prompt_name="Document")
print(model.similarity(query_emb, doc_emb))

The numbers and the context window

Google reports a 9.92-point improvement on MTEB Code, from 68.76 to 78.68, which is what makes it well-suited to local codebase indexing and agentic code search, plus leading sub-1B scores on MTEB and MAEB. All modalities share an 8,192-token context window - 4x larger than version 1 - which on-device is enough to process up to 5.5 minutes of audio, 29 images, 58 video frames, or interleaved combinations of them. With quantization on a Pixel 11 Pro, Google cites as little as ~191MB of active RAM for text-only weights and ~567MB for the full multimodal model. Verify on your own hardware, but that is a genuinely on-device footprint.

# Cross-modal search: one text query against an image and a sound clip.
image_emb = model.encode({"image": "sunset_beach.jpg"})
audio_emb = model.encode({"audio": "ocean_waves.wav"})
query_emb = model.encode("ocean waves at sunset", prompt_name="SearchQuery")
print(model.similarity(query_emb, image_emb))
print(model.similarity(query_emb, audio_emb))
Abstract geometric pattern

Matryoshka truncation cuts storage 6x with little quality loss

Getting started, in code

You can run EmbeddingGemma 2 across all five modalities with the sentence-transformers library (v6.1.0 or later). Load the full model, or omit encoders by setting vision_config or audio_config to None at load time - disabled encoders never enter memory. For retrieval, encode queries and documents with different task prompts (SearchQuery and Document) so the representations are steered correctly. Pass media as a dictionary keyed by modality, and mark interleaved text with <|image|>, <|video|> or <|audio|> tokens. When you need smaller indexes, pass truncate_dim with normalize_embeddings=True. The weights are on Hugging Face and Kaggle under Apache 2.0.

# Matryoshka truncation: shorter vectors, smaller indexes, same space.
# 768d -> 512 -> 256 -> 128 (6x storage reduction).
query_emb = model.encode(
    query,
    prompt_name="SearchQuery",
    truncate_dim=256,
    normalize_embeddings=True,
)

Where it fits in a real stack

The obvious fits are local semantic search, on-device RAG, media-library retrieval, and code search inside a coding agent. Because the model can truncate to 128 dimensions for a first-stage shortlist and 256 or 512 for higher recall, you can cheaply shortlist and then re-rank, which is exactly the shape of a memory-constrained index. And because everything can stay on the device, you get the privacy story for free: no content leaves the machine to be embedded. If you are building retrieval that must work offline, respect data residency, or simply keep latency low, this is the model to benchmark against your current pipeline. Measure first, migrate second.

📌 Frequently Asked Questions

What is EmbeddingGemma 2?

Per Google, it is an open-weight, natively multimodal embedding model built on Gemma 4 and released under the Apache 2.0 license. It maps text, code, images, video and audio into one shared 768-dimensional space.

How big is it?

Google says it scales from 270M parameters for text and code up to 740M for all modalities, with a +170M vision encoder and a +300M audio encoder.

What does Matryoshka truncation do?

Using Matryoshka Representation Learning, developers can truncate output vectors from 768 dimensions down to 512, 256 or 128 dimensions. Google notes this provides up to 6x storage reduction for local vector databases and memory usage.

How much memory does it need on-device?

Per Google, with quantization on a Pixel 11 Pro, EmbeddingGemma 2 requires as little as ~191MB of active RAM for text-only weights and ~567MB for the full multimodal model.

How much better is it than version 1?

Google reports a 9.92-point improvement on MTEB Code (from 68.76 to 78.68) while retaining the multilingual text performance of EmbeddingGemma 1, which had seen more than 20 million downloads.