phi-4
phi-4 is an open-weight language model from Microsoft with 14.7B parameters. At 4-bit it needs about 11.5 GB of memory, so the smallest current device that fits it is the GeForce RTX 5060 Ti 16GB.
Overview
Includes room for an 8k context and runtime overhead. More context needs more memory.
Key information
- Lab
- Microsoft
- Released
- 11 Dec 2024
- Parameters
- 14.7B
- Type
- Language
- Context
- 16,384 tokens
- License
- MIT
- HF downloads, 30 days
- 236,972
- Repository
- microsoft/phi-4
More from Microsoft
View allWill it run on your hardware?
How we estimate| Estimate or device | Memory |
|---|---|
| Q4 | 11.5 GB |
| Q8 | 18.9 GB |
| BF16 | 34.1 GB |
| RTX 5060 Ti 16 GB | 16 GB usable |
| RTX 5090 32 GB | 32 GB usable |
| DGX Spark 128 GB | 108.8 GB usable |
| Mac Studio M5 Ultra 256 GB | 192 GB usable |
Single-device memory estimate. Pick a device to update the On your device column.
36 GB usable memory
| Format | Memory needed | On your device | Example hardware |
|---|---|---|---|
| 4-bit (Q4) | ≈ 11.5 GB | Fits 32% | GeForce RTX 5060 Ti 16GB16 GB memory |
| 8-bit (Q8) | ≈ 18.9 GB | Fits 52% | Arc Pro B6024 GB memory |
| 16-bit (BF16) | ≈ 34.1 GB | Tight 95% | L40S48 GB memory |
Fits means the estimate stays within 90% of usable memory. Tight is above 90% and up to 100%. Too big is above 100%. These are memory checks, not speed or compatibility tests.
Mac allowances are 66% of total RAM up to 36 GB, and 75% above. AI boxes allow 85% because their memory is shared with the operating system.
Where to run it
With GGUF
Choose a file for llama.cpp or a compatible app.
bartowski/phi-4-GGUFFind compatible hardwareThrough an API
DeepInfra (bf16) is the cheapest provider we found.
$0.056 / $0.112
Input / output per 1M tokens
₹5.28 / ₹11 at ₹94.29 per $1
Blended: $0.07 (₹6.60) per 1M. Ranked by a 3:1 mix of input and output tokens.
llama-cli -hf bartowski/phi-4-GGUF \
-c 8192 -p "Explain how a transformer works."Example commands built from the repository ids above. They need a working install of llama.cpp. We have not run them; check each repository for available files.
| Precision | |||||
|---|---|---|---|---|---|
| DeepInfraCheapest | $0.07₹6.60 | $0.056₹5.28 | $0.112₹11 | 16,384 | BF16 |
INR at ₹94.29 per $1. Prices fetched 14 Nov 2026.
More about this model
Frequently asked questions
How much memory does phi-4 need? At an 8k context, about 11.5 GB at 4-bit, 18.9 GB at 8-bit and 34.1 GB at 16-bit (BF16). A longer context needs more.
Can I run phi-4 on a Mac? The smallest current Mac that fits the 4-bit estimate of 11.5 GB is the Mac mini M5 Pro (24GB). We have not found a trusted MLX build yet, but a GGUF build is available.
Does the full context fit? phi-4 supports up to 16,384 tokens of context. Our memory estimates use 8k, so long prompts need more memory than shown.
What does it cost through an API? The cheapest provider we found is DeepInfra, at $0.06 per 1M input tokens and $0.11 per 1M output tokens (₹5.28 and ₹11 at 94.29 rupees per dollar). Ranked by a 3:1 mix of input and output tokens.
License in plain English
MIT. This license permits commercial use, modification and redistribution, as long as the copyright and license notice are kept. This summary is not legal advice.
OMHQ RigBench
Not yet tested. We show no speed or quality score without a measurement.
Revision history and sources
Last updated . Sources:Hugging Face model card, GGUF repository, OpenRouter.