Can an Apple M4 Max 128GB run Phi 4?

Yes

At Q8_0 it needs 16.48 GB of the 96 GB available and generates around 23.9 tokens per second at an 8k context window.

In practice

Phi 4 sits comfortably on Apple M4 Max 128GB. At Q8_0 it takes 16.48 GB of the 96 GB available, which leaves 79.52 GB spare, enough for the 8k window we assumed and for a window of up to about 16k tokens before memory runs out. Generation runs at about 23.9 tokens per second, faster than most people read, so a 500-token answer takes about 20 seconds.

Of the memory in use, 88% is the weights and 9% is the attention cache. There is no higher-quality file to step up to, so the spare memory is best spent on a longer window.

Reading a 4,000-token prompt, roughly a long email or a few pages of text, takes about 20 seconds before the first word appears. That part is limited by compute and not by bandwidth, so it follows a different spec from the writing speed.

The numbers

Phi 4 has 14.66 billion parameters across 40 layers. The Apple M4 Max 128GB has 128 GB of unified memory at 546 GB/s, of which about 96 GB is left for a model once the operating system has taken its share.

QuantizationTotal neededFitsSpeed
Q8_0 16.48 GB yes 23.9 t/s
Q6_K 13.17 GB yes 30.0 t/s
Q5_K_M 11.68 GB yes 34.0 t/s
Q4_K_M 10.22 GB yes 39.0 t/s
IQ4_XS 9.23 GB yes 43.4 t/s
Q3_K_M 8.65 GB yes 46.4 t/s
IQ3_XXS degraded 7.19 GB yes 56.2 t/s
Q2_K degraded 7.69 GB yes 52.4 t/s
IQ2_XXS degraded 5.49 GB yes 74.9 t/s

9 of the 9 levels fit entirely. Levels marked degraded are listed for completeness, not as advice.

How long a conversation it holds

Memory rises with the length of the conversation because the attention cache keeps a key and a value for every token. At Q8_0, the longest window that still fits on this device is 16k tokens. Setting the window to what you need and no more is the cheapest way to buy back memory.

ContextCacheTotalFits
4k 0.78 GB 15.7 GB yes
8k 1.56 GB 16.48 GB yes
16k 3.13 GB 18.04 GB yes

The settings we would use

llama-server -m <model>.gguf -ngl all -c 8192 -fa on

In Ollama, set OLLAMA_CONTEXT_LENGTH to the window you want, run ollama ps while the model is loaded and check that the processor column reads 100% GPU. If it shows a split on a model that fits, the Ollama guide shows how to fix it. The llama.cpp flags guide explains each option above.

What else an Apple M4 Max 128GB runs well

For comparison, these are the other popular models that fit this device at a sound quantization, best pairings first.

ModelQuantizationMemorySpeed
GPT OSS 120B MXFP4 59.65 GB 68.3 t/s
Qwen3.5 27B Q8_0 28.54 GB 13.8 t/s
Gemma 4 31B Instruct Q8_0 34.64 GB 10.8 t/s
Qwen3 32B Q8_0 34.83 GB 11.0 t/s

The same model on nearby hardware

Memory decides whether Phi 4 loads and bandwidth decides how quickly it answers. Here is what a step down, a card with the same memory and a step up do with it.

DeviceMemoryBandwidthResult
Apple M4 Max 64GB 64 GB 546 GB/s Q8_0, 23.9 t/s
Ryzen AI Max+ 395 128GB 128 GB 256 GB/s Q6_K, 11.8 t/s

See how fast it feels

Apple M4 Max 128GB running Phi 4 at Q8_0

Wait for the first word2.7 s
Then writes at23.9 tok/s
Whole answer10.0 s

YouWhy does my model use more memory when the conversation gets longer?

Model

Simulated from our estimate at a 512-token question, not a recording. Assumes nothing else is competing for the GPU.

Questions people ask

How much VRAM does Phi 4 need on Apple M4 Max 128GB?

At Q4_K_M with an 8k context window it needs 10.22 GB in total: 8.24 GB of weights, 1.56 GB of KV cache and 0.41 GB of runtime overhead. The Apple M4 Max 128GB makes about 96 GB available once the operating system has taken its share.

What context length can Apple M4 Max 128GB handle with Phi 4?

At Q8_0 the longest window that still fits is about 16k tokens. Memory grows with the window, so a shorter one leaves room for a higher quantization.

How fast is Phi 4 on Apple M4 Max 128GB?

We estimate about 23.9 tokens per second at Q8_0, which is faster than most people read. A 500-token answer takes about 20 seconds. Memory bandwidth of 546 GB/s sets that ceiling, and the estimate is good to about 10 to 30 percent.

Keep going

Everything the Apple M4 Max 128GB runs, the full breakdown for Phi 4, how the numbers are made in the methodology, or a different pairing in the calculator.