Xylolabs

Qwen3-4B GGUF

Base model Formats License Code

GGUF quants of Qwen/Qwen3-4B for llama.cpp, on CUDA, Metal or CPU.

Files

File Size
Qwen3-4B-Q8_0.gguf 4.280 GB
Qwen3-4B-Q6_K.gguf 3.306 GB
Qwen3-4B-Q5_K_M.gguf 2.890 GB
Qwen3-4B-Q4_K_M.gguf 2.497 GB
Qwen3-4B-Q4_K_S.gguf 2.383 GB
Qwen3-4B-IQ4_XS.gguf 2.286 GB
Qwen3-4B-IQ4_XS-imat.gguf 2.271 GB
Qwen3-4B-IQ3_XXS.gguf 1.670 GB
Qwen3-4B-2m.imatrix 7.75 MB
Qwen3-4B-imat.imatrix 7.75 MB

How to run

Use llama.cpp cd959bae99ff4bed22bef2604f45241c09bbb8c8 or newer.

git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
git checkout cd959bae99ff4bed22bef2604f45241c09bbb8c8
cmake -B build -DCMAKE_BUILD_TYPE=Release        # add -DGGML_CUDA=ON for NVIDIA GPUs
cmake --build build -j --target llama-cli llama-server

./build/bin/llama-cli -m Qwen3-4B-Q5_K_M.gguf --jinja -c 8192 -ngl 99

llama-server takes the same flags.

Accuracy

The reference weights were BF16.

Quant Size WikiText-2 KL top-1 Held-out KL top-1
Xylolabs Q8_0 4.280 GB 0.001566 98.407% 0.001625 98.147%
Xylolabs Q6_K 3.306 GB 0.006034 96.887% 0.006976 96.676%
Xylolabs Q5_K_M 2.890 GB 0.011236 95.456% 0.010252 95.980%
Xylolabs Q4_K_M 2.497 GB 0.042454 91.598% 0.041984 91.676%
Xylolabs Q4_K_S 2.383 GB 0.048107 91.152% 0.048118 91.020%
Xylolabs IQ4_XS 2.271 GB 0.048621 91.529% 0.037710 92.441%
Xylolabs IQ4_XS-imat 2.271 GB 0.058079 90.539% 0.052823 90.931%
Xylolabs IQ3_XXS 1.670 GB 0.198634 82.760% 0.183483 82.931%

All files and rivals: BENCHMARKS.md

Quant Size Chat KL top-1
Xylolabs Q8_0 4.280 GB 0.001453 98.686%
Xylolabs Q6_K 3.306 GB 0.006422 97.627%
Xylolabs Q4_K_M 2.497 GB 0.043744 93.980%
Xylolabs Q4_K_S 2.383 GB 0.049789 93.539%

IQ3_XXS: Weights optimized with our implementation of IST Austria's GSQ (Gumbel-softmax code search); the output scale is calibrated.

Mean KL divergence by quant file size Top-1 agreement by quant file size

Which file for your hardware

Hardware Memory File Context
RTX 4090 / RTX 3090 24 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
RTX 5090 32 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
RTX 6000 Ada, or 2 x 24 GB 48 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
One H100 80 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
RTX PRO 6000 Blackwell (GDDR7) 96 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
DGX Spark 128 GB unified Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
Mac Studio M5 Max 128 GB unified Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
One 141 GB datacenter GPU 141 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
One B200 192 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
Mac Studio M5 Ultra 256 GB unified Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
Mac Studio M5 Ultra 512 GB unified Qwen3-4B-Q8_0.gguf (4.3 GB) 32K
One B300 (HBM3e) 288 GB Qwen3-4B-Q8_0.gguf (4.3 GB) 32K

License and notices

Apache License 2.0, copied in LICENSE. We converted the weights to GGUF and quantized them.

Citation

See the original Qwen3-4B model card for the Qwen3 technical report and citation.

Updates

  • 2026-12-06: Upgraded Q5_K_M (2.89 GB, mean KL 0.01074), IQ4_XS (2.27 GB, mean KL 0.04317) using Full-Hessian Block-OBS + Intra-Block GPTQ; updated accuracy-by-size.csv and MANIFEST.
  • 2026-12-05: Moved the full comparison to BENCHMARKS.md.
  • 2026-11-29: Added files from MaziyarPanahi and Unsloth.
  • 2026-11-29: Added the importance matrices Qwen3-4B-2m.imatrix, Qwen3-4B-imat.imatrix used for the quantized levels.
Downloads last month
6,044
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

3-bit

4-bit

5-bit

6-bit

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Xylolabs/Qwen3-4B-GGUF

Finetuned
Qwen/Qwen3-4B
Quantized
(427)
this model

Collections including Xylolabs/Qwen3-4B-GGUF