EmbeddingGemma 2
Search across text, images, audio, and video with a shared embedding space. Use task-specific embeddings for retrieval, similarity, and clustering, with 768 dimensions or smaller Matryoshka vectors.
antfly inference pull hf:google/embeddinggemma-2:bf16-safetensors-bundle-v1Technical Specs
- Architecture
- EmbeddingGemma 2
- Parameters
- 740M
- Dimensions
- 768
- Max Tokens
- 8,192
About
EmbeddingGemma 2 is Antfly's default embedder. It maps text, images, audio, and video into one vector space, so a text query can find a screenshot, a recording, or a clip, and one embeddings index can hold all of them. It also embeds ordered combinations: a title, a paragraph, and an image sent as one group come back as one vector for the whole document.
Choose it when an index holds more than text, or when you want one model for every modality instead of a separate embedder per media type. Antfly runs it on CPU, Metal, and CUDA.
Capabilities
- Text, images, audio, and video in one shared embedding space
- 768 dimensions by default, with Matryoshka sizes of 512, 256, and 128 for smaller indexes
- Task types with separate document and query roles (
RETRIEVAL_DOCUMENT,RETRIEVAL_QUERY), plus question answering, fact verification, code retrieval, semantic similarity, classification, and clustering - One vector per ordered group of mixed parts, up to 8192 tokens per group including expanded media
- Video in MP4, MOV, or WebM, sampled at one frame per second up to 32 frames
- More than 100 languages
Where it fits in Antfly
EmbeddingGemma 2 is the embedder for an embeddings index. Antfly embeds documents with the document role on write and searches with the query role, so you don't set task types by hand for indexed data. Each response carries a model_identity hash; pin it on the index embedder so vectors from a different model generation are rejected instead of mixed in.
See Multimodal Embeddings for indexing images, audio, and video, and the EmbeddingGemma 2 guide for request limits and pinning.
Usage
Pull and start Antfly
antfly inference pull hf:google/embeddinggemma-2:bf16-safetensors-bundle-v1
antfly standaloneEmbed documents for search
Use RETRIEVAL_DOCUMENT when embedding documents for search. Use RETRIEVAL_QUERY when embedding a search query against those documents.
curl http://localhost:8080/ai/v1/embed \
-H 'Content-Type: application/json' \
-d '{
"model": "google/embeddinggemma-2:bf16-safetensors-bundle-v1",
"input": [
"Antfly indexes documents and recordings.",
"Search all of your data in one place."
],
"task_type": "RETRIEVAL_DOCUMENT"
}'Embed an image and its caption as one document
Send an ordered group of parts to get one vector for all of them. dimensions selects a smaller Matryoshka size.
curl http://localhost:8080/ai/v1/embed \
-H 'Content-Type: application/json' \
-d '{
"model": "google/embeddinggemma-2:safetensors",
"task_type": "RETRIEVAL_DOCUMENT",
"dimensions": 256,
"input": [
{
"title": "Account recovery",
"content": [
{"type": "text", "text": "How to reset a forgotten password."},
{"type": "image_url", "image_url": {"url": "https://example.com/reset.png"}}
]
}
]
}'