EmbeddingGemma 2 โ€” Text + Image โ€” BF16 โ€” Transformers / SentenceTransformers

A modular deployment export of Google DeepMind's EmbeddingGemma 2. Only the text backbone, vision encoder and vision projection are retained; the audio encoder and audio projection are absent. No training, distillation, or quantization was applied.

Retained weights preserve the upstream BF16 precision.

Property Value
Runtime Transformers / SentenceTransformers
Stored floating-point tensors BF16 (all tensors checked)
Effective model parameters 438,760,448
Weight files 877.60 MB, decimal
Inputs Text, code, images, text + images
Output 768 dimensions; MRL at 512, 256, 128
Context budget 8,192 tokens
License Apache 2.0

Weight size is not total runtime memory. 270M/440M in repository names are rounded deployment sizes.

Install

pip install "transformers>=5.19.0" "sentence-transformers>=6.1.0"

Tested with Transformers 5.19.0, SentenceTransformers 6.1.0, and PyTorch 2.14.1.

Text and code

import torch
from sentence_transformers import SentenceTransformer

model = SentenceTransformer(
    "jayyun98/embeddinggemma-2-text-image-440m-bf16",
    device="mps",
    model_kwargs={"dtype": torch.bfloat16},
)
queries = model.encode(
    ["What causes the northern lights?", "๋กœ์ปฌ ์ฝ”๋“œ ๊ฒ€์ƒ‰ ๋ชจ๋ธ์„ ์ฐพ๊ณ  ์‹ถ์–ด์š”."],
    prompt_name="SearchQuery",
    normalize_embeddings=True,
)
documents = model.encode(
    ["Charged particles from the sun cause the northern lights."],
    prompt_name="Document",
    normalize_embeddings=True,
)
print(model.similarity(queries, documents))

code_query = model.encode(
    "Find a Python function that sorts a list.",
    prompt_name="CodeRetrieval",
    truncate_dim=256,
    normalize_embeddings=True,
)

Use SearchQuery for search queries, CodeRetrieval for code-search queries, and Document for corpus items. For the MLX API, prepend the corresponding literal prefix from config_sentence_transformers.json, as shown above. For titled documents, use title: {title} | text: {content} without another prefix. Use matching dimensions for queries and documents, and normalize after truncation. Do not cast this model to FP16; use BF16 or FP32 inference.

Images and mixed text/image inputs

from PIL import Image

image = Image.open("photo.jpg").convert("RGB")
image_vector = model.encode({"image": image}, normalize_embeddings=True)
mixed_vector = model.encode(
    {"text": "A description of this photo.", "image": image},
    normalize_embeddings=True,
)

Verification

MPS GPU BF16 inference was tested in the package's named precision. Outputs were exactly equal to the full source model running in the same precision. Checks cover English/Korean search and document text, code queries, and 128/256/512-dimensional normalized vectors. Image-only, mixed text/image, and interleaved two-image inputs were also checked.

Fixture Minimum cosine vs source FP32 Maximum absolute difference
search_english_korean 0.999962518 0.00236937404
documents 0.999946502 0.00167062879
code 0.999964441 0.00194609165
image 0.999976741 0.00345304608
mixed_text_image 0.999971017 0.00102181733
interleaved_two_images 0.999946668 0.0018362999

Measurements compare with the pinned full Google checkpoint. They are small numerical and loading checks, not MTEB results, a retrieval-quality evaluation, or a speed benchmark. The original prompts, pooling behavior, tokenizer and processor assets are retained. Processor metadata does not restore the removed encoder weights. This package targets text/image; audio is unavailable and video workflows were not evaluated.

Attribution and license

Original weights and tokenizer/processor assets: Google DeepMind.

This is an independent derivative deployment export, not an official Google release. The Apache 2.0 LICENSE and NOTICE are included. See the original model card for training, intended use and limitations.

Downloads last month
53
Safetensors
Model size
0.4B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jayyun98/embeddinggemma-2-text-image-440m-bf16

Finetuned
(144)
this model

Collection including jayyun98/embeddinggemma-2-text-image-440m-bf16