Microsoft · released 2024-12-11
Phi-4
Dense 14B model trained largely on synthetic textbook-style data, strong at maths for its size but limited to a 16K context.
- Parameters
- 15B
- Active / token
- 15B
- Context
- 16K
- Memory at Q4
- 11.5 GB
- License
- mit
- Images
- No
- Thinking mode
- No
Cheapest ways to use it $0.07 in / $0.14 out per 1M tokens via DeepInfra (2 providers) · or free on RTX 3060 12GB or better
Get started
1 · Try it now
Use via API from $0.07/1M on DeepInfraFree online chats are the quickest way to see if a model suits you before downloading anything.
2 · Download the files
You’ll need about 11.5 GB of memory at 4-bit. Check your machine →
3 · Run it on your machine
Will it run on my computer?
Phi-4 needs roughly 11.5 GB of GPU memory at the usual Q4 quality. Check your exact machine →
| Machine | Best file | Fit | Est. speed |
|---|---|---|---|
| RTX 4060 | Q4_K_M | Spills to RAM | ~9.3 tok/s · Slow |
| RTX 3060 12GB | Q4_K_M | Fits in memory | ~26 tok/s · Fast |
| RTX 4060 Ti 16GB | Q6_K | Fits in memory | ~16 tok/s · Usable |
| RTX 3090 | Q6_K | Fits in memory | ~47 tok/s · Fast |
| RTX 4090 | Q6_K | Fits in memory | ~50 tok/s · Fast |
| RTX 5090 | Q6_K | Fits in memory | ~79 tok/s · Very fast |
| M4 · 16 GB | Q3_K_M | Fits in memory | ~9.5 tok/s · Slow |
| M4 Pro · 48 GB | Q6_K | Fits in memory | ~13 tok/s · Usable |
| M4 Max · 128 GB | Q6_K | Fits in memory | ~25 tok/s · Fast |
| M3 Ultra · 512 GB | Q6_K | Fits in memory | ~37 tok/s · Fast |
| DGX Spark | Q6_K | Fits in memory | ~15 tok/s · Usable |
| Ryzen AI Max+ 395 | Q6_K | Fits in memory | ~11 tok/s · Usable |
PCs assume 64 GB system RAM. Estimates, not measurements — method.
Ways to run it
Use it through an API 2 providers
| Provider | Input / 1M | Output / 1M | Stated precision | Context | |
|---|---|---|---|---|---|
| DeepInfra | $0.07 | $0.14 | bf16 | 16K | source ↗ |
| Azure AI Foundry (Models sold directly by Azure) | $0.13 | $0.50 | not stated | 125K | source ↗ |
Prices in USD from each provider’s own pricing page, checked 2026-12-04. Cheapest highlighted.
Rent a GPU and run it yourself
| Setup | From | Per hour | File | Est. speed | Per 1M tokens* |
|---|---|---|---|---|---|
| 1× RTX A5000 24GB | RunPod community | $0.16 | 8-bit 18.4 GB | ~32 tok/s | $1.40 |
| 1× RTX 3090 24GB | Vast.ai marketplace | $0.21 | 8-bit 18.4 GB | ~38 tok/s | $1.54 |
| 1× RTX 3090 Ti 24GB | Vast.ai marketplace | $0.27 | 8-bit 18.4 GB | ~40 tok/s | $1.86 |
| 1× L4 24GB | Vast.ai marketplace | $0.32 | 8-bit 18.4 GB | ~13 tok/s | $6.77 |
*For one conversation at a time. Serving many users at once (batching, e.g. with vLLM) cuts the cost per token by 10× or more, which is how API providers get so cheap. Rental prices checked 2026-12-04. All GPU prices →
On your own machine
Free after the hardware. See the table above for which GPUs and Macs can run it, or check your exact machine. Easiest apps: Ollama and LM Studio.
Memory by quality level
| File | Quality | Weights | + 8K context | Total |
|---|---|---|---|---|
| Q3_K_M | Noticeably worse | 7.2 GB | 1.7 GB | 9.7 GB |
| Q4_K_M | Good — the usual pick | 8.9 GB | 1.7 GB | 11.5 GB |
| Q5_K_M | Very close to full | 10.5 GB | 1.7 GB | 13.1 GB |
| Q6_K | Near lossless | 12.1 GB | 1.7 GB | 14.8 GB |
| Q8_0 | Practically lossless | 15.6 GB | 1.7 GB | 18.4 GB |
| FP16 | Full precision | 29.4 GB | 1.7 GB | 32.6 GB |
Test answers
Phi-4 is queued for our test suite. See tested models →