Microsoft · released 2025-02-19

Phi-4 Mini

3.8B dense model with a 128K context and 200K-token vocabulary, aimed at lightweight on-device use.

generalsmallmultilingual
Parameters
3.8B
Active / token
3.8B
Context
128K
Memory at Q4
4.0 GB
License
mit
Images
No
Thinking mode
No

Cheapest ways to use it $0.075 in / $0.30 out per 1M tokens via Azure AI Foundry (Models sold directly by Azure) · or free on RTX 4060 or better

Get started

1 · Try it now

Use via API from $0.075/1M on Azure AI Foundry (Models sold directly by Azure)

Free online chats are the quickest way to see if a model suits you before downloading anything.

2 · Download the files

You’ll need about 4.0 GB of memory at 4-bit. Check your machine →

3 · Run it on your machine

For a Linux GPU server, serving an OpenAI-compatible API:

vllm serve microsoft/Phi-4-mini-instruct

Will it run on my computer?

Phi-4 Mini needs roughly 4.0 GB of GPU memory at the usual Q4 quality. Check your exact machine →

MachineBest fileFitEst. speed
RTX 4060 Q6_K Fits in memory ~48 tok/s · Fast
RTX 3060 12GB Q6_K Fits in memory ~60 tok/s · Very fast
RTX 4060 Ti 16GB Q6_K Fits in memory ~50 tok/s · Fast
RTX 3090 Q6_K Fits in memory ~121 tok/s · Very fast
RTX 4090 Q6_K Fits in memory ~127 tok/s · Very fast
RTX 5090 Q6_K Fits in memory ~174 tok/s · Very fast
M4 · 16 GB Q6_K Fits in memory ~20 tok/s · Usable
M4 Pro · 48 GB Q6_K Fits in memory ~42 tok/s · Fast
M4 Max · 128 GB Q6_K Fits in memory ~75 tok/s · Very fast
M3 Ultra · 512 GB Q6_K Fits in memory ~101 tok/s · Very fast
DGX Spark Q6_K Fits in memory ~48 tok/s · Fast
Ryzen AI Max+ 395 Q6_K Fits in memory ~37 tok/s · Fast

PCs assume 64 GB system RAM. Estimates, not measurements — method.

Ways to run it

Use it through an API 1 provider

ProviderInput / 1MOutput / 1MStated precisionContext
Azure AI Foundry (Models sold directly by Azure) $0.075 $0.30 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

SetupFromPer hourFileEst. speedPer 1M tokens*
1× RTX A5000 24GB RunPod
community
$0.16 8-bit
5.8 GB
~91 tok/s $0.49
1× RTX 3090 24GB Vast.ai
marketplace
$0.21 8-bit
5.8 GB
~105 tok/s $0.56
1× RTX 3090 Ti 24GB Vast.ai
marketplace
$0.27 8-bit
5.8 GB
~110 tok/s $0.68
1× L4 24GB Vast.ai
marketplace
$0.32 8-bit
5.8 GB
~43 tok/s $2.07

*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

FileQualityWeights+ 8K contextTotal
Q3_K_MNoticeably worse 1.9 GB 1.1 GB 3.6 GB
Q4_K_MGood — the usual pick 2.3 GB 1.1 GB 4.0 GB
Q5_K_MVery close to full 2.7 GB 1.1 GB 4.5 GB
Q6_KNear lossless 3.1 GB 1.1 GB 4.9 GB
Q8_0Practically lossless 4.0 GB 1.1 GB 5.8 GB
FP16Full precision 7.6 GB 1.1 GB 9.5 GB

Test answers

Phi-4 Mini is queued for our test suite. See tested models →

Similar models