Home›Models›phi-4

Model sheet

phi-4

Architecture dense40 LayersLicense mitMaximum context 16kVocabulary 100,352

Microsoft chart: Phi-4 against other models by MMLU score and active parameters, with Microsoft's own figures
Microsoft chart: Phi-4 against other models by MMLU score and active parameters, with Microsoft's own figures Image: Microsoft

Watch the video

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.

At a glance
Size at Q4_K_M8.43 GiB
Context memory at 8k1.56 GiB
Fits on17 / 18
German cost×1.63
Smallest machine that takes itPC with an RTX 3060 12 GB
8.43 GiB

Model size at Q4_K_M

Measured by Local AI Scope

1.56 GiB

Context memory at 8k tokens

Measured by Local AI Scope

×1.63

What German costs versus English

Measured by Local AI Scope

Videos

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

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.

Size of the published file for each compression
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

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
Languages

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.

Token cost per kind of text and language, with English as the baseline
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.

Machines

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).

The 18 machine profiles, with the memory each one leaves and the largest context this model holds on it
Machine Fits Memory left Largest context that fits
PC with an RTX 4060 8 GB no 7.20 GiB —
PC with an RTX 3060 12 GB yes 11.20 GiB 8k
PC with an RTX 4070 12 GB yes 11.20 GiB 8k
Mac with M4 and 16 GB unified memory yes 13.00 GiB 16k
Office laptop, CPU only, 16 GB yes 13.00 GiB 16k
Mac mini with M6 and 16 GB yes 13.00 GiB 16k
Mac with M4 Pro and 24 GB yes 21.00 GiB 16k
Workstation with an RTX 4090 24 GB yes 23.20 GiB 16k
Mini-PC with an NPU and 32 GB LPDDR5X yes 29.00 GiB 16k
Mac mini with M6 and 32 GB yes 29.00 GiB 16k
Server with 2× RTX 3090 (48 GB) yes 47.20 GiB 16k
Mac with M4 Max and 64 GB yes 61.00 GiB 16k
Mac mini with M5 Pro and 64 GB yes 61.00 GiB 16k
Xiaomi AI Cube, 80 GB — engineering prototype yes 77.00 GiB 16k
PC with Ryzen AI Max+ 395 and 128 GB unified yes 96.00 GiB 16k
Mac Studio with M5 Max and 128 GB yes 125.00 GiB 16k
PC with Ryzen AI Max+ PRO 495 and 192 GB unified yes 160.00 GiB 16k
Mac Studio with M5 Ultra and 512 GB yes 509.00 GiB 16k

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.