Memory is the first limit you hit with a local model. If the model does not fit, speed does not matter. On Apple silicon the CPU and GPU share one pool of unified memory, so the same gigabytes hold the operating system, your tools, the model weights and the context cache.
Three parts of the bill
- Weights: the model itself. Roughly the parameter count times the bits per weight divided by eight. A 30 billion parameter model at 4-bit is about 15 GB, plus a little for quantization scales.
- Context cache: the memory the model uses to remember the conversation. It grows with context length, and how much it grows depends on the model architecture.
- Everything else: macOS, your editor, a browser, builds and other processes.
What published tests show
Bohemian Silicon measured peak memory as reported by MLX on a Mac Studio M5 Ultra with 256 GB, on 15 October 2026, using 4-bit weights. The numbers include weights and context cache.
| Model | Weights on disk | Memory, empty context | Memory, 32k context |
|---|---|---|---|
| Qwen3.5 9B | 6.0 GB | 5.5 GB | 7.4 GB |
| gpt-oss-20b | 12.1 GB | 11.7 GB | 12.8 GB |
| Qwen3.5 27B | 16.1 GB | 15.3 GB | 18.8 GB |
| Qwen3.5 35B-A3B | 20.4 GB | 18.8 GB | 20.6 GB |
| Gemma 4 31B | 28.8 GB | 26.6 GB | 31.5 GB |
| gpt-oss-120b | 63.4 GB | 59.5 GB | 61.0 GB |
The cost of a 32k context is very different per model. Qwen3.5 9B grows by about 1.9 GB and Qwen3.5 27B by about 3.5 GB, while gpt-oss-20b grows by about 1.1 GB. The architecture matters as much as the parameter count, so use the published figure for your model when it exists instead of a rule of thumb.
The largest case in the same series is Qwen3.5 397B-A17B at 4-bit, tested on 12 November 2026. Peak memory was 224.3 GB at a 512-token prompt, 227.5 GB at 32k and 230.6 GB at 131k. On a 256 GB machine that leaves under 30 GB for the rest of the system.
Not all memory is available to the model
macOS does not let the GPU use every gigabyte. Apple does not publish the exact split, so for planning we assume roughly two thirds of the memory is usable for a model on machines with 36 GB or less, and roughly three quarters on the 64 GB and 128 GB machines. That gives about 16 GB on a 24 GB Mac mini and about 48 GB on a 64 GB machine. These are planning figures. For 256 GB we have a measurement: on macOS 27.2, a 256 GB Mac Studio reported a default GPU limit of 240 GB (Bohemian Silicon, 12 November 2026). The real limit depends on what else is running. Leave headroom: a model that fills the usable space will start to page and slow down badly.
| Configuration | Memory | Planning ceiling | Example fit |
|---|---|---|---|
| Mac mini M6 | 24 GB | about 16 GB | A 9B to 14B model at 4-bit with moderate context |
| Mac mini M5 Pro, Mac Studio M5 Max | 64 GB | about 48 GB | A model up to about 32B with long context |
| Mac Studio M5 Max | 128 GB | about 96 GB | gpt-oss-120b with room for 32k context |
| Mac Studio M5 Ultra | 256 GB | 240 GB (measured default) | Large mixture-of-experts models of 100 to 200 GB |
The 256 GB row needs a caveat. The 397B model above peaked at 224 GB to 231 GB, which is under the measured 240 GB default limit but leaves little spare memory. Published tests show that such a model can run on the 256 GB machine on default settings. Treat it as the extreme case, not the comfortable one.
Dense or mixture of experts
A mixture-of-experts model keeps all its weights in memory but uses only a fraction per token. Memory needs are set by the total size, while speed is set by the active part. A 35B-A3B model needs memory for 35 billion parameters and runs at the speed of a much smaller model. Dense models need the same memory per parameter and also run slower. The speed numbers are in our benchmark roundup.
How to estimate your case
- Take the file size of the quantized model as the weights figure.
- Add the context cache for the longest prompt you will use. Use a published number for your model if you can find one, and otherwise expect a few GB at 32k.
- Add a runtime overhead. The memory calculator uses 1.5 GB plus 2 percent of the weights. Keep extra room for your own tools if you run builds or a browser on the same machine.
- Compare the total with the usable share of the machine memory: roughly two thirds on machines up to 36 GB, roughly three quarters on 64 GB and 128 GB machines, and 240 GB measured on a 256 GB machine.
The memory calculator follows the same approach and shows which configurations fit. Its limits are the same estimates as in the table above, except that it still applies three quarters at 256 GB (192 GB), so it is conservative there.
Buy memory for the model you expect to run in a year, and leave headroom below the usable limit. If your model is close to the line, rent the next size up for a day and test with your real context length.