EmbeddingGemma 2

Puts text, code, images, audio and video into one 768-dimensional space, with a text-only path that starts at 270M parameters

What it is

EmbeddingGemma 2 is the multimodal embedding model Google DeepMind released on 6 October 2026. Code and weights are public under Apache 2.0, hosted in the google/embeddinggemma-2 repository on Hugging Face, with supporting code in the Gemma family’s google-deepmind/gemma repository (Python, about 5.8k stars, Apache-2.0). It attacks the old problem on the retrieval side: existing systems were either text-only embedders that forced you to bolt on a separate model for images, audio or video in an incompatible vector space, or large models that simply do not run locally or on-device. Built on Gemma 4, it uses modular encoders to project text, code, images, video frames and raw audio into a single 768-dimensional space, so cross-modal retrieval such as finding a video moment from a sentence no longer needs a chain of mismatched pipelines. The parameter count is modular: 270M for the text and code path, plus 170M for vision and 300M for audio, totalling 740M for full multimodal use. Text-only deployments set the vision and audio configs to None at load time and run at 270M. Context is 8,192 tokens, four times the first generation, which Google says covers up to about 5.5 minutes of audio, 29 images or 58 video frames per input, shared across modalities when interleaved. Vectors default to 768 dimensions and can be truncated to 512, 256 or 128 through Matryoshka representation learning; Google reports 256 dimensions retains most of the full quality on text and code and about 95% on image, video and speech retrieval, cutting vector storage by up to six times. On benchmarks Google publishes MTEB Code rising from 68.76 to 78.68 over the previous version with multilingual text roughly flat at 61.36 against 61.15, and claims leadership among sub-1B multimodal embedders on MTEB Code and MAEB. These are vendor numbers without independent replication yet. Tooling spans Ollama, LM Studio, llama.cpp with GGUF, MLX, vLLM, SGLang, transformers and sentence-transformers 6.1.0 or later, with MediaPipe and LiteRT on device and transformers.js plus WebGPU in the browser. Quantised on a Pixel 11 Pro, Google reports roughly 191 MB of active RAM for text-only and 567 MB for the full model.

Highlights

  • The text and code path needs only 270M parameters, so laptops and phones can run it and sensitive workloads never leave the machine
  • Five modalities share one vector space, so cross-modal retrieval needs no chain of mismatched models
  • Matryoshka truncation to 128 or 256 dimensions cuts vector storage by up to six times with manageable quality loss
  • Apache 2.0 allows commercial use, fine-tuning and on-device shipping, removing a legal review step
  • 8K context is four times the first generation, so long documents and recordings need less aggressive chunking
  • It shares a tokenizer and audio encoder with Gemma 4, lowering total footprint when both run on device
  • Broad runtime support across Ollama, llama.cpp, MLX, vLLM and the browser

How to use

The shortest path in is sentence-transformers: install it at 6.1.0 or later with the image, audio and video extras plus transformers, set MODEL_ID to google/embeddinggemma-2 and load it with SentenceTransformer for the full 740M multimodal configuration. For text or code retrieval only, set vision_config and audio_config to None in config_kwargs and the model drops back to the 270M configuration, cutting memory immediately. On the text side mind the mandated task prefixes: queries use a prompt name such as SearchQuery, indexed documents use Document, and media inputs take no prefix and go straight to their encoders. For indexing, chunk the corpus, compute vectors offline and store them with metadata pointing back to source files. At query time encode the question the same way, take the top-k by cosine similarity and hand them to the generator. Start at the default 768 dimensions, confirm quality, then try truncating to 256 or 128 and measure recall against your own query set rather than saving storage up front. If you are migrating from the first EmbeddingGemma or any other embedder, you must re-embed everything, since vectors from different models are not comparable, so plan the cutover window and compute budget in advance. For on-device use, llama.cpp with GGUF or MLX works, and transformers.js with WebGPU covers the browser. Running alongside Gemma 4 costs less memory overall because both share a tokenizer and audio encoder.

License

Released under Apache-2.0. Read the terms before commercial use or redistribution, especially if you plan to offer it as a service.