GGUF builds of ai-sage/Giga-Embeddings-instruct-10B-A1.8B-0826,
a 10B-parameter mixture-of-experts text encoder for Russian, English and code.
They run on stock llama.cpp.
How the port was checked, why the quantization looks the way it does, and what went wrong along the way: the engineering story.
| File | Size | Use it when |
|---|---|---|
GigaEmbeddings-10B-IQ4_XS-Q5_K-hybrid.gguf |
6.1671 GiB | Default. Smallest and fastest, same retrieval quality. |
GigaEmbeddings-10B-Q8_0.gguf |
10.3785 GiB | You have VRAM to spare and want vectors as close to the original as possible, or a plain Q8_0 file with no importance matrix involved. |
Both files were quantized directly from the same verified BF16 GGUF. Neither was requantized from the other.
No patches or forks are needed. Both files were checked on the official
llama.cpp Windows release b11160 (CPU and CUDA builds) and on the development
tree the project was built with (commit 3057bb66). Tokenization matched the
original tokenizer on every test text, and vectors matched the pinned tree
within numerical noise. Older releases were not tested.
llama-server -m GigaEmbeddings-10B-IQ4_XS-Q5_K-hybrid.gguf \
--embeddings --pooling mean -np 1 -c 2048 -ngl 99
import numpy as np
import requests
QUERY_PREFIX = "Instruct: Given a query, retrieve relevant passages\nQuery: "
def embed(texts):
r = requests.post("http://127.0.0.1:8080/v1/embeddings", json={"input": texts})
vectors = np.array([d["embedding"] for d in r.json()["data"]])
return vectors / np.linalg.norm(vectors, axis=1, keepdims=True)
docs = embed(["Москва — столица России.", "Paris is the capital of France."])
query = embed([QUERY_PREFIX + "столица России"])
print(query @ docs.T)
Three things the model needs:
-np 1). With two or more slots the
tested runtime did not keep sequences apart: two identical texts in one
batch came back as different vectors. This costs nothing in speed, because
one sequence already keeps the GPU busy. Sending a list of texts in one HTTP
request is fine; they are processed one after another.Two questions: how close is the GGUF port to the original model, and what does quantization cost on top of that.
| Model | Cosine to the original (float32 Transformers), median / worst | nDCG@10, 11 tasks |
|---|---|---|
| BF16 GGUF (not shipped) | 0.99990 / 0.99924 | 0.8434 |
| Q8_0 | 0.99945 / 0.99690 | 0.8434 |
| IQ4_XS/Q5_K hybrid | 0.99744 / 0.99188 | 0.8440 |
The cosine column compares each file with the original model in float32 on 21 fixed texts: short and long, Russian, English, code, emoji and edge cases. The nDCG column is a paired retrieval comparison on identical inputs. The tasks are ArguAna, SCIDOCS, CosQA, six CodeSearchNet languages, RuBQ and RiaNews, with exact search. Each model encoded the same 20965 sequences: the queries and documents of these tasks and of a separate dev split, plus 2000 sentences for the similarity check below.
The scores are not comparable with published MTEB results. Each task was subsampled to at most 1000 documents and 300 queries, texts were truncated at 2048 tokens, and one query instruction was used for all tasks. The setup is built to detect a quantization loss, not to rank models.
Measured on one machine: RTX 5080 16 GB, Ryzen 7 9800X3D, 31.1 GiB RAM, Windows 11, context 2048, one slot. Median seconds per sequence on a fixed sample of 80 sequences (about 600 tokens each).
| Placement | BF16 GGUF | Q8_0 | Hybrid |
|---|---|---|---|
| CPU only | 1.557 | 1.351 | 1.269 |
CUDA, about half the layers on GPU (-ngl 14) |
0.531 | 0.287 | 0.200 |
CUDA, all layers on GPU (-ngl 99) |
0.798 * | 0.053 | 0.043 |
* BF16 does not fit into 16 GB of VRAM. The driver moves the rest into system RAM without an error and the run just gets slower.
With every layer on the GPU, the hybrid adds about 6.4 GiB to VRAM usage and Q8_0 about 11.8 GiB. Cards with 8 or 12 GB were not tested. Back-to-back runs of the same configuration vary by about 2%, and runs about an hour apart by up to 20%, so treat differences under 1.2x as noise.
Two warnings from this machine:
Each tensor gets a type according to its role:
| Tensors | Type | Why |
|---|---|---|
| Routed expert gate and up | IQ4_XS | Most of the file size; each token uses only 4 of 64 experts |
| Routed expert down | Q5_K | Down projections are usually more sensitive than gate/up, so they get a higher-precision type |
| Attention, MLA projections, shared expert, dense FFN, token embeddings | Q8_0 | Used by every token |
| Router, routing bias, norms | F32 | A small error here changes which experts are selected |
The hybrid has 413 tensors at 5.0524 bits per weight: 50 IQ4_XS, 25 Q5_K,
209 Q8_0 and 129 F32. The type of every tensor was read back from the finished
file and matched the plan. This matters because llama-quantize substitutes
types it cannot apply instead of failing: its default IQ4_XS mix turns all 26
attn_k_b tensors into IQ4_NL, logs a warning and still exits with code 0.
The importance matrix was collected from the BF16 model in encoder mode, one
text per pass. The stock llama-imatrix assumes a causal language model and
does not work correctly for a bidirectional encoder, so the project patches it.
The calibration corpus has 12243 texts and 1499692 tokens: 50% Russian, 30%
English, 20% code. It was checked for overlap with every evaluation text. All
4800 expert slots were exercised, the rarest 2706 times. The matrix was merged
from 13 shards and has sha256
18e98549498cf7693c69b89995474338f0286785ff8be12aadce56b9985c86df.
deepseek2 architecture with causal
attention turned off.063b0c487fbcde25994c0cbd1d3b17c386e016a6.The conversion, calibration, quantization and evaluation pipeline is open source: github.com/pritornyi/giga-embeddings-10B-A1.8B_hybrid. It carries three patches for llama.cpp. None of them is needed to run these files; they are needed to make them:
| Patch | What it adds |
|---|---|
0001-deepseek-v3-bidirectional-converter.patch |
HF → GGUF conversion for DeepseekV3BidirectionalModel |
0002-giga-taps-layer-dump-tool.patch |
Per-layer tensor dumps for comparing with Transformers |
0003-imatrix-encoder-records.patch |
Importance-matrix collection for encoder models |
| File | Bytes | sha256 |
|---|---|---|
GigaEmbeddings-10B-IQ4_XS-Q5_K-hybrid.gguf |
6621859424 | 1d5c7a6367c986e525f2a6fbb36f3b36e464e1869df2ad9d0f724fde039047fc |
GigaEmbeddings-10B-Q8_0.gguf |
11143843136 | 4239a8943e93181e71149f281d67a3f689e29d40a0d72382deef1573f8f2fcd4 |
Source BF16 GGUF (not shipped), 19.5226 GiB, sha256
32c543d21a65ec2851cd525fc93fa222c1ab694b33b658758d2aa2b367e80952.
The base model is labeled mit on its Hugging Face page, but its repository
contains no license text. These files inherit whatever terms the base model
carries. The llama.cpp patches and the pipeline code are MIT, copyright 2026
Artyom Marchenko (pritornyi).