Qwen4-35B-A3B is a 35-billion-parameter model, and its standard 4-bit download is 36 GB. So can it really run on a 16 GB graphics card? Yes, and surprisingly well, because only about 3B parameters are active per token and llama.cpp can park the rest in system RAM.
This guide gives you the exact llama.cpp commands for 16 GB and 24 GB GPUs and for 16 to 32 GB Macs, which quant to download for each, how to get long context cheaply, and the real speeds people have measured since the model came out on 4 December 2026.
The numbers come from Unsloth’s published figures, ComputingForGeeks’ RTX 4090 tests, a user-reported RTX 3070 Ti run, and a Mac mini M4 16 GB test, all dated 4 and 5 December 2026. Where sources disagree, I say so.
- 16 GB GPU: Unsloth UD-IQ4_XS or Q4_K_M with
-ngl 99 --n-cpu-moe 20and--moe-cache-mib 2048. Expect roughly 30 to 60+ tokens/s. - 24 GB GPU: Q4_K_M fully on GPU at 32k context: about 158 tokens/s on an RTX 4090, 178 with MTP.
- Keep the n-gram table on disk with
--lazy-mode on. It saves over 13 GB of RAM. - Long context is cheap: only 10 of 40 layers keep a KV cache. 262k tokens at f16 is about 5 GB.
- 16 GB Mac: only the 1-bit UD-IQ1_S build fits; it ran at about 34 tokens/s on an M4.
- Use llama.cpp from 3 December 2026 or newer.
For specs, benchmarks and API prices, see my Qwen4-35B-A3B guide.
Why a 35B Model Fits a 16 GB Card
Three design choices make Qwen4-35B-A3B unusually friendly to small GPUs.
1. Mixture of experts. Each layer has 256 small experts, and only 8 routed experts plus 1 shared expert run for each token. The attention and shared parts are small and stay on the GPU. The large expert weights can sit in system RAM, and llama.cpp streams in the ones it needs.
2. A sparse n-gram table. About 20B of the model’s total parameters are an n-gram embedding table that is read with just 16 row lookups per token. It doesn’t need to be in VRAM at all.
With lazy loading it can even stay on your SSD. That’s why the 36 GB Q4_K_M file needs only about 22 GB of memory to run.
3. Hybrid attention. The 40 layers are 10 blocks of three Gated DeltaNet (linear attention) layers and one full attention layer. DeltaNet layers keep a fixed-size state, so only 10 layers have a KV cache that grows with context.
The trade-off: experts that live in RAM must cross the PCIe bus, so a 16 GB card is slower than a 24 GB card. But it’s very usable, as the numbers below show.
Which Quant to Download
Disk size vs memory used when the n-gram table stays on disk (Unsloth figures, 4 December):
| Quant | Download | Memory used | Best for |
|---|---|---|---|
| UD-IQ1_S | 21.3 GB | 9.8 GB | 16 GB Macs, last resort |
| UD-IQ2_XS | 24.5 GB | 13.0 GB | 12 GB GPUs |
| UD-IQ3_XXS | 28.7 GB | 17.2 GB | 16 GB GPUs, more headroom |
| UD-IQ4_XS | 32.0 GB | 20.5 GB | 16 GB GPUs (with offload) and 24 GB GPUs or Macs |
| UD-Q4_K_XL | 36.2 GB | 24.7 GB | 24 GB GPUs with a little offload, 32 GB Macs |
| UD-Q6_K_XL | 52.2 GB | 30.5 GB | 32 GB GPUs, 48 GB Macs |
| UD-Q8_K_XL | 62.3 GB | 40.5 GB | 48 GB GPUs, 64 GB Macs |
The ggml-org Q4_K_M file is 36.0 GB on disk and 21.9 GB in memory. Unsloth says 16 GB cards should use 2 to 3 bit builds, but two separate tests ran 4-bit builds on 16 GB cards with expert offload, so 4-bit is worth trying first.
New to quant names? My GGUF quantization guide explains them.
Get a Supported llama.cpp Build
Qwen4 support was merged on 3 December 2026 (build b12969). Older builds, including some package-manager versions, fail with:
unknown pre-tokenizer type: 'qwen4'
Download the newest release from the llama.cpp GitHub releases page (numbered bNNNNN tags), or build from source. On Mac, one tester found Homebrew’s version too old and had to build from source. Full steps are in my llama.cpp install guide.
16 GB GPU Setup
This is the setup for an RTX 4060 Ti 16 GB, 4070 Ti Super, 4080, 5060 Ti 16 GB, 5070 Ti, 5080 or RX 7800 XT / 9070 XT. You’ll also want at least 32 GB of system RAM.
Starting command (UD-IQ4_XS):
llama-server -hf unsloth/Qwen4-35B-A3B-GGUF:UD-IQ4_XS -ngl 99 --n-cpu-moe 20 --moe-cache-mib 2048 --lazy-mode on -ot per_layer_token_embd=CPU -c 32768 --temp 1.0 --top-p 0.95 --top-k 20 --port 8080
What each flag does:
-ngl 99puts every layer on the GPU first.--n-cpu-moe 20then moves the expert weights of 20 layers to system RAM. Raise it if you run out of VRAM, lower it if you have spare.--moe-cache-mib 2048keeps a 2 GB cache of the most-used experts in VRAM. This is the biggest speed lever.--lazy-mode onand-ot per_layer_token_embd=CPUkeep the n-gram table out of VRAM and read it from disk as needed.
Measured results on 16 GB:
| Setup | VRAM used | Decode speed | Source |
|---|---|---|---|
Q4_K_M, --n-cpu-moe 20, 32k context, no expert cache (simulated 16 GB on a 4090) |
12.7 GB | 32 to 34 tokens/s | ComputingForGeeks |
| Same, plus a 6 GB expert cache | 18.9 GB | 143 tokens/s (best case, repeated prompt) | ComputingForGeeks |
RTX 3070 Ti 16 GB eGPU, UD-IQ4_XS, 128k context, q8_0 KV, --n-cpu-moe 40 --moe-cache-mib 8192 |
13.0 GB | about 63 tokens/s | User report (GitHub) |
| Same card, UD-Q4_K_M | 13.4 GB | about 48 tokens/s | User report (GitHub) |
| Unsloth’s 16 GB figure, with vs without expert cache | 16 GB | 127 vs 70 tokens/s | Unsloth |
Real speed depends on your PCIe link, RAM speed and how varied your prompts are. A realistic target on a desktop 16 GB card is 40 to 80 tokens/s, which is faster than most people can read and fine for coding agents.
Tuning order: get it running with a small cache, then raise --moe-cache-mib in 1024 steps until VRAM is nearly full, then lower --n-cpu-moe a few at a time. For more on how this works, see my llama.cpp MoE offload guide.
24 GB GPU Setup
For an RTX 3090, 4090, 5090 (32 GB) or RX 7900 XTX, Q4_K_M fits fully on the GPU at a normal context size.
llama-server -hf ggml-org/Qwen4-35B-A3B-GGUF:Q4_K_M -ngl 99 --lazy-mode on -c 32768 --spec-type draft-mtp --spec-draft-n-max 1 --port 8080
ComputingForGeeks on one RTX 4090:
- 21.9 GB VRAM at 32k context, 1.3 GiB system RAM with lazy mode on (14.7 GiB with it off, same speed).
- 157.9 tokens/s without MTP, 177.7 tokens/s with one MTP draft token (22.8 GB VRAM).
- Q6_K (51 GB) also runs by moving 11 layers of experts to RAM: 40 to 42 tokens/s, or about 50 with a 2 GB expert cache.
Unsloth recommends UD-IQ4_XS on 24 GB cards to leave room for more context, and reports 131 to 138 tokens/s with the expert cache. On an RTX 5090, Unsloth measured 175 tokens/s with UD-Q4_K_XL, or 224 with MTP.
Heads up: ComputingForGeeks found the ggml-org repo was renamed to -old during launch week and the name reused for a new conversion. If the Q4_K_M file is missing, use the Unsloth repo instead.
What About 12 GB Cards?
No one has published a measured 12 GB result yet.
Based on the 16 GB numbers, a 12 GB card such as an RTX 3060 12 GB or 4070 should run UD-IQ2_XS or UD-IQ3_XXS with a higher --n-cpu-moe value (try 30 to 40) and a smaller expert cache.
Expect lower speeds than 16 GB, and add 32 GB or more of system RAM. I’ll update this section when tested numbers appear.
Macs with 16, 24 and 32 GB
On Apple Silicon, the GPU can use about two thirds to three quarters of unified memory by default.
- 16 GB Mac: a Mac mini M4 16 GB tester could only fit UD-IQ1_S (21.3 GB file). llama.cpp put about 8.5 GB on Metal and memory-mapped the rest. Results: 256 tokens/s prompt reading and 33.9 tokens/s generation, with coherent output and one factual slip. Usable for chat, too tight for agents.
- 24 GB Mac: Unsloth suggests starting with UD-IQ4_XS.
- 32 GB Mac: Q4_K_M runs, per ggml-org’s model card. Q6_K needs 48 GB and Q8_0 needs 64 GB.
MLX is another option on Mac. Unsloth’s mixed-precision MLX 4-bit build (34 GB, text only) ran at 69 tokens/s on a 128 GB M5 Max. Unsloth warns that a plain mlx_lm.convert 4-bit conversion loses a lot of quality, so use a prepared build. My MLX vs GGUF guide helps you choose.
Long Context Without Running Out of Memory
Because only 10 layers keep a KV cache (with 2 KV heads of size 256), the cache grows at about 20 KB per token at f16. ComputingForGeeks measured:
| Context | KV type | KV memory |
|---|---|---|
| 262,144 tokens | f16 | 5,120 MiB |
| 262,144 tokens | q8_0 | 2,720 MiB |
So on a 24 GB card you can run 256k context with:
-c 262144 -ctk q8_0 -ctv q8_0
Some experts move to RAM to make room, and decode speed was 48 to 49 tokens/s in that test, still very usable for long documents or big codebases. On 16 GB, the GitHub user ran 128k context with q8_0 KV at 48 to 63 tokens/s.
Speed Up with MTP Speculative Decoding
Qwen4 ships with a small multi-token prediction head (about 2B parameters) that drafts the next tokens for the main model to check. Turn it on with:
--spec-type draft-mtp --spec-draft-n-max 1
- ComputingForGeeks on a 4090: no MTP 157.9, depth 1 at 177.7, depth 2 at 169.5, depth 3 at 166.9 tokens/s.
- Unsloth recommends depth 2 (acceptance rate 0.68).
Test 1 and 2 on your own card. If the ggml-org file has no MTP layers built in, llama.cpp says “context type MTP requested but model doesn’t contain MTP layers”; pass the separate MTP file with -md. Background in my llama.cpp speculative decoding guide.
Ollama and LM Studio Notes
Ollama (0.40.21 or newer) has qwen4 at about 36 GB. On a 24 GB card it worked well once tuned, but with shipped defaults (32k context and 4 draft tokens) it split 39% CPU and 61% GPU and dropped to about 21 tokens/s. The fix was a smaller context and fewer draft tokens:
"options": {"draft_num_predict": 2, "num_ctx": 8192}
That brought it to 170 to 177 tokens/s on 100% GPU. Ollama doesn’t expose --n-cpu-moe or the expert cache, so on 16 GB cards llama.cpp is clearly the better tool. See my Qwen4 coding agent guide for the Ollama agent setup.
LM Studio had no official Qwen4 build as of 5 December. It will likely follow once its bundled llama.cpp runtime updates.
Common Problems and Fixes
| Problem | Cause | Fix |
|---|---|---|
| “unknown pre-tokenizer type: ‘qwen4′” | llama.cpp older than 3 Dec | Update to b12969 or newer |
| Out of VRAM at load | Too few experts on CPU | Raise --n-cpu-moe by 4 to 8 |
| Very slow (under 15 tokens/s) | No expert cache, or slow PCIe/RAM | Add --moe-cache-mib 2048 or more |
| System RAM fills up | N-gram table loaded into RAM | Use --lazy-mode on |
| MTP error about missing layers | MTP head in a separate file | Pass it with -md, or use an Unsloth build |
| Q4_K_M file missing from ggml-org | Repo renamed during launch | Use unsloth/Qwen4-35B-A3B-GGUF |
| Repeats or loops | Very low-bit quant | Add min_p 0.01 and presence penalty 1.5, or use a bigger quant |
FAQ
Can Qwen4-35B-A3B run on a 16 GB GPU?
Yes. Use llama.cpp with --n-cpu-moe and --moe-cache-mib. Tests show about 30 to 63 tokens/s on 16 GB, depending on settings.
How much VRAM does Qwen4-35B-A3B need with no offload?
About 22 GB for Q4_K_M at 32k context, so a 24 GB card.
How much system RAM do I need?
32 GB is a sensible minimum for a 16 GB GPU with offload. With lazy mode, the n-gram table stays on disk instead of in RAM.
Which quant is best for 16 GB?
Start with UD-IQ4_XS. If it’s too tight, drop to UD-IQ3_XXS.
Can I use 1M context at home?
256k is realistic on 24 GB with q8_0 KV. The full 1M needs much more memory.
Does it run on a 16 GB MacBook?
Only the 1-bit UD-IQ1_S build fits, at about 34 tokens/s on an M4. A 32 GB Mac is a much better fit.
Is Ollama or llama.cpp better on 16 GB?
llama.cpp, because it lets you offload experts and set an expert cache.
Sources
- ComputingForGeeks: Run Qwen4-35B-A3B Locally (RTX 4090 tests, 16 GB simulation, KV sizes, MTP depth)
- Qwen4 35B-A3B runs locally on 24 GB (Unsloth figures)
- AgentsPulse: Qwen4 35B A3B architecture and GGUF guide
- GitHub issue with RTX 3070 Ti 16 GB llama.cpp numbers (user-reported)
- Hack-Log: Qwen4-35B-A3B on a 16 GB M4
- AtomicChat/Qwen4-35B-A3B-GGUF (file sizes)



