Instructions to use lm-kit/embeddinggemma-2-lmk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use lm-kit/embeddinggemma-2-lmk with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible embeddings server: llama serve -hf lm-kit/embeddinggemma-2-lmk:Q5_K_M --embeddings
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible embeddings server: llama serve -hf lm-kit/embeddinggemma-2-lmk:Q5_K_M --embeddings
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible embeddings server: ./llama-server -hf lm-kit/embeddinggemma-2-lmk:Q5_K_M --embeddings
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible embeddings server: ./build/bin/llama-server -hf lm-kit/embeddinggemma-2-lmk:Q5_K_M --embeddings
- Llama new
- LM Studio
- Jan
- Ollama
How to use lm-kit/embeddinggemma-2-lmk with Ollama:
ollama run hf.co/lm-kit/embeddinggemma-2-lmk:Q5_K_M
- Unsloth Desktop
- Docker Model Runner
How to use lm-kit/embeddinggemma-2-lmk with Docker Model Runner:
docker model run hf.co/lm-kit/embeddinggemma-2-lmk:Q5_K_M
- Lemonade
How to use lm-kit/embeddinggemma-2-lmk with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull lm-kit/embeddinggemma-2-lmk:Q5_K_M
Run and chat with the model
lemonade run user.embeddinggemma-2-lmk-Q5_K_M
List all available models
lemonade list
- Atomic Chat
|
Download README.md from lm-kit/embeddinggemma-2-lmk: direct link, hf CLI and curl.
- Browser
- Download file 2.85 kB
-
https://huggingface.co/lm-kit/embeddinggemma-2-lmk/resolve/main/README.md
- Command line
-
hf download hf://lm-kit/embeddinggemma-2-lmk/README.md
-
curl -L -o README.md https://huggingface.co/lm-kit/embeddinggemma-2-lmk/resolve/main/README.md
2.85 kB
| license: apache-2.0 | |
| base_model: google/embeddinggemma-2 | |
| pipeline_tag: feature-extraction | |
| library_name: lm-kit | |
| tags: | |
| - embedding | |
| - sentence-similarity | |
| - multimodal-embedding | |
| - lmk | |
| - gguf | |
| - lm-kit | |
| language: | |
| - multilingual | |
| # EmbeddingGemma 2 (LMK) for LM-Kit.NET | |
| An LM-Kit model archive of [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2), the | |
| open multimodal embedding model from Google DeepMind, packaged for | |
| [LM-Kit.NET](https://lm-kit.com). Text, code and images are embedded into one 768-dimensional vector | |
| space (Matryoshka truncation to 512, 256 or 128 dimensions, re-normalized), with an 8,192-token | |
| context. | |
| | File | Content | Size | | |
| |---|---|---| | |
| | `embeddinggemma-2-Q5_K_M.lmk` | LM-Kit archive: the text encoder (Q5_K_M) and the vision encoder (Q8_0) in one file. This is what `LM.LoadFromModelID("embeddinggemma-2")` loads | 439 MB | | |
| | `embeddinggemma-2-Q5_K_M.gguf` | Text encoder (270M parameters), Q5_K_M | 213 MB | | |
| | `embeddinggemma-2-mmproj-vision-Q8_0.gguf` | Vision encoder (170M parameters), Q8_0, audio tower removed | 226 MB | | |
| | `embeddinggemma-2-mmproj-vision-BF16.gguf` | Vision encoder, BF16 reference (full precision, for re-quantization) | 368 MB | | |
| The archive's vision encoder reads only its header at load: its weights reach memory with the first image, so text-only use costs no vision memory. The GGUF files are the archive's contents, for runtimes that load GGUF directly. | |
| ## Usage | |
| ```csharp | |
| using LMKit.Model; | |
| using LMKit.Embeddings; | |
| using LMKit.Media.Image; | |
| // Text, code and images, in the same vector space | |
| using LM model = LM.LoadFromModelID("embeddinggemma-2"); | |
| var embedder = new Embedder(model); | |
| float[] query = embedder.GetQueryEmbeddings("waterproof running shoes"); | |
| float[] document = embedder.GetEmbeddings("Our trail shoe keeps your feet dry on wet rock."); | |
| float[] image = embedder.GetEmbeddings(ImageBuffer.LoadAsRGB("shoe.jpg")); | |
| ``` | |
| LM-Kit.NET applies the model card's prompts by retrieval role (`task: search result | query: ` for | |
| queries, `title: none | text: ` for documents), frames every input with `<bos>` and `<eos>` as the | |
| publisher's tokenizer does, and sizes images with the model's own processor rule (280 soft tokens | |
| by default, aspect ratio preserved, bicubic resampling). | |
| ## Conversion | |
| Converted with LM-Kit's llama.cpp fork (upstream `convert_hf_to_gguf.py`, architecture | |
| `gemma-embedding2`, projector `gemma4v`). Every text tokenizes to exactly the publisher's token | |
| ids, and the vectors match the publisher's own pipeline (sentence-transformers) for text and | |
| images. | |
| ## License | |
| Apache 2.0, as the original model. See the | |
| [Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license) and the | |
| [original model card](https://huggingface.co/google/embeddinggemma-2). | |