Qwen3-Coder 30B-A3B VRAM requirements
Qwen3-Coder 30B-A3B has 30.5B parameters, of which about 3.3B are used per token; all 128 experts still have to be in memory. With an 8K-token context and one request it needs about 20.2 GB of GPU memory at Q4_K_M, 32.6 GB at FP8 and 63.9 GB at FP16/BF16. The published weights take 56.9 GB (BF16). The smallest setup here that holds it at Q4_K_M with an 8K context is the RTX 3090 (24 GB), which runs it with up to 39K tokens of context.
20.2 GB at Q4_K_M, 8K context, one request
- FP8
- 32.6 GB
- FP16 / BF16
- 63.9 GB
- Published weights
- 56.9 GB
- Smallest setup, Q4_K_M
- RTX 3090 (24 GB)
Worked example: Qwen3-Coder 30B-A3B with 32K tokens
Inputs: Qwen3-Coder 30B-A3B · Q4_K_M weights · 32,768 tokens of context · one request · FP16 KV cache
- Weights (30.5B at Q4_K_M)
- 17.2 GB
- KV cache (96 KB per token)
- 3.00 GB
- Buffers and runtime (0.5 GB + 10%)
- 2.52 GB
- Total
- 22.7 GB
The smallest setup here that holds it is the RTX 3090 (24 GB), with about 1.28 GB to spare. Change the inputs in the calculator
What makes Qwen3-Coder 30B-A3B's memory use different
Per token of context it adds 96 KB of FP16 cache; Granite 4.2 30B (29.3B), the nearest-sized model here with plain full attention, adds 256 KB, so Qwen3-Coder 30B-A3B needs 38% as much.
As a mixture-of-experts model it reads about 1.86 GB of its 17.2 GB Q4_K_M weights per generated token (11%), so it writes like a much smaller model while needing memory for all of them.
How much VRAM does Qwen3-Coder 30B-A3B need?
Qwen3-Coder 30B-A3B needs 20.2 GB at Q4_K_M, 34.6 GB at Q8_0 and 63.9 GB at FP16 with 8,192 tokens of context and one request. Each total below is the weights plus the FP16 KV cache and the runtime overhead (0.5 GB plus 10%), and each row opens the calculator with that setting. What the GGUF names mean.
| Precision | Weights | Total | Smallest setup |
|---|---|---|---|
| As published (BF16) | 56.9 GB | 63.9 GB | A100 80GB |
| FP16 / BF16 | 56.9 GB | 63.9 GB | A100 80GB |
| FP8 / INT8 | 28.4 GB | 32.6 GB | M4 Pro Mac (64 GB, 48 GB usable) |
| INT4 (AWQ / GPTQ) | 15.1 GB | 17.9 GB | RTX 3090 (24 GB) |
| GGUF Q8_0 | 30.2 GB | 34.6 GB | M4 Pro Mac (64 GB, 48 GB usable) |
| GGUF Q6_K | 23.3 GB | 27.0 GB | RTX 5090 (32 GB) |
| GGUF Q5_K_M | 20.2 GB | 23.5 GB | RTX 3090 (24 GB) |
| GGUF Q4_K_M | 17.2 GB | 20.2 GB | RTX 3090 (24 GB) |
| GGUF IQ4_XS | 15.5 GB | 18.3 GB | RTX 3090 (24 GB) |
| GGUF Q3_K_M | 13.9 GB | 16.6 GB | RTX 3090 (24 GB) |
| GGUF IQ3_XXS | 11.7 GB | 14.2 GB | RTX 4060 Ti 16GB |
| GGUF Q2_K | 11.9 GB | 14.4 GB | RTX 4060 Ti 16GB |
Fine-tuning Qwen3-Coder 30B-A3B? Qwen3-Coder 30B-A3B VRAM for LoRA, QLoRA and full training.
Qwen3-Coder 30B-A3B GGUF files on Hugging Face
The 8 GGUF files llama.cpp picks for Qwen3-Coder 30B-A3B with -hf <repo>:<QUANT>, with the bytes the Hugging Face file list reported on 2026-09-29. Each total is that file plus the FP16 KV cache and 0.5 GB + 10%, one request. "vs estimate" compares the file with the bits-per-weight size the table above uses.
| Quant | File | Size | vs estimate | 8K | 32K | 128K |
|---|---|---|---|---|---|---|
| Q2_K | unsloth/ | 10.5 GB11,258,612,896 bytes | −12% | 12.9 GB | 15.3 GB | 25.2 GB |
| Q3_K_M | unsloth/ | 13.7 GB14,711,850,144 bytes | −1% | 16.4 GB | 18.9 GB | 28.8 GB |
| IQ4_XS | unsloth/ | 15.3 GB16,378,076,320 bytes | −1% | 18.1 GB | 20.6 GB | 30.5 GB |
| Q4_K_M | unsloth/ | 17.3 GB18,556,689,568 bytes | ±0% | 20.3 GB | 22.8 GB | 32.7 GB |
| Q5_K_M | unsloth/ | 20.2 GB21,725,584,544 bytes | ±0% | 23.6 GB | 26.1 GB | 36.0 GB |
| Q6_K | unsloth/ | 23.4 GB25,092,535,456 bytes | ±0% | 27.0 GB | 29.5 GB | 39.4 GB |
| Q8_0 | ggml-org/ | 30.3 GB32,483,933,856 bytes | ±0% | 34.6 GB | 37.1 GB | 47.0 GB |
| BF16 | unsloth/ | 56.9 GB61,095,806,048 bytes | ±0% | 63.9 GB | 66.4 GB | 76.3 GB |
GB here is GiB (1024³ bytes), as everywhere on this site; Hugging Face shows the Q4_K_M file as 18.6 GB, in 10⁹ bytes.
Which Qwen3-Coder 30B-A3B GGUF fits a 16, 24, 32, 48 or 80 GB GPU or a Mac
From the file sizes above: the largest file that fits each machine with an 8K context and 0.5 GB left free, the longest context it then has room for, and the longest context for Q4_K_M (17.3 GB). One request, FP16 KV cache.
| Hardware | Largest GGUF, 8K | Its longest context | Q4_K_M, longest context |
|---|---|---|---|
| RTX 5060 Ti 16GB | Q2_K, 10.5 GB | 33K | No |
| RTX 4090 (24 GB) | Q4_K_M, 17.3 GB | 38K | 38K |
| RTX 5090 (32 GB) | Q6_K, 23.4 GB | 51K | 116K |
| L40S (48 GB) | Q8_0, 30.3 GB | 132K | 256K (full) |
| H100 SXM (80 GB) | BF16, 56.9 GB | 158K | 256K (full) |
| M4 Pro Mac (64 GB, 48 GB usable) | Q8_0, 30.3 GB | 132K | 256K (full) |
| M4 Max Mac (128 GB, 96 GB usable) | BF16, 56.9 GB | 256K (full) | 256K (full) |
Run Qwen3-Coder 30B-A3B with llama.cpp or Ollama
llama-server -hf unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M -c 38912 Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf, 18.6 GB, from unsloth/
ollama run qwen3-coder:30b
Ollama library tag qwen3-coder:30b; its quant is Ollama's choice. Same context: /set parameter num_ctx 38912.
Qwen3-Coder 30B-A3B at 8K, 32K, 128K and 256K (full) tokens of context
All 48 layers use full attention. Each extra token of context adds 96 KB of FP16 cache per request. The last column is the smallest setup here, one card or a group, that holds it at Q4_K_M. How the KV cache works.
| Context | KV cache, FP16 | Total at Q4_K_M | Total at Q8_0 | Smallest setup, Q4_K_M |
|---|---|---|---|---|
| 8K tokens | 768 MB | 20.2 GB | 34.6 GB | RTX 3090 (24 GB) |
| 32K tokens | 3.00 GB | 22.7 GB | 37.0 GB | RTX 3090 (24 GB) |
| 128K tokens | 12.0 GB | 32.6 GB | 46.9 GB | M4 Pro Mac (64 GB, 48 GB usable) |
| 256K tokens | 24.0 GB | 45.8 GB | 60.1 GB | M4 Pro Mac (64 GB, 48 GB usable) |
How fast Qwen3-Coder 30B-A3B writes
Tokens per second for one request with 8,192 tokens of context, estimated from memory bandwidth and the parameters read per token. A dash means it does not fit on one card. Try other settings in the speed calculator.
| Hardware | Bandwidth | Q4_K_M | FP8 |
|---|---|---|---|
| RTX 3060 12GB | 360 GB/s | — | — |
| RTX 4090 | 1,008 GB/s | 93–165 | — |
| RTX 5090 | 1,792 GB/s | 149–276 | — |
| M4 Max Mac (128 GB) | 546 GB/s | 54–93 | 38–64 |
| M3 Ultra Mac Studio (512 GB) | 819 GB/s | 77–136 | 55–95 |
| H100 SXM | 3,350 GB/s | 233–460 | 179–339 |
| H200 | 4,800 GB/s | 290–600 | 230–452 |
Longest context on one GPU
How many tokens of context Qwen3-Coder 30B-A3B fits on a single card with one request, an FP16 KV cache and 0.5 GB left free. "Full" means the model's whole context window fits.
| GPU | Memory | Q4_K_M | Q8_0 | FP8 |
|---|---|---|---|---|
| RTX 3060 | 12 GB | No | No | No |
| RTX 4060 Ti 16GB | 16 GB | No | No | No |
| RTX 3090 / 4090 | 24 GB | 39K | No | No |
| RTX 5090 | 32 GB | 117K | No | No |
| A100 40GB | 40 GB | 194K | 55K | 74K |
| Mac, 64 GB unified memory | 48 GB | 256K (full) | 133K | 152K |
| L40S / RTX 6000 Ada | 48 GB | 256K (full) | 133K | 152K |
| A100 / H100 80GB | 80 GB | 256K (full) | 256K (full) | 256K (full) |
| Mac, 128 GB unified memory | 96 GB | 256K (full) | 256K (full) | 256K (full) |
| H200 | 141 GB | 256K (full) | 256K (full) | 256K (full) |
| B200 | 180 GB | 256K (full) | 256K (full) | 256K (full) |
Model details
- Parameters
- 30.5B (30,532,122,624)
- Experts
- 128 routed experts, all loaded
- Active per token
- 3.3B
- Layers
- All 48 layers use full attention
- Attention cache
- 4 KV heads × 128
- Context length
- 262,144 tokens
- Published weights
- 56.9 GB (BF16)
- On Hugging Face
- Qwen/
Qwen3-Coder-30B-A3B-Instruct
Why this estimate looks this way
At Q4_K_M and an 8K-token context, Qwen3-Coder 30B-A3B uses 17.2 GB for weights, 768 MB for its FP16 KV cache and 2.30 GB for estimated runtime overhead, totaling 20.2 GB. The overhead is a 0.5 GB base plus 10% of weights and cache.
This is a mixture-of-experts model: all 128 experts contribute to the 30.5B parameters held in memory, even though only about 3.3B parameters run per token. Using only active parameters would understate VRAM.
The architecture and published checkpoint size come from the model's config.json and weight files. These are estimates rather than measured peak memory; inference engines can reserve extra buffers or preallocate the full configured cache.
Qwen3-Coder 30B-A3B next to similar-sized models
The three models here closest to it in parameter count, at Q4_K_M with 8,192 tokens of context.
| Model | Parameters | Total | KV per token | Smallest setup |
|---|---|---|---|---|
| Qwen3-Coder 30B-A3B | 30.5B, 3.3B active | 20.2 GB | 96 KB | RTX 3090 (24 GB) |
| Qwen3 30B-A3B | 30.5B, 3.3B active | 20.2 GB | 96 KB | RTX 3090 (24 GB) |
| Xing 4.0 29B-A4B | 31.2B, 4B active | 20.2 GB | 45 KB | RTX 3090 (24 GB) |
| GLM-4.7 Flash | 31.2B, 3B active | 20.3 GB | 53 KB | RTX 3090 (24 GB) |
Qwen3-Coder 30B-A3B VRAM questions
How much VRAM do I need to run Qwen3-Coder 30B-A3B locally?
About 20.2 GB at Q4_K_M with an 8K context and one request, by the bits-per-weight estimate, and 63.9 GB at BF16. The Q4_K_M GGUF Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf in unsloth/
Can I run Qwen3-Coder 30B-A3B on a 24 GB GPU?
Yes. On the RTX 4090 (24 GB), the largest listed GGUF that fits with an 8K context and 0.5 GB free is Q4_K_M (17.3 GB), with up to 38K tokens of context.
Which quantization of Qwen3-Coder 30B-A3B fits in 16 GB of VRAM?
On the RTX 5060 Ti 16GB, the largest listed GGUF that fits with an 8K context and 0.5 GB free is Q2_K (10.5 GB), with up to 33K tokens of context.
Can I run Qwen3-Coder 30B-A3B on a Mac?
On the M4 Pro Mac (64 GB, 48 GB usable), the largest listed GGUF that fits with an 8K context and 0.5 GB free is Q8_0 (30.3 GB), with up to 132K tokens of context. Q4_K_M (17.3 GB) runs with its full 256K-token context. On the M4 Max Mac (128 GB, 96 GB usable), the largest listed GGUF that fits with an 8K context and 0.5 GB free is BF16 (56.9 GB), with its full 256K-token context. By default macOS lets the GPU use about 75% of unified memory.
How much more VRAM does Qwen3-Coder 30B-A3B need for 32K or 128K tokens of context?
Its FP16 KV cache is 768 MB at 8K, 3.00 GB at 32K, 12.0 GB at 128K for one request, so 128K adds 11.3 GB over 8K, plus 10% overhead. A q8_0 cache
Why does Qwen3-Coder 30B-A3B use more VRAM than its GGUF file size?
The file holds only the weights. At Q4_K_M with an 8K context: 17.3 GB of weights (the file's 18,556,689,568 bytes) + 768 MB of FP16 KV cache + 2.30 GB of compute buffers and runtime (0.5 GB + 10%) = 20.3 GB.
Does Qwen3-Coder 30B-A3B need less VRAM because only 3.3B parameters are active?
No. All 128 experts stay loaded, so the Q4_K_M file takes 17.3 GB. The active parameters decide speed: each generated token reads about 1.86 GB of them.
Badge for your model card
Paste it into a Hugging Face or GitHub README; it shows the Q4_K_M total above and links to this page. Q8_0 and FP16 badges.
Numbers read from the model files on Hugging Face on . Compare it with other models in the reproducible model and GPU report.