Qwen3-Embedding-4B β€” F16 GGUF (provenance-documented conversion)

An F16 GGUF conversion of Qwen/Qwen3-Embedding-4B for serving with llama-server, published with a complete, verifiable provenance chain β€” source revision, converter version, and output checksum.

Why this repo exists

Qwen3-Embedding GGUFs have a known conversion-vintage trap: llama.cpp's Qwen3-Embedding conversion fixes (EOS/sep handling, pooling metadata β€” definitive fix #15023, 2025-08-02) live in convert_hf_to_gguf.py, so a GGUF converted before the fix has the bug baked in permanently β€” a current runtime cannot repair it (see #14234). Many third-party conversions have squashed histories, making their conversion vintage unprovable.

This conversion is documented at commit level so you don't have to trust β€” you can check:

Provenance fact Value
Source repo Qwen/Qwen3-Embedding-4B (official, Apache-2.0)
Source revision 5cf2132abc99cad020ac570b19d031efec650f2b
Source shard sha256 model-00001…: e70bfe3c970523fb7ef4eddffed2254ce3f1e7150c3de2af4342de129dd756f8 Β· model-00002…: ed1b87c8e9eb7e535a1a155e4fd00d9f4dba80e58a6db48a4c9f82cede7079c1 (verified pre-conversion)
Converter convert_hf_to_gguf.py from the official ghcr.io/ggml-org/llama.cpp:full-cuda13 image, digest sha256:500f241b5d7e27846bdda69ce6f4889db8de859ea3988d4265e5d9d7b7f1079b β€” post-#15023
Conversion date 2026-07-05
Output Qwen3-Embedding-4B-F16.gguf, 8,049,889,760 bytes, sha256 aae9f588cb47cba4503d5a0c71f64c90ade6a207dff2ff874972e2db6b099d35
Pooling metadata qwen3.pooling_type = 3 (LAST) present in the GGUF header β€” the #15023 fix's marker

The exact conversion command:

docker run --rm -v "$PWD/src:/src:ro" -v "$PWD/out:/out" \
  ghcr.io/ggml-org/llama.cpp:full-cuda13@sha256:500f241b5d7e27846bdda69ce6f4889db8de859ea3988d4265e5d9d7b7f1079b \
  --convert /src --outtype f16 --outfile /out/Qwen3-Embedding-4B-F16.gguf

Fidelity check

Verified against the official safetensors pipeline (sentence-transformers, same revision): cosine(reference, served) over a 66-probe multilingual set (Romanian, three diacritic-variant forms) β€” min cosine 0.99976, i.e. the served GGUF endpoint reproduces the reference embeddings.

Serving

llama-server -m Qwen3-Embedding-4B-F16.gguf --embeddings --pooling last -ngl 999 \
  --ctx-size 8192 --ubatch-size 2048
  • --pooling last must be explicit. Qwen3-Embedding is a causal decoder β€” CLS/mean pooling produces silently wrong embeddings. Bring-up check: the verbose server log should print pooling type = 3, and any returned vector should have L2 norm β‰ˆ 1.0 (normalization is server-side by default).
  • Never combine --embeddings with --reranking on one instance (llama.cpp #20085: all-zero embeddings).
  • VRAM guidance: F16 weights are ~8.0 GiB; on a 16 GiB card use --ubatch-size 2048 (a 8192 ubatch allocates a ~4.9 GiB compute buffer and OOMs). Ubatch is throughput-only for causal decoders β€” it never changes embedding values.

Query instruction protocol (client-side)

Per the official model card, queries should be instruction-formatted while documents are embedded plain:

Instruct: {task_description}
Query:{query}

The server embeds whatever text it receives β€” applying the instruction prefix is the caller's job. Skipping it typically costs 1–5% retrieval quality.

License & attribution

Apache-2.0, same as the base model. All model weights are Β© the Qwen team (Qwen/Qwen3-Embedding-4B); this repo contributes only the format conversion and its provenance documentation.

Downloads last month
27
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rodraco/Qwen3-Embedding-4B-F16-GGUF

Quantized
(46)
this model