EmbeddingGemma 2: local setup and image search tests

Learn how the presenter installs EmbeddingGemma 2 on Ubuntu, tests text and image retrieval, and reports about 1.7 GB VRAM use for text.

Player not loading? Watch on YouTube

This tutorial installs EmbeddingGemma 2 on Ubuntu and tests sentence similarity and text-to-image search. The presenter describes an Apache 2.0 model that maps text, code, images, video and audio into a shared 768-dimensional vector space. He gives an 8K-token context and a modular design with 270 million text parameters, plus optional vision and audio encoders.

Setup uses Transformers and Sentence Transformers. The demonstration runs on a GPU with 48 GB VRAM, but that capacity is not established as a requirement. The presenter reports about 1.7 GB VRAM use during the text test and says the text model can also run on CPU. This provides a local AI setup example, though the tutorial does not measure every modality's memory use.

The sentence test compares pairs with similar, related and unrelated meanings. Their scores follow the expected order, although the unrelated pair still scores relatively high. The presenter attributes this behavior to Google's guidance and recommends interpreting rankings rather than absolute scores.

For image retrieval, six text queries each place the intended image first in a small set of AI-generated pictures. Cutting vectors from 768 to 256 dimensions preserves all six winners while using one-third as many vector values. The presenter also cites Google's results suggesting that truncation to 128 dimensions reduces quality, especially for images, video and audio. Audio and video retrieval are discussed but not tested here.