phi-4
Architecture dense40 LayersLicense mitMaximum context 16kVocabulary 100,352
At Q4_K_M it is an 8.43 GiB file, and it fits on 17 of the 18 machines we measure (those with the least memory: PC with an RTX 3060 12 GB · PC with an RTX 4070 12 GB). Here the file is what fills the memory: even at its maximum context of 16k tokens, the context adds 3.12 GiB — and the same content in German takes ×1.63 the tokens of English.
Model size at Q4_K_M
Measured by Local AI Scope
Context memory at 8k tokens
Measured by Local AI Scope
What German costs versus English
Measured by Local AI Scope
Videos: phi-4 1
The best walk-throughs we found. Press play and it opens right here.
The videos live on YouTube, and nothing loads from there until you press play (no-cookie mode). The thumbnail is served by us.
Sizes of the real published files
These are the sizes of the files actually published by the author, added up when the model ships split into parts. Not an estimate from the parameter count.
| Compression | Model size |
|---|---|
Q8_0 |
14.51 GiB |
Q6_K |
11.20 GiB |
Q5_K_M |
9.88 GiB |
Q5_K_S |
9.45 GiB |
Q4_K_M |
8.43 GiB |
Q4_K_S |
7.86 GiB |
IQ4_XS |
7.40 GiB |
Q3_K_M |
6.86 GiB |
Context memory
Computed from the attention pattern this model declares layer by layer, not from the generic formula. That is why the figure is often far smaller than other calculators tell you. This model’s config.json does not state the size of each attention head, and that number is what the context memory is made of. We derive it from two figures it does state, 5,120 hidden units over 40 attention heads, which is what the size of a head means and what the reference library assumes by default: 128. Every figure in this section rests on that derivation, so it is labelled here rather than left implicit.
- 8k tokens → 1.56 GiB
What it costs in each language
Measured by running this model’s own tokenizer over the same content in four languages. Tokens are what you pay for in context, in memory and in your cloud bill.
| Kind of text | EN | ES | FR | DE |
|---|---|---|---|---|
| Code | — | ×1.28 | ×1.48 | ×1.68 |
| Contracts | — | ×1.40 | ×1.46 | ×1.77 |
| Business email | — | ×1.27 | ×1.38 | ×1.48 |
| Support tickets | — | ×1.39 | ×1.59 | ×1.55 |
English is the baseline: every figure is how many times more tokens the same content costs in that language. Average across the whole corpus: DE ×1.63.
Where it fits
Fits means the model, its context memory and the working headroom all fit at the stated context, leaving the system its share. 17 of the 18 machine profiles tested (Q4_K_M, 8k tokens).
Before you hit download: good news first: as of 29 October 2026, all five programs we follow open Phi-4, because its architecture (phi3) is long supported. llama.cpp runs it on its latest stable release, v0.8.0 (from 28 October 2026), and on any current daily build. ollama run phi4 (no hyphen) downloads a Q4_K_M GGUF of 8.43 GiB, the same size as the one in the table, on a Mac too: there is no MLX version on the list. Ollama also has phi4:14b-q8_0 (14.51 GiB). LM Studio offers it with the GGUF from its community program (lmstudio-community), also 8.43 GiB at Q4_K_M. mlx-lm opens it in 0.32.2 (the 4-bit MLX version from mlx-community weighs 7.68 GiB), and vLLM in its stable release, 0.32.0. Two things to keep in mind. The context stops at 16k tokens: that is what its config.json declares, and no row in the table goes beyond it, however much memory you have (on the 12 GB cards memory stops it earlier, at 8k). And the language: Microsoft trained it mostly on English (about 8% of its data is multilingual) and says it is not intended for multilingual use. We measure what each language costs in tokens, not how well it answers.
