/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
embeddinggemma-2
Библиотека
ds4-rs
Опубликована
20 окт 2026

embeddinggemma2-vq4x4096-q80token

ЭмбеддингиТекст → embedding9 профессий

4-битная мультимодальная модель эмбеддингов EmbeddingGemma-2 для семантического поиска, индексации документов и сравнения текста и изображений.

66скачиваний за 30 дней0лайковвеса обновлены20 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это квантованный 4-битный вариант мультимодальной модели эмбеддингов Google EmbeddingGemma-2, подготовленный для движка ds4 и распространяемый в контейнере GGUF. Для текстового пути используется текстовая башня модели, а для изображений требуется отдельная башня vision; на выходе модель формирует L2-нормализованный вектор размерности 768. Артефакт поддерживает текст и по одному изображению на элемент, но аудиобашня в него не входит.

Модель предназначена для построения векторных индексов, семантического поиска, RAG и сравнения текстов и изображений. Для запросов и документов следует выбирать соответствующие префиксы задач из карты промптов модели; поддерживаются также усечённые размерности 512, 256 и 128. Ограничения запуска: до 2048 токенов на элемент, до 8192 элементов на запрос и одно изображение на элемент. Файл использует типы данных и архитектуру ds4, поэтому несовместим с llama.cpp; требуется движок ds4. Качество 4-битного представления ниже исходного чекпойнта: в README указано снижение MRR@10 примерно на 1,6 пункта на BEIR SciFact. Лицензия — Apache-2.0.

Сценарии применения

  • создание векторного индекса документов для RAG
  • семантический поиск по текстовым документам
  • ранжирование документов по близости к поисковому запросу
  • поиск по изображениям вместе с текстовым описанием
  • поиск нужных разделов в проиндексированных PDF-документах

Ограничения

Для запуска нужен движок ds4: этот GGUF несовместим с llama.cpp. На элемент допускается до 2048 токенов и одно изображение; аудиобашня отсутствует, а 4-битное квантование снижает качество относительно исходных весов.

Для каких профессий подходит9

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

EmbeddingGemma-2 — 4-bit VQ artifact for the ds4 engine

A 4-bit vector-quantized (VQ) build of google/embeddinggemma-2 (revision 914f7f89142e33e77833254d9c9b90c3cef7303b, Apache-2.0), packaged as a GGUF container for the ds4 engine. Text (and one image per item) in, one 768-dimensional L2-normalized vector out.

Where everything lives

WhatWhere
This artifact's tooling, recipe and gate evidencehttps://github.com/JLFN/embeddinggemma2 (public)
The engine that runs it (Rust host + C/CUDA core)https://github.com/JLFN/embeddinggemma2-ds4-rs (public)
Step-by-step usage guide (every command measured)https://github.com/JLFN/embeddinggemma2/blob/dev/docs/USAGE.md
The quantization recipe, in fullhttps://github.com/JLFN/embeddinggemma2/blob/dev/RECIPE.md
Upstream model cardhttps://huggingface.co/google/embeddinggemma-2

Files

FileBytessha256
EmbeddingGemma-2-914f7f8-vq4x4096-q80token-gemma_vq.gguf437,508,4165bcf22161dda46bccbd5123b26d519efccad981cbfe11cce7227415b3373b33f
EmbeddingGemma-2-914f7f8-vision-mmproj.gguf367,088,9609ffb86e3eeb5834095e0bd42b6f5fc0505f02b8e208a6037d01db448e6566838

The first file is the text tower (the embedding model). The second is the vision tower (211 tensors) required for the image path; it is loaded only when you pass --vision.

Read this before you try llama.cpp

This is not a llama.cpp-loadable GGUF. It carries the ds4 engine's own family (general.architecture = gemma_vq, family=16 variant=19) and its matrices are the reference quantizer's type-42 vqblob payloads (4-bit, codebook dimension 4096), not Q4_*/IQ* blocks. llama.cpp will refuse the file — by design. Build the engine from the repository above and use ds4-rs.

How to use it

Build the engine (once)

git clone https://github.com/JLFN/embeddinggemma2-ds4-rs
cd embeddinggemma2-ds4-rs
make cuda CUDA_ARCH=sm_89      # or: make cpu

make cuda CUDA_ARCH=<your arch> records the architecture for later builds; use make cuda-generic to let the build detect it.

One-shot text embedding (CLI)

./ds4 -m EmbeddingGemma-2-914f7f8-vq4x4096-q80token-gemma_vq.gguf \
      --embed "The cat sat on the warm windowsill."

JSON on stdout: n_tokens, dims (768), secs, and the embedding array. On an RTX 4070 SUPER this takes about 34 ms. Other sources: --embed-file FILE, --embed-stdin.

Pick the task deliberately — the prefix is prepended before tokenizing, so it changes the vector. Embed queries with a query task and documents with Retrieval-document, then compare across the two:

./ds4 -m <artifact> --embed "your question"      --task SearchQuery
./ds4 -m <artifact> --embed-file page.txt        --task Retrieval-document
./ds4 -m <artifact> --embed "..."                --dims 256   # 512 | 256 | 128, renormalized

The HTTP route

./ds4-server -m EmbeddingGemma-2-914f7f8-vq4x4096-q80token-gemma_vq.gguf \
             --vision EmbeddingGemma-2-914f7f8-vision-mmproj.gguf \
             --model-id eg2vq --host 127.0.0.1 --port 8791 --backend cuda

curl -s localhost:8791/health
curl -s -X POST localhost:8791/v1/embeddings -H 'Content-Type: application/json' \
  -d '{"input":"Vad gäller för övertidsersättning?","task":"SearchQuery","model":"eg2vq"}'

Start the server or the CLI, not both at once: they take the same machine-wide model lock. GET /health reports the contract you can program against (item_tokens_max, batch_rows_max, and the image window).

Many items in one call

The route takes an array and drives one tower call per request, which is where the throughput is:

jq -n --rawfile a doc1.txt --rawfile b doc2.txt \
   '{input:[$a,$b],task:"Retrieval-document",model:"eg2vq"}' \
 | curl -s -X POST localhost:8791/v1/embeddings -H 'Content-Type: application/json' -d @-

Measured: 143 pages of a Swedish collective agreement (76,504 tokens) embedded in 19.0 s, about 4,029 tokens/s.

Images

One image per item, and the item's text must mark its position with <|image|>. The item is the OpenAI content-part shape, with the image as a base64 data URI:

jq -n --rawfile u uri.txt \
   '{input:[{content:[{type:"text",text:"<|image|>"},
                      {type:"image_url",image_url:$u}]}],task:"Raw",model:"eg2vq"}' \
 | curl -s -X POST localhost:8791/v1/embeddings -H 'Content-Type: application/json' -d @-

Build that JSON from a file: a page-sized data URI is far past the shell's argument-list limit.

Turning a PDF into a searchable index

Nothing here reads PDF; convert first. For a PDF with a text layer, extract and batch (this is what produced the 19-second number above):

pdftotext agreement.pdf - \
  | jq -Rs '[split("\f")[] | select((gsub("\\s";"")|length) > 0)]' > pages.json

For a scan with no text layer, render pages and send them as images:

pdftoppm -f 19 -l 19 -r 150 -png agreement.pdf page19

The full worked example, including the query loop that ranks the index, is in docs/USAGE.md.

How it was produced

The weights are the reference implementation's own (YoungAi quantizer, the same toolchain as the DeepSeek V4.1 recipe): kmeans codebook, GPTQ column-group feedback, the payload writer and the block-scalar encoders were called, not reimplemented. The container is this project's DQVD v1 wrapper, re-emitted as GGUF. The artifact's own metadata records the recipe verbatim:

towers=vq4x4096  sharedcb=0 cbfp16 token=q8_0 frontend=vq other=keep nocal
encoder=cpu (eg2_pack) src=914f7f89142e

1376 tensors: 461 vqblob, 1 q8_0 (the 262144×512 token table), 914 bf16 kept at source precision (norms, biases, scales, the vision patch embedder). 42 metadata keys, the gemma4 tokenizer with the checkpoint's own ids.

Measured quality

Against the frozen llama.cpp reference and a standard retrieval benchmark:

MeasurementResult
Tokenizer ids vs llama.cpp over the frozen set113 items, 7088 tokens, 0 mismatches
Text tower on the baseline weights vs the frozen anchormean cosine 0.99999681, min 0.99998727
This 4-bit artifact vs the frozen anchormean cosine 0.96007, min 0.82945 — the codec's cost
BEIR SciFact (300 queries / 283 docs / 339 pairs), 768 dimsbaseline MRR@10 0.951778 / recall@10 0.983333; this artifact 0.935819 / 0.990000
Device (CUDA) tower vs the CPU towermin cosine 0.999999950, max rel RMS 3.149e-04 (bound 1e-03)

In plain terms: the 4-bit codec costs about 1.6 points of MRR@10 on BEIR SciFact and gains slightly on recall@10. On a 143-page Swedish collective agreement indexed page-by-page, four out of four test queries returned the correct section at rank 1 (cosines 0.7494–0.8359).

Runtime contract

{"item_tokens_max":2048,"batch_rows_max":8192,
 "image":{"soft_tokens_min":70,"soft_tokens_max":1120,
          "pixels_min":161280,"pixels_max":2580480,
          "embd":512,"per_item_max":1,"serial":true}}
  • One item ≤ 2048 tokens; one request ≤ 8192 rows total; one image per item.
  • Task prefixes come from the checkpoint's own prompt map (SearchQuery, Retrieval-document, STS, Classification, …; Raw for none).
  • --dims 512|256|128 truncates Matryoshka-style and renormalizes.
  • The CLI embeds one item per process; batching is the HTTP route's job.
  • The audio tower is not part of this artifact.

License and attribution

The base model is Apache-2.0 (Google DeepMind). This is a derivative quantization; the Apache-2.0 license text is included as LICENSE, and the upstream model card and license remain in force for the underlying weights: https://ai.google.dev/gemma/docs/gemma_4_license

Quantization and container: this project's toolchain — see RECIPE.md and docs/ for the byte-level accounting and every gate.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · ds4-rs

Нельзя запустить

GGUF-веса поддерживаются только для текстовых LLM (llama.cpp).

Ревизия весов
3bdb773

0 моделей