Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Google DeepMind - Open weights - verified

EmbeddingGemma 2 embeddings

EmbeddingGemma 2 is a current embedding model from Google DeepMind, with open weights on Hugging Face at google/embeddinggemma-2. It returns 768-dimension vectors by default and accepts up to 8,192 input tokens, for text, code, image, audio and video input. There is no API price: the weights download from Hugging Face under Apache 2.0, and you pay for the compute you run them on.

CurrentModel id: google/embeddinggemma-2- weights: google/embeddinggemma-2

Default dims
768
Max input
8,192 tok
Price / 1M
Self-hosted
Inputs
Text, Code, Image, Audio, Video

Dimensions

Flexible output size
  • 768default
  • 512
  • 256
  • 128

Default output: 768 dimensions.

Listed sizes: 768, 512, 256 and 128.

Google DeepMind documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.

Pricing

No API price: the weights are on Hugging Face and you run them on your own hardware or host.

Open weights

Hugging Face repo
google/embeddinggemma-2
License
Apache 2.0apache-2.0
Commercial use
Commercial use allowedCommercial use is allowed, per the license.
Parameters
744M (744,371,512)

Worth knowing

Text, images, video and audio share one 768-dimensional space, task prefixes steer retrieval, clustering and similarity, and the card says to run in bfloat16 or float32 because float16 returns NaN or degraded embeddings.

Released . Multilingual: yes.

Usage

Copied verbatim from the page linked below. Placeholders such as project ids and API keys are the source's own.

Python
from sentence_transformers import SentenceTransformer

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

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))

Source: huggingface.co/google/embeddinggemma-2

FAQ

How many dimensions does EmbeddingGemma 2 output?

Default output: 768 dimensions. Listed sizes: 768, 512, 256 and 128. Google DeepMind documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.

What is the max input length of EmbeddingGemma 2?

8,192 tokens per input, per the model card. Longer text has to be chunked before you embed it.

Can I use EmbeddingGemma 2 commercially?

EmbeddingGemma 2 is released under Apache 2.0, and commercial use is allowed. The license text is at https://ai.google.dev/gemma/docs/gemma_4_license.

What can EmbeddingGemma 2 embed?

Text, code, image, audio and video input, per the provider. It is documented as multilingual.

Sources

Last verified from the pages below.

Other open-weight embedding models

Default dimensions and max input tokens for the other models you can run yourself.

Google API modelsPrices per 1M tokens, context windows and specs for every Google model in the API registry.

All embedding models - Open-weight embedding models

Newsletter

New models, every week

One email per week. New model releases, embedding and retrieval updates and what they mean for what you build.