Local LLMs on a Mac: how much unified memory do you need?
Short answer: about 16 GB runs 7B to 14B models at 4-bit, 32 to 36 GB runs the 27B to 35B class (and Mixtral 8x7B), 64 GB is the smallest Mac that holds Llama 70B at 4-bit, and 96 GB or more runs 120B-class models such as gpt-oss-120b. The table below works this out for every memory size Apple sells, from the same file sizes as our VRAM calculator.
Unified memory isn't all VRAM
On an Apple silicon Mac the CPU and GPU share one pool of memory, so there is no separate VRAM. But macOS doesn't let the GPU use all of it by default. Metal reports a limit called recommendedMaxWorkingSetSize, and llama.cpp, Ollama, LM Studio and MLX plan around it.[1][2]
- Apple's own example: on M1 Pro/Max MacBook Pros, a 32 GB Mac lets the GPU use 21 GB, and a 64 GB Mac lets it use 48 GB.[1]
- A llama.cpp user's log from a 24 GB M3 shows 16,383 MiB free for the GPU at the default setting.[3]
That's roughly two-thirds to three-quarters of memory in these examples. Apple doesn't publish a figure for every Mac, so check yours: llama.cpp prints recommendedMaxWorkingSetSize when it loads a model, and in MLX mx.device_info()["max_recommended_working_set_size"] gives the same number.[2][4]
What fits, by Mac memory size
| Unified memoryMacs sold with it | LLMs that fit | Largest: under 90% | Largest: under ⅔ |
|---|---|---|---|
| 16 GBMacBook Air (M5), iMac (M6), Mac mini (M6), 14-inch MacBook Pro (M6) | 11 of 30see list | gpt-oss-20b16-bit (FP16/BF16), 14.0 GB | Qwen2.5 14B Instruct4-bit (Q4_K_M), 10.6 GB |
| 24 GBMacBook Air, iMac, Mac mini (M6 or M5 Pro), MacBook Pro (M6 or M5 Pro) | 15 of 30see list | Gemma 4 31B*4-bit (Q4_K_M), 19.6 GB | LFM2.5-24B-A2B4-bit (Q4_K_M), 14.7 GB |
| 32 GBMacBook Air, iMac (12-core), Mac mini (M6), 14-inch MacBook Pro (M6) | 22 of 30see list | Mixtral 8x7B Instruct v0.14-bit (Q4_K_M), 27.5 GB | Gemma 4 31B*4-bit (Q4_K_M), 19.6 GB |
| 36 GBMacBook Pro (M5 Max, 32-core GPU), Mac Studio (M5 Max) | 22 of 30see list | Mixtral 8x7B Instruct v0.14-bit (Q4_K_M), 27.5 GB | Qwen3.6 35B-A3B4-bit (Q4_K_M), 22.5 GB |
| 48 GBMacBook Pro (M5 Pro or M5 Max), Mac mini (M5 Pro), Mac Studio (M5 Max) | 22 of 30see list | Mixtral 8x7B Instruct v0.14-bit (Q4_K_M), 27.5 GB | Mixtral 8x7B Instruct v0.14-bit (Q4_K_M), 27.5 GB |
| 64 GBMacBook Pro (M5 Pro 20-core GPU or M5 Max), Mac mini (M5 Pro), Mac Studio (M5 Max) | 24 of 30see list | Llama 3.1 70B Instruct4-bit (Q4_K_M), 45.2 GB | Mixtral 8x7B Instruct v0.14-bit (Q4_K_M), 27.5 GB |
| 96 GBMac Studio (M5 Ultra) | 26 of 30see list | Ornith-1.5-122B4-bit (Q4_K_M), 79.9 GB | gpt-oss-120b8-bit (Q8_0), 63.7 GB |
| 128 GBMacBook Pro (M5 Max, 40-core GPU), Mac Studio (M5 Max) | 26 of 30see list | Ornith-1.5-122B4-bit (Q4_K_M), 79.9 GB | Ornith-1.5-122B4-bit (Q4_K_M), 79.9 GB |
| 256 GBMac Studio (M5 Ultra, 80-core GPU) | 27 of 30see list | Qwen3.8 Flash Next8-bit (Q8_0), 188.5 GB | Qwen3.8 Flash Next4-bit (Q4_K_M), 119.8 GB |
| 512 GBMac Studio (M5 Ultra, 80-core GPU) | 27 of 30see list | Qwen3.8 Flash Next16-bit (FP16/BF16), 354.2 GB | Qwen3.8 Flash Next8-bit (Q8_0), 188.5 GB |
"Largest" = most parameters among the 30 language models in our calculator, at the highest precision that fits (16-bit, 8-bit or 4-bit Q4_K_M). Memory needed = Hugging Face GGUF file size + FP16 KV cache for 8,192 tokens. "Under 90%" is our usual rule, the same as the calculator. "Under ⅔" is the cautious case: it assumes you have not raised the macOS GPU limit (see below). * = KV cache not in our data, so only the weights are counted. Model data checked 2026-10-30; Mac line-up from apple.com spec pages, checked 2026-11-02.
The calculator has every Mac size above in its GPU list, so you can pick your Mac in the calculator and change the context length.
Raising the GPU memory limit
If a model is a little over your Mac's default GPU limit, you can raise the limit until the next reboot:
sudo sysctl iogpu.wired_limit_mb=20480
The number is in megabytes (20480 = 20 GB). MLX's documentation names this command as the way to raise the system limit,[4] and a llama.cpp maintainer suggested it to a user whose model ran out of Metal memory; raising it fixed the problem.[5] In the 24 GB M3 example above, setting 20480 let an 18 GiB Q4_K_M model load fully on the GPU after it had failed at the default.[3]
Things to know first:
- Apple doesn't document this setting, and it resets when you restart.
- Leave room for macOS and your apps. The same user reported the whole laptop hanging and rebooting once when two LLM apps were open with the raised limit.[3] Don't set it close to your total memory.
- Raising the limit doesn't add memory. It only helps when a model is between the default limit and your total RAM. Our "under 90%" column assumes you've raised it; the two-thirds column assumes you haven't.
Can a MacBook run Llama 70B?
Llama 3.3 70B at 4-bit (Q4_K_M) plus an 8K-token context needs about 45.2 GB (calculator).
- 64 GB MacBook Pro (M5 Pro or M5 Max): yes. It's under 90% of 64 GB, and under the 48 GB Apple gave the GPU on a 64 GB M1 Max.[1] One published benchmark measured Llama 3 70B Q4_K_M on a 64 GB M3 Max at 7.53 tokens/s generation.[6]
- 128 GB MacBook Pro (M5 Max): yes, comfortably, with room for a longer context or the 8-bit version.
- 48 GB: only just. 45.2 GB is over 90% of 48 GB and above the default GPU limit, so you would have to raise the limit and keep the context short.
- 36 GB or less: no, not at 4-bit.
Speed: memory bandwidth matters most
How fast a Mac generates text follows its memory bandwidth. Apple's spec pages list 153 GB/s for M5, 153 to 170 GB/s for M6, 307 GB/s for M5 Pro, 460 or 614 GB/s for M5 Max and 1.2 TB/s for M5 Ultra.[7] Measured llama.cpp results for the same small test model (Llama 2 7B, Q4_0, tg128):[8]
| Chip (GPU cores) | Generation |
|---|---|
| M4 Max (40-core) | 83.06 tok/s |
| M5 Pro (20-core) | 66.33 tok/s |
| M5 Max (40-core) | 119.92 tok/s |
| M5 Ultra (80-core) | 179.10 tok/s |
For comparison, an RTX 4090 scored 186.21 tok/s on the same test (CUDA scoreboard).[9] A Mac's advantage is capacity, not speed: no single consumer graphics card has 64 GB or more. More results are on the measured speed page.
MLX or GGUF?
GGUF is the file format for llama.cpp, Ollama and LM Studio, and it's what our sizes are based on. MLX is Apple's machine-learning framework; MLX models (often from the mlx-community organization on Hugging Face) are separate files with their own sizes, run with mlx-lm or LM Studio. Both use the same unified-memory limit.[4]
Related
- What can I run?: pick your Mac or GPU and see everything that fits
- RTX 4090 fit table and 4090 vs 3090 speed
- Run a MoE model bigger than your memory
- GPU VRAM lookup: every GPU and Mac in one table
Sources
All sources checked on .
- Apple Developer, Tech Talk "Metal Compute on MacBook Pro" (recommendedMaxWorkingSetSize; 32 GB → 21 GB, 64 GB → 48 GB GPU working set). https://developer.apple.com/videos/play/tech-talks/10580/
- llama.cpp source, ggml-metal-device.m (reads and logs recommendedMaxWorkingSetSize). https://github.com/ggml-org/llama.cpp/blob/master/ggml/src/ggml-metal/ggml-metal-device.m
- llama.cpp GitHub discussion #15372, "Memory consumption" (24 GB M3: 16,383 MiB free at default; 20,479 MiB after
iogpu.wired_limit_mb=20480). https://github.com/ggml-org/llama.cpp/discussions/15372 - MLX documentation, mlx.core.set_wired_limit (system wired limit,
device_info(),sudo sysctl iogpu.wired_limit_mb). https://ml-explore.github.io/mlx/build/html/python/_autosummary/mlx.core.set_wired_limit.html - llama.cpp GitHub issue #16646 (maintainer comment, 2025-10-18:
sudo sysctl iogpu.wired_limit_mb=120000). https://github.com/ggml-org/llama.cpp/issues/16646 - XiongjieDai, GPU-Benchmarks-on-LLM-Inference (M3 Max 40-core 64 GB, Llama 3 70B Q4_K_M). https://github.com/XiongjieDai/GPU-Benchmarks-on-LLM-Inference
- Apple, tech specs for MacBook Pro, Mac Studio, Mac mini, MacBook Air and iMac (memory options and bandwidth). https://www.apple.com/macbook-pro/specs/, https://www.apple.com/mac-studio/specs/, https://www.apple.com/mac-mini/specs/, https://www.apple.com/macbook-air/specs/, https://www.apple.com/imac/specs/
- llama.cpp GitHub discussion #4167, "Performance of llama.cpp on Apple Silicon M-series". https://github.com/ggml-org/llama.cpp/discussions/4167
- llama.cpp GitHub discussion #15013, "Performance of llama.cpp on Nvidia CUDA". https://github.com/ggml-org/llama.cpp/discussions/15013