← All guides

Best Local LLM for 36GB RAM (2026): Qwen3.8 27B on MLX

On a 36GB Mac, run Qwen3.8 27B in MLX 4-bit. The 14.95 GiB model leaves room for about 181K tokens of context inside the 27.00 GiB that macOS gives the GPU. Run it in MLX, not in llama.cpp: on a 36GB M4 Max, one tester measured about 35 tok/s in MLX and 6.5-8.8 tok/s with the same model in llama.cpp. For speed, Qwen3.6 35B-A3B holds its full 262K window and runs at 40-52 tok/s.

Bottom Line

  • Best local LLM for 36GB RAM: Qwen3.8 27B in MLX 4-bit. The mlx-community/Qwen3.8-27B-4bit weights are 14.95 GiB. About 181K tokens of f16 context fit next to them.
  • The runtime matters more than the quant on this tier. On a 36GB M4 Max, one tester measured the dense 27B at 6.5-8.8 tok/s in llama.cpp and about 35 tok/s in MLX (llama.cpp #27525, community-reported).
  • Speed pick: Qwen3.6 35B-A3B. The 20.61 GiB UD-Q4_K_M file holds the full 262K window. A 36GB M4 Max ran a Q4_K_M build of it at 40-52 tok/s in llama.cpp (same issue).
  • The GPU gets 27.00 GiB, not 36. macOS keeps 25% by default. Every “fits” verdict below uses 27.00 GiB minus 1 GiB of buffers.
  • 8-bit 27B does not fit. Q8_0 is 27.05 GiB and MLX 8-bit is 27.48 GiB. Both are over the limit before context.
  • Every 36GB Mac is a Max chip or an M3 Pro. Today Apple sells 36GB only on the M5 Max with the 32-core GPU: $2,499 in the Mac Studio, $4,099 in the 14-inch MacBook Pro (apple.com, as of October 2026).

Still choosing a machine? See the tested hardware list, or compare every Mac tier in best Mac for local LLM.

Which Macs Have 36GB

36GB is an Apple-only size. It exists on four chips. Bandwidth decides the speed of every model on this page, and it differs by 3x across them.

ChipGPU coresMemory bandwidthWhere it shipsApple sells it now?
M5 Max32460 GB/sMac Studio, MacBook Pro 14/16Yes
M4 Max32410 GB/sMacBook Pro 14/16 (2024)No
M3 Max30300 GB/sMacBook Pro 14/16 (Nov 2023)No
M3 Pro18150 GB/sMacBook Pro 14/16 (Nov 2023)No

Sources: apple.com/mac-studio/specs and apple.com/macbook-pro/specs for the M5 Max; Apple Support tech specs for the M4 Max and M3 Pro / M3 Max MacBook Pros.

The M3 Pro is the outlier. It has the same 36GB as an M5 Max at one third of the bandwidth. The model picks below are the same on it, but expect about one third of the speed.

How Much of 36GB the GPU Can Use

macOS reports a “recommended max working set” to Metal. llama.cpp prints it at startup.

  • Logged value on a 36GB Mac: recommendedMaxWorkingSetSize = 28991.03 MB, on an M3 Pro (llama.cpp #13865).
  • Convert it correctly. llama.cpp divides bytes by 106 and calls the result “MB”. So 28,991.03 “MB” is 27.00 GiB, which is 75.0% of 36 GiB.
  • Our budget: 27.00 GiB minus 1 GiB for compute buffers (our assumption) leaves 26.00 GiB for weights plus KV cache.

The full table for 16GB to 128GB Macs is on best local LLM for MacBook. A 32GB Mac gets 24.96 GiB (78%). So 36GB adds only 2.04 GiB of GPU memory over 32GB, not 4.

What Fits in 36GB

File sizes are byte counts from the Hugging Face API, read 2026-10-28. GiB = 230 bytes. KV cache per token comes from each model’s config.json: Qwen3.8 27B has 16 full-attention layers × 4 KV heads × 256 head dim, so 64 KiB per token at f16. Qwen3.6 35B-A3B has 10 × 2 × 256, so 20 KiB per token. Context = (26.00 GiB − file) ÷ cache per token. This is our arithmetic.

ModelFileSize (GiB)Context that fits (f16 cache)Speed on a 36GB Max chip
Qwen3.8 27B (dense)MLX 4-bit (mlx-community)14.95About 181KAbout 35 tok/s, M4 Max, MLX (omlx) — community-reported
Qwen3.8 27BQ4_1 GGUF (Unsloth)16.34About 158KNot measured on 36GB; 13.53 tok/s on an M1 Max (400 GB/s)
Qwen3.8 27BUD-Q4_K_XL GGUF (Unsloth)16.35About 158K7.0-7.1 tok/s, M4 Max, llama.cpp (8.5-8.8 with MTP)
Qwen3.8 27BUD-Q6_K GGUF (Unsloth)20.47About 90K6.5 tok/s for a Q6_K file, M4 Max, llama.cpp
Qwen3.8 27BQ8_0 GGUF / MLX 8-bit27.05 / 27.48Does not fit—
Qwen3.6 35B-A3B (MoE)UD-Q4_K_M GGUF (Unsloth)20.61Full 262K40-52 tok/s, M4 Max, a Q4_K_M build, llama.cpp
Qwen3.6 35B-A3BUD-Q5_K_XL GGUF (Unsloth)24.77About 64KNot measured
Qwen3.6 35B-A3BUD-Q6_K GGUF (Unsloth)27.30Does not fit—
gpt-oss 20B (MoE)MXFP4 (ggml-org)11.28Full 128K92.36 tok/s, M4 Max 36GB (#15396)
gpt-oss 120B (MoE)MXFP4 (ggml-org)59.03Does not fit—

Speed sources: the M4 Max rows are from llama.cpp #27525 (short prompts, server-reported decode). The M1 Max Q4_1 row is from a reply in the same issue. All are community-reported, on one machine each. Qwen3.8 27B also has a linear-attention state that does not grow with context; we leave it out of the context math.

Why the Runtime Decides the Winner

The finding. In issue #27525, the tester ran Qwen3.8 27B on a 36GB M4 Max (410 GB/s) for two weeks. llama.cpp’s Metal backend gave 6.5-8.8 tok/s on every config: Q4, Q5 and Q6 files, flash attention on and off, 12 threads, mlock, two builds. The MLX server omlx gave about 35 tok/s on the same machine. The MoE model was not affected: 40-52 tok/s.

What it means in bandwidth. 7 tok/s × 17 GB read per token is about 120 GB/s. That is 29% of the chip’s 410 GB/s. MLX reached about 68%, by the tester’s figures.

The partial fix in llama.cpp. A second tester replied that the XL quant layout is the problem on Metal. On an M1 Max (400 GB/s), standard files ran at 14.29 tok/s (IQ4_NL) and 13.53 tok/s (Q4_1) — about 2x the XL files. That is still well below MLX.

So pick the model by runtime:

You useRun this on 36GBWhy
MLX (LM Studio MLX engine, mlx-lm, omlx)Qwen3.8 27B 4-bitThe strongest model that fits, at about 35 tok/s
llama.cpp, Ollama, LM Studio GGUFQwen3.6 35B-A3B UD-Q4_K_MThe MoE path is fast on Metal; the dense path is not
Either, and you want maximum speedgpt-oss 20B MXFP492 tok/s and the full 128K window

These numbers come from one machine per tester. They can change with a new llama.cpp release. Measure your own: run llama-bench -m <file> -p 512 -n 128 and compare it with mlx_lm.generate --model mlx-community/Qwen3.8-27B-4bit --max-tokens 128 on the same prompt. For runtime setup, see Ollama vs LM Studio vs llama.cpp vs oMLX.

Speed on the M5 Max 36GB (an Estimate)

No one has published a Qwen3.8 27B measurement on the 32-core M5 Max that we could find. Generation speed scales roughly with memory bandwidth. So the M4 Max MLX figure gives about 35 × 460 ÷ 410 ≈ 39 tok/s on the M5 Max. The MoE gives about 45-58 tok/s by the same ratio. These are our estimates, not measurements. On an M3 Max (300 GB/s), expect about 26 tok/s for the 27B in MLX; on an M3 Pro (150 GB/s), about 13.

Can You Raise the Limit for 8-bit?

You can give the GPU more memory:

sudo sysctl iogpu.wired_limit_mb=N

N is in MiB. It does not rescue 8-bit on this tier. Our rule is to leave at least 8 GiB for macOS on a machine you also work on. That gives N = 28672 (28 GiB), only 1 GiB over the default. Q8_0 at 27.05 GiB plus 1 GiB of buffers already needs 28.05 GiB, so no context fits. The tester in #27525 set N = 36000, which leaves macOS under 1 GiB. We do not recommend that. If you want 8-bit 27B or 35B, buy 48GB. See best local LLM for 48GB.

36GB or 48GB: What $600 Buys

Apple list prices, read on apple.com on 2026-10-27, as of October 2026:

Machine36GB (M5 Max, 32-core GPU, 460 GB/s)48GB (M5 Max, 40-core GPU, 614 GB/s)Difference
Mac Studio$2,499 (512GB SSD)$3,099 (512GB SSD)+$600
MacBook Pro 14-inch$4,099 (2TB SSD)$4,699 (2TB SSD)+$600

The step buys two things. It adds 10.44 GiB of GPU memory (37.44 GiB default, logged on a 48GB Mac) and 33% more bandwidth. The extra memory runs Qwen3.6 35B-A3B at Q8_0 (34.37 GiB) and Qwen3.8 27B at Q8_0 with long context.

Buy 36GB if you run 4-bit models and want the cheapest Max-chip bandwidth. The $2,499 Mac Studio is the cheapest way Apple sells 460 GB/s. Buy 48GB if you want 8-bit quality on the 27B or 35B class. Neither tier runs gpt-oss 120B; that needs 128GB. Compare the full lineup in which Mac Studio to buy.

See Also

Sources

Read next

Best Local LLM for 32GB RAM (2026): Chat and Coding Picks
Best local LLM for 32GB RAM: Qwen3.8 27B at UD-Q6_K (20.47 GiB). gpt-oss 20B is 11.28 GiB, not 22GB. What fits under the ~24 GiB Mac GPU limit, Ollama commands, what to skip.
Best Local LLM for 48GB VRAM or RAM (2026): Qwen 3.6 27B Q8
Best local LLMs for 48GB RAM in 2026. Qwen 3.6 27B at Q8 (near-FP16), Laguna XS 2.1 (agentic coding, ~36GB Q8), Qwen 3.6 35B-A3B MoE, gpt-oss 20B Q8, Gemma 4 26B-A4B (~15GB). M3 Max 48GB territory.
Best Local LLM for 64GB RAM (2026): Qwen3.8 27B at Q8
Best local LLM for 64GB RAM: Qwen3.8 27B at Q8_0 (27.05 GiB). A 64GB Mac gives the GPU 51.84 GiB, so gpt-oss 120B (59.03 GiB) and Llama 4 Scout Q4 do not fit by default. Also Qwen3.6 35B-A3B Q8_0, Gemma 4 31B, Laguna XS 2.1.
Best Local LLMs for 24GB RAM (2026): Qwen 3.6 27B Headlines
Best local LLMs for 24GB RAM in 2026. Qwen 3.6 27B (released Apr 22) is the new headline pick — outperforms 397B MoE models on agentic coding. Plus gpt-oss 20B, Qwen 3.5 9B at Q8.