Yum News Yum News

Technology  ·  Artificial Intelligence  ·  Developer Insights

Breaking
Gemini Task Automation Guide: India UK Japan Apps ✦   How to Set Up ChatGPT Wallet for Agent Purchases ✦   How to Set Up and Use Gemini Live on Apple CarPlay ✦   How to Set Up Gemini Live on Apple CarPlay ✦   How to Use the Gemini Decisions API for Fast Choices ✦   How to Use Gemini Task Automation on Pixel Phones   ✦   Gemini 3.8 Live launches with native audio dialogue  ✦  Android September Drop adds Find Hub memory  ✦  ML Kit now supports Gemini Nano on-device inference
EmbeddingGemma 2: On-Device Multimodal Embeddings Guide
ai-toolstutorialsdevelopergoogle

EmbeddingGemma 2: On-Device Multimodal Embeddings Guide

Use Google’s open EmbeddingGemma 2 to search text, images, video, and audio on-device. Modular 740M model, Apache 2.0, practical setup steps.

Google DeepMind released EmbeddingGemma 2 on 6 October 2026. The open model maps text, code, images, video, and audio into one 768-dimensional space. At 740 million parameters it runs on phones and laptops. The Apache 2.0 licence lets developers ship it in commercial apps without royalty fees.

This guide shows what the model does, how to install it, and practical steps for on-device retrieval. All numbers come from the official Google blog and model card.

What EmbeddingGemma 2 Delivers

The model unifies four modalities. A text query can retrieve matching images. A voice note can surface related documents. Interleaved inputs are supported in one call. Context length is 8,192 tokens across every modality. That covers roughly 29 images, 58 video frames, or about 5.5 minutes of audio.

It improves on the previous EmbeddingGemma. Code retrieval rises from 68.76 to 78.68 on MTEB Code. Multilingual text stays roughly level at 61.36 on MTEB multilingual v2. The full multimodal version sets a new efficiency frontier against larger specialist models.

Modular design is the practical advantage. Load only the parts you need:

  • Text and code: 270M parameters
  • Text + vision: 440M
  • Text + audio: 570M
  • Full multimodal: 740M

Quantized weights drop active RAM. On a Pixel 11 Pro the text-only checkpoint uses about 191 MB. The full model uses about 567 MB. Matryoshka Representation Learning lets you truncate vectors from 768 down to 512, 256, or 128 dimensions and cut storage up to 6x.

Developer workspace with laptop and code on screen

Step-by-Step Setup

Weights live on Hugging Face as google/embeddinggemma-2. Sentence Transformers provides the fastest path.

  1. Install the library.
pip install -U sentence-transformers transformers
  1. Load the model and encode text.
from sentence_transformers import SentenceTransformer

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

query = model.encode("What causes the northern lights?", prompt_name="SearchQuery")
doc = model.encode("The northern lights are caused by charged particles from the sun.", prompt_name="Document")
print(model.similarity(query, doc))
  1. Add images or audio when needed. Pass a dictionary with the modality key. The vision and audio encoders load only if you request them.

  2. Truncate for storage. After encoding, keep the first 256 dimensions. Similarity search still works because the model was trained with Matryoshka learning.

  3. Quantize for mobile. Use the INT8 or INT4 variants listed in the model card. LiteRT and GGUF builds are available for edge runtimes.

For Android, pair it with the existing Gemini Nano or MediaPipe pipelines already documented in our Android AI tools guides.

Practical Retrieval Patterns

On-device RAG is the clearest use case. Index your local documents, screenshots, and voice memos once. Queries stay on the device. No data leaves the phone.

Cross-modal search works out of the box. Embed product photos and their descriptions together. A spoken query later retrieves the matching photo. Video moment retrieval uses the same vectors. Encode key frames plus a transcript snippet.

Code search improves enough for local codebase indexing. The 9.92-point gain on MTEB Code makes natural-language queries over a repository practical on a laptop.

Watch the official introduction for the architecture walkthrough.

Abstract data visualization and charts

Tips and Limits

Start with the text-only checkpoint if RAM is tight. Add vision or audio only for the specific feature that needs it. Measure peak memory on your target device before shipping.

The model has no safety fine-tuning. Treat outputs as retrieval scores, not generated content. Performance is not uniform across the 100+ languages. Test the languages you support.

Quantization and truncation trade a little quality for large storage wins. Profile both on your dataset. For most search tasks the 256-dimension vectors remain strong.

Conclusion

EmbeddingGemma 2 puts multimodal retrieval on everyday hardware. The modular design, Apache 2.0 licence, and measured efficiency gains make it ready for privacy-first apps. Load the weights, encode your local data, and keep queries on-device.

Sources

Share this story