Xylolabs

phi-4 GGUF

Base model Formats License Code

GGUF quants of microsoft/phi-4 for llama.cpp, on CUDA, Metal or CPU.

Files

File Size
phi-4-Q5_K_M.gguf 10.500 GB
phi-4-Q4_K_M.gguf 9.059 GB
phi-4-IQ4_XS.gguf 8.259 GB
phi-4-IQ4_XS-imat.gguf 8.187 GB

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 phi-4-Q5_K_M.gguf --jinja -c 8192 -ngl 99

llama-server takes the same flags.

Accuracy

Against BF16.

Quant Size WikiText-2 KL top-1 Held-out KL top-1
Unsloth Q8_0 15.581 GB 0.000465 98.706% 0.000259 99.294%
llama.cpp Q8_0 15.580 GB 0.000460 98.824% 0.000265 99.304%
Unsloth Q6_K 12.030 GB 0.002103 97.583% 0.001274 98.422%
llama.cpp Q6_K 12.030 GB 0.002112 97.520% 0.001251 98.392%
Q5_K_M 10.500 GB 0.005030 96.270% 0.003265 97.118%
Unsloth Q5_K_M 10.413 GB 0.005218 96.260% 0.003347 97.137%
Q4_K_M 9.059 GB 0.016550 94.039% 0.012006 94.725%
Unsloth Q4_K_M 8.890 GB 0.017342 93.824% 0.012320 94.745%
IQ4_XS 8.259 GB 0.018695 93.539% 0.013586 94.412%
IQ4_XS-imat 8.187 GB 0.017889 93.598% 0.012414 94.471%
llama.cpp Q3_K_M 7.373 GB 0.051110 89.721% 0.035958 91.500%
Unsloth Q3_K_M 7.191 GB 0.057706 89.059% 0.039513 90.676%
Unsloth Q2_K_L 5.729 GB 0.224612 79.206% 0.166215 81.804%
Unsloth Q2_K 5.609 GB 0.227470 79.216% 0.171434 81.500%
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 phi-4-Q5_K_M.gguf (10.5 GB) 16K
RTX 5090 32 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
RTX 6000 Ada, or 2 x 24 GB 48 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
One H100 80 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
RTX PRO 6000 Blackwell (GDDR7) 96 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
DGX Spark 128 GB unified phi-4-Q5_K_M.gguf (10.5 GB) 16K
Mac Studio M5 Max 128 GB unified phi-4-Q5_K_M.gguf (10.5 GB) 16K
One H200 (HBM3e) 141 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
One B200 192 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K
Mac Studio M5 Ultra 256 GB unified phi-4-Q5_K_M.gguf (10.5 GB) 16K
Mac Studio M5 Ultra 512 GB unified phi-4-Q5_K_M.gguf (10.5 GB) 16K
One B300 (HBM3e) 288 GB phi-4-Q5_K_M.gguf (10.5 GB) 16K

License and notices

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

Citation

Cite the original Microsoft Phi-4 release.

Updates

  • 2026-11-25: Added Unsloth's files and llama.cpp's own quantizations to the accuracy table and charts.
  • 2026-11-23: Added a hardware recommendation table.
  • 2026-11-15: First release of phi-4-IQ4_XS-imat.gguf, phi-4-IQ4_XS.gguf, phi-4-Q4_K_M.gguf, phi-4-Q5_K_M.gguf.
Downloads last month
1,354
GGUF
Model size
15B params
Architecture
phi3
Hardware compatibility
Log In to add your hardware

4-bit

5-bit

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

Model tree for Xylolabs/phi-4-GGUF

Base model

microsoft/phi-4
Quantized
(175)
this model

Collections including Xylolabs/phi-4-GGUF