Skip to content

Commit 285f7d4

Browse files
committed
chore: add embeddingemma
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent ea6e850 commit 285f7d4

3 files changed

Lines changed: 130 additions & 0 deletions

File tree

.agents/adding-gallery-models.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Adding GGUF Models from HuggingFace to the Gallery
2+
3+
When adding a GGUF model from HuggingFace to the LocalAI model gallery, follow this guide.
4+
5+
## Gallery file
6+
7+
All models are defined in `gallery/index.yaml`. Find the appropriate section (embedding models near other embeddings, chat models near similar chat models) and add a new entry.
8+
9+
## Getting the SHA256
10+
11+
GGUF files on HuggingFace expose their SHA256 via the `x-linked-etag` HTTP header. Fetch it with:
12+
13+
```bash
14+
curl -sI "https://huggingface.co/<org>/<repo>/resolve/main/<filename>.gguf" | grep -i x-linked-etag
15+
```
16+
17+
The value (without quotes) is the SHA256 hash. Example:
18+
19+
```bash
20+
curl -sI "https://huggingface.co/ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/resolve/main/embeddinggemma-300m-qat-Q8_0.gguf" | grep -i x-linked-etag
21+
# x-linked-etag: "6fa0c02a9c302be6f977521d399b4de3a46310a4f2621ee0063747881b673f67"
22+
```
23+
24+
**Important**: Pay attention to exact filename casing — HuggingFace filenames are case-sensitive (e.g., `Q8_0` vs `q8_0`). Check the repo's file listing to get the exact name.
25+
26+
## Entry format — Embedding models
27+
28+
Embedding models use `gallery/virtual.yaml` as the base config and set `embeddings: true`:
29+
30+
```yaml
31+
- name: "model-name"
32+
url: github:mudler/LocalAI/gallery/virtual.yaml@master
33+
urls:
34+
- https://huggingface.co/<original-model-org>/<original-model-name>
35+
- https://huggingface.co/<gguf-org>/<gguf-repo-name>
36+
description: |
37+
Short description of the model, its size, and capabilities.
38+
tags:
39+
- embeddings
40+
overrides:
41+
backend: llama-cpp
42+
embeddings: true
43+
parameters:
44+
model: <filename>.gguf
45+
files:
46+
- filename: <filename>.gguf
47+
uri: huggingface://<gguf-org>/<gguf-repo-name>/<filename>.gguf
48+
sha256: <sha256-hash>
49+
```
50+
51+
## Entry format — Chat/LLM models
52+
53+
Chat models typically reference a template config (e.g., `gallery/gemma.yaml`, `gallery/chatml.yaml`) that defines the prompt format. Use YAML anchors (`&name` / `*name`) if adding multiple quantization variants of the same model:
54+
55+
```yaml
56+
- &model-anchor
57+
url: "github:mudler/LocalAI/gallery/<template>.yaml@master"
58+
name: "model-name"
59+
icon: https://example.com/icon.png
60+
license: <license>
61+
urls:
62+
- https://huggingface.co/<org>/<model>
63+
- https://huggingface.co/<gguf-org>/<gguf-repo>
64+
description: |
65+
Model description.
66+
tags:
67+
- llm
68+
- gguf
69+
- gpu
70+
- cpu
71+
overrides:
72+
parameters:
73+
model: <filename>-Q4_K_M.gguf
74+
files:
75+
- filename: <filename>-Q4_K_M.gguf
76+
sha256: <sha256>
77+
uri: huggingface://<gguf-org>/<gguf-repo>/<filename>-Q4_K_M.gguf
78+
```
79+
80+
To add a variant (e.g., different quantization), use YAML merge:
81+
82+
```yaml
83+
- !!merge <<: *model-anchor
84+
name: "model-name-q8"
85+
overrides:
86+
parameters:
87+
model: <filename>-Q8_0.gguf
88+
files:
89+
- filename: <filename>-Q8_0.gguf
90+
sha256: <sha256>
91+
uri: huggingface://<gguf-org>/<gguf-repo>/<filename>-Q8_0.gguf
92+
```
93+
94+
## Available template configs
95+
96+
Look at existing `.yaml` files in `gallery/` to find the right prompt template for your model architecture:
97+
98+
- `gemma.yaml` — Gemma-family models (gemma, embeddinggemma, etc.)
99+
- `chatml.yaml` — ChatML format (many Mistral/OpenHermes models)
100+
- `deepseek.yaml` — DeepSeek models
101+
- `virtual.yaml` — Minimal base (good for embedding models that don't need chat templates)
102+
103+
## Checklist
104+
105+
1. **Find the GGUF file** on HuggingFace — note exact filename (case-sensitive)
106+
2. **Get the SHA256** using the `curl -sI` + `x-linked-etag` method above
107+
3. **Choose the right template** config from `gallery/` based on model architecture
108+
4. **Add the entry** to `gallery/index.yaml` near similar models
109+
5. **Set `embeddings: true`** if it's an embedding model
110+
6. **Include both URLs** — the original model page and the GGUF repo
111+
7. **Write a description** — mention model size, capabilities, and quantization type

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This file is an index to detailed topic guides in the `.agents/` directory. Read
1313
| [.agents/testing-mcp-apps.md](.agents/testing-mcp-apps.md) | Testing MCP Apps (interactive tool UIs) in the React UI |
1414
| [.agents/api-endpoints-and-auth.md](.agents/api-endpoints-and-auth.md) | Adding API endpoints, auth middleware, feature permissions, user access control |
1515
| [.agents/debugging-backends.md](.agents/debugging-backends.md) | Debugging runtime backend failures, dependency conflicts, rebuilding backends |
16+
| [.agents/adding-gallery-models.md](.agents/adding-gallery-models.md) | Adding GGUF models from HuggingFace to the model gallery |
1617

1718
## Quick Reference
1819

gallery/index.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7789,6 +7789,24 @@
77897789
- filename: granite-embedding-125m-english-f16.gguf
77907790
uri: huggingface://bartowski/granite-embedding-125m-english-GGUF/granite-embedding-125m-english-f16.gguf
77917791
sha256: e2950cf0228514e0e81c6f0701a62a9e4763990ce660b4a3c0329cd6a4acd4b9
7792+
- name: "embeddinggemma-300m"
7793+
url: github:mudler/LocalAI/gallery/virtual.yaml@master
7794+
urls:
7795+
- https://huggingface.co/google/embeddinggemma-300m
7796+
- https://huggingface.co/ggml-org/embeddinggemma-300m-qat-q8_0-GGUF
7797+
description: |
7798+
EmbeddingGemma 300M is a lightweight, high-quality embedding model from Google, based on the Gemma architecture. It produces 1024-dimensional embeddings optimized for retrieval and semantic similarity tasks. This GGUF version uses QAT (Quantization-Aware Training) Q8_0 quantization for efficient inference.
7799+
tags:
7800+
- embeddings
7801+
overrides:
7802+
backend: llama-cpp
7803+
embeddings: true
7804+
parameters:
7805+
model: embeddinggemma-300m-qat-Q8_0.gguf
7806+
files:
7807+
- filename: embeddinggemma-300m-qat-Q8_0.gguf
7808+
uri: huggingface://ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf
7809+
sha256: 6fa0c02a9c302be6f977521d399b4de3a46310a4f2621ee0063747881b673f67
77927810
- name: "moe-girl-1ba-7bt-i1"
77937811
icon: https://cdn-uploads.huggingface.co/production/uploads/634262af8d8089ebaefd410e/kTXXSSSqpb21rfyOX7FUa.jpeg
77947812
# chatml

0 commit comments

Comments
 (0)