llamaperf

Phi-4

Microsoft · 6 reports

Run Phi-4 yourself? Add your numbers.

Your coding agent can run a speed test on your machine and send it here with a free account. Or paste a result you've already posted.

Reported performance for Phi-4

Filter this model’s reports by setup →

Speeds are as each source reported them. GPU count, offloading and concurrent requests change them, and prompt-processing speed is input throughput, not time to first token. Check the full setup before comparing two reports.

Apple hardware
generation:
56.8 tokens/s
prompt processing (prefill):
1537.5 tokens/s
quant:
Q4_K_M (GGUF)
flash attention:
on

User reports Phi-4 at 56.8 t/s generation and 1537.5 t/s prompt processing on an M5 Max with 48GB unified memory. Setup is llama.cpp build 11146 with Metal, Q4_K_M weights, n_gpu_layers=99 and flash attention enabled. The figures are separate llama-bench microtests, tg128 and pp512, not one 512-input/128-output request or server concurrency throughput; context length is unspecified.

Oct 13, 2026
Apple hardware
generation:
164.9 tokens/s
prompt processing (prefill):
5412.7 tokens/s
quant:
Q4_K_M (GGUF)
flash attention:
on

User reports Phi-4 at 164.9 t/s generation and 5412.7 t/s prompt processing on an M5 Max 48GB. Setup is llama.cpp build 11146 with Metal, Q4_K_M weights, n_gpu_layers=99 and flash_attention=true. The figures are separate llama-bench microtests, tg128 and pp512, not one 512-input/128-output request or server concurrency throughput; context length is unspecified.

Oct 13, 2026
Apple hardware
generation:
165.0 tokens/s
prompt processing (prefill):
5416.2 tokens/s
quant:
Q4_K_M (GGUF)
flash attention:
on

User reports Phi-4-mini Q4_K_M at 165 t/s generation and 5416.2 t/s prompt processing on an M5 Max with 48GB unified memory. Setup is llama.cpp build 11146 with Metal, n_gpu_layers=99 and flash attention enabled, run as separate llama-bench microtests. The figures are native tg128 and pp512 tests, not one 512-input/128-output request or server concurrency; context length is unspecified.

Oct 13, 2026
Apple hardware
generation:
56.3 tokens/s
prompt processing (prefill):
1534.2 tokens/s
quant:
Q4_K_M (GGUF)
flash attention:
on

User reports Phi-4 at 56.3 t/s generation and 1534.2 t/s prompt processing on an M5 Max 48GB. Setup is llama.cpp build 11146 with Metal, GGUF Q4_K_M weights, n_gpu_layers=99 and flash attention enabled. The figures are separate llama-bench microtests, tg128 and pp512, not one 512-input/128-output request; context length is unspecified.

Oct 13, 2026
Apple hardware
generation:
190.8 tokens/s
prompt processing (prefill):
6281.4 tokens/s
quant:
4-bit (MLX)

User reports Phi-4 at 190.8 t/s generation and 6281.4 t/s prompt processing on an M5 Max 48GB. Setup is MLX with 4-bit weights and unquantized KV cache on one Mac Studio, batch size 1, no speculative decoding. The headline figures are pp512 and tg128 from a five-trial mean, not a best-of sweep; the source also lists pp128 3728.47, pp256 5040.15 and tg256 192.31 t/s.

Oct 13, 2026
Apple hardware
generation:
62.1 tokens/s
prompt processing (prefill):
1685.9 tokens/s
quant:
4-bit (MLX)

User reports Phi-4 at 62.1 t/s generation and 1685.9 t/s prompt processing on an M5 Max 48GB. Setup is MLX with 4-bit weights, batch size 1, unquantized KV cache and no speculative decoding, on one Mac Studio with 18 CPU cores and 40 GPU cores. The headline uses pp512=1685.9 and tg128=62.05 from a five-trial mean; retained values also include pp128=1177.05, pp256=1469.71, tg256=62.51, and peak MLX allocator memory of 8.912 GB.

Oct 13, 2026
Engines people run Phi-4 with
EngineReports
llama.cpp4
MLX2

Get a weekly email of new Phi-4 reports on any GPU.

Email me new reports

Reported configurations

Individual observations from this page, not expected speeds or a ranking. Select a model to open its report, with the source and offloading conditions. Reported context may be a limit rather than actual input length.

Model / hardwareQuant / engineReported contextGeneration
Phi-4 reasoning-plus Q4_K_M; llama-bench TG128 / PP512
M5 Max 48GB
Q4_K_M
llama.cpp
Not reported56.8 tokens/s
Phi-4 mini-reasoning Q4_K_M; llama-bench TG128 / PP512
M5 Max 48GB
Q4_K_M
llama.cpp
Not reported164.9 tokens/s
Phi-4 mini-instruct Q4_K_M; llama-bench TG128 / PP512
M5 Max 48GB
Q4_K_M
llama.cpp
Not reported165.0 tokens/s
Phi-4 Q4_K_M; llama-bench TG128 / PP512
M5 Max 48GB
Q4_K_M
llama.cpp
Not reported56.3 tokens/s
Phi-4 mini-instruct 4-bit; native pp512/tg128 summary
M5 Max 48GB
4-bit
MLX
Not reported190.8 tokens/s
Phi-4 4-bit; native pp512/tg128 summary
M5 Max 48GB
4-bit
MLX
Not reported62.1 tokens/s