microsoft
phi-4
14.7B parameters · Instruct · phi family
Recommended download
Which version should I download?
Default pick: GGUF · Q4_K_M — Balanced size/quality — good default.
Set your rig to confirm it fits and to see if a higher-quality quant runs fully on your hardware.
| Format | Level | Size | Verdict | Est. speed | Quality note | Swarm | Download |
|---|---|---|---|---|---|---|---|
| GGUF | IQ4_XS | 7.40 GB | Set your rig | — | Bartowski IQ4_XS quant of Phi-4 (14.66B dense) — compact low-bit option. MIT. | 2S / 0L webseed OK | |
| GGUF | Q4_K_M | 8.28 GB | Set your rig | — | Balanced size/quality — good default. | 2S / 0L webseed OK | |
| GGUF | Q8_0 | 14.51 GB | Set your rig | — | Bartowski Q8_0 quant of Phi-4 (14.66B dense) — high-quality option. MIT. | 2S / 0L webseed OK |
GGUF · IQ4_XS
7.40 GB
- Est. speed
- —
- Swarm
- 2S / 0L webseed OK
Bartowski IQ4_XS quant of Phi-4 (14.66B dense) — compact low-bit option. MIT.
GGUF · Q4_K_M
8.28 GB
- Est. speed
- —
- Swarm
- 2S / 0L webseed OK
Balanced size/quality — good default.
GGUF · Q8_0
14.51 GB
- Est. speed
- —
- Swarm
- 2S / 0L webseed OK
Bartowski Q8_0 quant of Phi-4 (14.66B dense) — high-quality option. MIT.
Want a different quant? Request it on the board →
Runs fully on
Green = the model's best quant fits fully in GPU/unified memory at 8K context. Tap a card for its full "what runs on it" page.
Context
Advertised 16k · usable ≈ 16k (reported — model card)
How we know
Evidence grade: reported — a maintainer claim with no independent evaluation.
- phi-4 model card — observed Jul 18, 2026
Model card: 16K context window. No long-context evals published (absent from the RULER leaderboard).
Reviewed on Jul 18, 2026.
Run it
Runtime completeness (IQ4_XS torrent): llama.cpp ✅ Ollama – vision sidecar –
- – Ollama — runs the GGUF directly; no Modelfile bundled
- – vision sidecar — not a vision model
Context / KV 8,192 tokens · FP16 set above the quant table
Generic commands (no rig set). GPU-offload values assume the model fits on your GPU — set your rig for values tuned to your hardware.
llama-server -m phi-4-IQ4_XS.gguf -c 8192 -ngl 999
Use llama-cli in place of llama-server for a one-shot prompt.
FROM ./phi-4-IQ4_XS.gguf
PARAMETER num_ctx 8192
PARAMETER num_gpu 999
PARAMETER stop "<|im_end|>"
# Chat template: Ollama uses the template embedded in the GGUF (no TEMPLATE directive needed).
ollama create microsoft-phi-4 -f Modelfile
ollama run microsoft-phi-4
GGUF is not a first-class vLLM format.
vLLM GGUF support is experimental and single-file only; prefer safetensors/GPTQ/AWQ for production. If you must, pass the .gguf path to `vllm serve` with --load-format gguf on a recent vLLM.
transformers does not load GGUF weights.
GGUF weights run under llama.cpp, Ollama or LM Studio.
Load phi-4-IQ4_XS.gguf, set the context length to 8192 tokens. Set GPU offload to Max (all layers).
MLX runs MLX-format weights only (Apple Silicon). This quant is a GGUF build.
GGUF weights run under llama.cpp, Ollama or LM Studio.
Technical details
Chat template
{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'assistant') %}{{'<|im_start|>assistant<|im_sep|>' + message['content'] + '<|im_end|>'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant<|im_sep|>' }}{% endif %}
Stop strings
<|im_end|>
Evidence & provenance
Source
- Provenance
- https://huggingface.co/microsoft/phi-4
- Revision pin
-
932b33c0ec9ca189badeb22480721a8de9d0e006 - Manifest
- Present
License
- Name
- mit
- Commercial use
- yes
- Access
- Open
File hashes (SHA-256)
-
phi-4-iq4-xs/LICENSE
7df20dcdf9197e9945c14858d41c60f11b52b93e5b69e2b63416b874d598d322 -
phi-4-iq4-xs/README.md
93c2fd097df348498e33c486214e75cb7fbca1048981276ad17d33045a426e8c -
phi-4-iq4-xs/phi-4-IQ4_XS.gguf
9dfc40682994853e5666d62cf949f73723faf76b80cfd8ea2108c32e170af404 -
phi-4-q4-k-m/LICENSE
7df20dcdf9197e9945c14858d41c60f11b52b93e5b69e2b63416b874d598d322 -
phi-4-q4-k-m/README.md
93c2fd097df348498e33c486214e75cb7fbca1048981276ad17d33045a426e8c -
phi-4-q4-k-m/phi-4-Q4_K_M.gguf
01e1f25b3e6931054c6c2227b06f4969828434eebc299e8e171f55dab6814485 -
phi-4-q8-0/LICENSE
7df20dcdf9197e9945c14858d41c60f11b52b93e5b69e2b63416b874d598d322 -
phi-4-q8-0/README.md
93c2fd097df348498e33c486214e75cb7fbca1048981276ad17d33045a426e8c -
phi-4-q8-0/phi-4-Q8_0.gguf
68efc525888cc34fc2cb539c2f4409653d57994e35b3a5735d2a59b871871bf3
Explore further
Appears in
Get an email when a better quant fits your rig.
Set your rig once; we'll alert you when a new or better-fitting build lands.
Performance reports
Real-world throughput reported by the community (and scraped sources).
Community
Reviews, sampler presets and community runtime reports. Be the first to contribute.
Community runtime reports
Unofficial, community-submitted "it loads for me" reports. These are not the official verified-working badge — an admin reviews reports before anything is marked officially verified.
Log in to report whether a quant loads in your runtime.
No community reports yet.