← All guides

Best Local LLM for MacBook M4: 16, 24 and 32GB Picks

On a 32GB M4, run Qwen3.6 35B-A3B. A 32GB M4 Mac mini generated 27.3-27.8 tok/s with it at contexts up to 131K in a public llama.cpp test. On 24GB, run gpt-oss 20B. On 16GB, run Qwen3.5 9B at Q6_K. The M4 has 120 GB/s of bandwidth, so mixture-of-experts models beat dense models on speed by a wide margin.

Bottom Line

  • 32GB M4: run Qwen3.6 35B-A3B. The 4-bit file is 20.61 GiB. A 32GB M4 Mac mini generated 27.3-27.8 tok/s at contexts up to 131K (community-measured, llama.cpp).
  • 24GB M4: run gpt-oss 20B. The file is 11.28 GiB and its full 128K window fits.
  • 16GB M4: run Qwen3.5 9B at Q6_K. The file is 6.95 GiB. Its bandwidth ceiling on the M4 is about 16 tok/s.
  • Your Mac gives the GPU only 74-78% of its RAM by default: 11.84 GiB on 16GB, 17.76 GiB on 24GB, 24.96 GiB on 32GB.
  • MacBook Air M4, MacBook Pro 14 M4 and Mac mini M4 have the same 120 GB/s. Use your RAM row. The machine does not change the pick.
  • On an M4, a 35B MoE model is faster than a dense 9B. Qwen3.6 35B-A3B measured 27 tok/s. Qwen3.5 9B at Q8_0 cannot pass 12.6 tok/s.
  • Apple sells no M4 Mac now. For M4 Pro, M4 Max or M5 MacBooks, see Best Local LLM for MacBook, M4 Pro and M4 Max.

Thinking about an upgrade? See the tested hardware list with current prices.

Best Local LLM for Each M4 RAM Size

Find your RAM in the first column. The chip is the same in every base-M4 machine, so only RAM changes the row.

RAMM4 machines with this RAMDefault GPU limitBest modelFileContext that fitsSpeed on M4
16GBAir 13/15, Pro 14, mini11.84 GiB (74%)Qwen3.5 9BQ6_K, 6.95 GiBAbout 127KAbout 13 tok/s (estimate)
24GBAir 13/15, Pro 14, mini17.76 GiB (74%)gpt-oss 20BMXFP4, 11.28 GiBFull 128KAbout 27 tok/s (estimate)
32GBAir 13/15, Pro 14, mini24.96 GiB (78%)Qwen3.6 35B-A3BUD-Q4_K_M, 20.61 GiBAbout 175K (131K measured)27.3-27.8 tok/s, measured

Other files worth knowing, by tier.

RAMFileSizeRoom left for cacheVerdict
16GBQwen3.5 9B Q8_08.87 GiB1.97 GiB, about 64K tokensFits. Ceiling 12.6 tok/s on M4
16GBQwen3.5 9B Q4_K_M5.29 GiB5.55 GiB, full 262KFits. Ceiling 21.1 tok/s on M4
16GBgpt-oss 20B MXFP411.28 GiBNoneDoes not fit on the GPU by default
24GBQwen3.6 35B-A3B UD-Q3_K_XL15.69 GiB1.07 GiB, about 56K tokensFits at 3 bits. Expect lower quality
24GBQwen3.6 35B-A3B UD-IQ4_XS16.51 GiB0.25 GiB, about 13K tokensToo tight for real work
24GBQwen3.6 35B-A3B MLX 4-bit19.00 GiBNoneDoes not fit
32GBQwen3.6 35B-A3B MLX 4-bit19.00 GiBAbout 4.96 GiBFits. MLX alternative to the GGUF
32GBgpt-oss 20B MXFP411.28 GiB12.68 GiBFits with room for a second model

How to read the tables.

  • File sizes are byte counts from the Hugging Face API, read 2026-10-26. GGUFs are from unsloth (Qwen) and ggml-org (gpt-oss). MLX sizes are the sum of the safetensors files in mlx-community repos. GiB = 230 bytes.
  • Room left = default limit, minus 1 GiB for compute buffers (our assumption), minus the file.
  • Context = room left divided by the f16 KV cache per token. We take the cache from each model’s config.json. Qwen3.6 35B-A3B: 10 full-attention layers × 2 KV heads × 256 × 2 × 2 bytes = 20 KiB. gpt-oss 20B: 12 full-attention layers × 8 × 64 × 2 × 2 = 24 KiB. Qwen3.5 9B: 8 × 4 × 256 × 2 × 2 = 32 KiB.
  • gpt-oss 20B at 128K needs 131,072 × 24 KiB = 3.0 GiB of cache. The 24GB M4 has 5.48 GiB left, so the full window fits.

How Much Memory the GPU Gets on an M4

macOS reports a “recommended max working set” to Metal. llama.cpp prints it at startup. The code divides the byte count by 106 and labels the result “MB” (source). So 12,713.12 “MB” is 11.84 GiB.

RAMLogged valueGiBShare of RAMMachine in the log
16GB12,713.12 MB11.8474.0%Apple M4 (mesh-llm #522); same value on an M2 Mac mini (llama.cpp #20704)
24GB19,069.67 MB17.7674.0%Apple M4 (audio.cpp #356)
32GB26,800.60 MB24.9678.0%M4 Mac mini (harborclerk #684)

The limit depends on RAM, not on the chip. The 16GB value is the same byte count on an M4 and on an M2. Your M4 is not short of GPU memory because it is a base chip.

The 32GB tier gets a bigger share. It is 78%, not 75%. That extra 0.96 GiB is what lets Qwen3.6 35B-A3B run with a long context.

How Fast Each Model Runs on an M4

Generation speed on a Mac is set by memory bandwidth. Each new token reads the model’s active weights once. The M4 has 120 GB/s, per Apple’s tech specs for all four M4 machines.

The ceiling formula (derived): tok/s ceiling = 120 GB/s ÷ GB read per token.

How close the M4 gets to that ceiling. The llama.cpp Apple Silicon table (discussion #4167) measured Llama 7B on the 10-core M4:

Llama 7B fileSizeMeasured generationBandwidth usedShare of 120 GB/s
F1612.55 GiB (13.48 GB)7.43 tok/s100 GB/s83%
Q8_06.67 GiB (7.16 GB)13.54 tok/s97 GB/s81%
Q4_03.56 GiB (3.82 GB)24.11 tok/s92 GB/s77%

So a dense model on an M4 reaches about 77-83% of its ceiling.

Dense model: Qwen3.5 9B. Every token reads the whole file.

QuantBytes read per tokenCeiling (derived)Expected, at 77-81% (estimate)
Q8_09.53 GB12.6 tok/sAbout 10 tok/s
Q6_K7.46 GB16.1 tok/sAbout 13 tok/s
Q4_K_M5.68 GB21.1 tok/sAbout 16 tok/s

MoE model: Qwen3.6 35B-A3B. Only 3B of its 35B parameters are active per token (model card). At UD-Q4_K_M the file averages 0.63 bytes per parameter. So a token reads about 3B × 0.63 = 1.90 GB. The ceiling is 120 ÷ 1.90 = 63 tok/s (derived).

The measured speed is 27.3-27.8 tok/s. The test ran on a 32GB M4 Mac mini with llama.cpp, a 2,784-token prompt, and contexts from 32K to 131K (harborclerk #684, 2026-09-21). Prompt processing was 387-403 tok/s. That is 44% of the ceiling.

MoE model: gpt-oss 20B. It has 3.6B active of 21B parameters (model card). The file averages 0.58 bytes per parameter, so a token reads about 2.08 GB. The M4 ceiling is 58 tok/s (derived).

We found no reliable M4 measurement. The llama.cpp gpt-oss guide measured 92.36 tok/s on a 36GB M4 Max (discussion #15396). Apple lists that chip at 410 GB/s. Scaled by bandwidth, 92.36 × 120 ÷ 410 ≈ 27 tok/s on an M4. That is our estimate, not a measurement.

What this means. MoE models reach under half their ceiling on Metal. Dense models reach about 80%. Even so, the MoE model wins by a wide margin, because it reads about a fifth of the bytes.

Why Qwen3.6 35B-A3B Wins on the M4

  • It is the strongest model a base M4 can run at a usable speed. It has 35B parameters and generates at 27 tok/s on 120 GB/s.
  • It is measured on an M4, not estimated. The harborclerk test is one machine, but it is a real 32GB M4 with other services running.
  • Its long context is real. The same test loaded 131,072 tokens and ran at the same speed. At 196,608 tokens the watchdog stopped the load at 4% free memory. Stay at or under 131K.
  • It costs little cache. 20 KiB per token, because only 10 of 40 layers keep a growing cache.
  • License: Apache-2.0 (model card).

One caution from that test. The app that ran the model also ran an embedder and a reranker. Under that load, a 73,728-token server failed with Metal “Insufficient Memory”. If you run other GPU apps next to the model, use a smaller context.

The 16GB M4: What Works and What Does Not

A 16GB M4 gives the GPU 11.84 GiB. That rules out the usual “16GB” picks.

  • Qwen3.5 9B fits well. On an M4 we pick Q6_K over Q8_0. It raises the ceiling from 12.6 to 16.1 tok/s and doubles the context to about 127K. Use Q8_0 if quality matters more than speed.
  • gpt-oss 20B does not fit on the GPU. OpenAI’s model card says it runs “within 16GB of memory”. On a Mac, the GPU gets only 11.84 GiB of that 16GB. The 11.28 GiB file leaves 0.56 GiB, which is less than the buffers need.
  • The llama.cpp fix is partial CPU offload. The gpt-oss guide says 16GB Macs must keep some layers on the CPU: llama-server -hf ggml-org/gpt-oss-20b-GGUF --n-cpu-moe 12 -c 32768 --jinja --no-mmap. Expect lower speed. See —n-cpu-moe explained.
  • The default Ollama route is worse. 9to5Mac ran gpt-oss 20B on a 16GB M4 MacBook Air in Ollama. Its answer to “hello” took more than five minutes.

Raising the limit. sudo sysctl iogpu.wired_limit_mb=13312 sets the GPU limit to 13 GiB. That gives gpt-oss 20B about 0.72 GiB of room, about 31K tokens, at our 1 GiB buffer assumption. It also leaves macOS only 3 GiB. We do not recommend it on a machine you work on. More detail is on our 16GB MacBook Pro page.

MacBook Air M4 vs MacBook Pro M4 vs Mac mini M4

All four machines use the same M4 chip with 120 GB/s, per Apple’s tech-spec pages. The differences that matter for local models:

MachineBase RAMRAM optionsGPU
MacBook Air 13” M4 (2025)16GB24GB or 32GB8-core or 10-core; 24GB and 32GB come with the 10-core
MacBook Air 15” M4 (2025)16GB24GB or 32GB10-core
MacBook Pro 14” M4 (2024)16GB or 24GB24GB or 32GB10-core
Mac mini M4 (2024)16GB24GB or 32GB10-core

GPU cores change prompt speed, not generation speed. Prompt processing is compute-bound. Generation is bandwidth-bound, and the 8-core and 10-core M4 share 120 GB/s. The llama.cpp table has no 8-core M4 result, so we do not publish a number for it.

Apple sells none of these now. Apple’s MacBook Air and MacBook Pro spec pages list only M5-family chips (read 2026-10-26). The Mac mini page lists the M6 and M5 Pro. If you own an M4, use the table above. If you are buying, see the Mac mini guide and the MacBook guide for current models and prices.

What the Next Tier Unlocks

Within the M4 (if you are buying used):

  • 16GB → 24GB unlocks gpt-oss 20B with its full 128K window. Speed goes from about 13 to about 27 tok/s (both estimates), because the model changes from dense to MoE.
  • 24GB → 32GB unlocks Qwen3.6 35B-A3B at 4 bits with 131K measured context. Speed stays near 27 tok/s.
  • Above 32GB you need a Pro or Max chip. On 48GB, Qwen3.6 35B-A3B runs at Q8_0 (34.37 GiB). The base M4 tops out at 32GB.

Moving to a newer chip. Same test, Llama 7B Q4_0, from discussion #4167:

ChipBandwidthGenerationvs M4
M4120 GB/s24.11 tok/s1.00x
M5153 GB/s (Apple)31.88 tok/s1.32x
M6 (Mac mini)170 GB/s35.74 tok/s1.48x
M5 Pro307 GB/s66.33-67.59 tok/s2.75-2.80x

Apple lists the Mac mini M6 at 153 GB/s with 16GB and 170 GB/s with 24GB or 32GB.

Our upgrade rule. A 32GB M4 owner already runs the winner. A move to a base M5 or M6 buys 32-48% more speed and no new model. Skip it.

A 16GB M4 owner gains the most. A 24GB MacBook Pro with M5 Pro adds the RAM for gpt-oss 20B and about 2.8x the speed. Check the chip and RAM on any listing before you buy. For 48GB and more, see the M4 Pro and M4 Max pages.

FAQ

What local model do you recommend for a MacBook M4? On 32GB, Qwen3.6 35B-A3B at UD-Q4_K_M (20.61 GiB): 27.3-27.8 tok/s measured on a 32GB M4. On 24GB, gpt-oss 20B (11.28 GiB). On 16GB, Qwen3.5 9B at Q6_K (6.95 GiB).

What is the best local LLM for a MacBook Air M4? The same as any base M4. The Air, the 14” Pro and the mini all have 120 GB/s. Pick by RAM from the table above.

What is the best local LLM for a Mac mini M4 with 16GB? Qwen3.5 9B at Q6_K. It leaves room for about 127K tokens. gpt-oss 20B does not fit on the GPU by default.

Is a MacBook Pro M4 faster than a MacBook Air M4 for LLMs? Not for generation. Both have 120 GB/s. We have no measurement of sustained speed on either laptop, so we make no claim about long runs.

Should I upgrade from an M4 for local AI? Upgrade for RAM or for a Pro chip. The base M5 is only 1.32x the M4 in llama.cpp’s table. The M5 Pro is 2.75-2.8x.

Sources

See Also

Read next

Best Local LLM for 24GB VRAM (2026): Qwen3.8 27B Wins
Best local LLM for 24GB VRAM: Qwen3.8 27B at 4 bits (16.35 GiB) with about 96K of context. Byte-exact GGUF sizes, KV-cache math for gpt-oss 20B and Qwen3.6 35B-A3B, and October 2026 card prices.
Best Local LLM for 32GB VRAM (2026): Qwen3.8 27B Wins
Best local LLM for 32GB VRAM: Qwen3.8 27B at 6 bits (23.56 GiB) with 128K context. Byte-exact GGUF sizes, KV-cache math, and why the R9700 and Arc Pro B70 change the answer.
Best Qwen Model for 16GB VRAM (2026): Qwen3.8 27B Wins
Best Qwen model for 16GB VRAM: Qwen3.8-27B at 3.5 bits (10.96 GiB). The Q4_K_M 27B files do not fit. Byte-exact GGUF sizes, KV math, and the best Qwen for 8, 12, 24 and 32GB.
Best Local LLM for Mac mini (2026): Why 24GB Is the Floor
Best local LLM for the Mac mini in 2026, by memory tier. The M6 base has 16GB (about 12GB usable) and runs Qwen 3.5 9B Q8_0. The 32GB M6 and 64GB M5 Pro restore the ceilings Apple deleted in May 2026. The outgoing M4 is a value pick only under about $705.