Llama 4 · Llama-4 · HF: meta-llama/Llama-4-Maverick-17B-128E-Instruct
Llama 4 Maverick 400B-A17B — VRAM, KV Cache & Hardware Matrix
Serverless API Rate
$0.35 in / $1.00 out per 1M
Parameters
402B (17B act.)
Attention
GQA (8 KV / 40 Q)
Layers × Hidden
48 × 5120
Max Native Context
1024k tokens
MoE Experts
2 / 128
Quantization Memory Footprint
| Quantization | BPW | Weights Only | Total @ 8k Ctx | Total @ 32k Ctx | Quality |
|---|---|---|---|---|---|
| FP16 | 16.00 | 763.76 GiB | 766.51 GiB | 771.01 GiB | Lossless Reference |
| Q8_0 | 8.50 | 405.75 GiB | 408.50 GiB | 413.00 GiB | Near-Lossless |
| Q6_K | 6.57 | 313.62 GiB | 316.37 GiB | 320.87 GiB | High Precision |
| Q5_K_M | 5.69 | 271.61 GiB | 274.36 GiB | 278.86 GiB | Balanced High |
| Q4_K_M | 4.85 | 231.51 GiB | 234.27 GiB | 238.77 GiB | Recommended 4-bit |
| MLX_4BIT | 4.50 | 214.81 GiB | 217.56 GiB | 222.06 GiB | Apple Silicon Optimized |
| IQ4_XS | 4.25 | 202.87 GiB | 205.63 GiB | 210.13 GiB | Compact 4-bit |
| Q3_K_M | 3.91 | 186.64 GiB | 189.40 GiB | 193.90 GiB | Aggressive Compression |
Hardware Compatibility & Speed Leaderboard (Q4_K_M @ 32k Context)
Interactive Llama 4 Maverick 400B-A17B Simulator
402B (17B active) · GQA
819 GB/s · 58 TFLOPS
3. Weight Quantization
4.85 bpw
4. KV Cache
32,768 tok
Compute Roofline
COMFORTABLE FIT Memory-Bandwidth Bound
Max Safe Ctx: 889k (1024k tuned)
Memory Allocation Footprint 238.77 / 399.36 GiB usable
Weights: 231.51 GiB
KV Cache: 6.00 GiB
Overhead: 1.25 GiB
Headroom: 160.59 GiB
Decode Speed
33.2
tok/s (batch=1)
Prefill Speed
934
prompt tok/s
TTFT Latency
4.42s
for 4,096 tok
Active Params
17.0B
of 402B total
llama.cpp Server Command
llama-server -hf meta-llama/Llama-4-Maverick-17B-128E-Instruct:Q4_K_M -ngl 99 -fa on -c 32768 --port 8080 | Context | KV Cache | Total VRAM | Decode | Status |
|---|---|---|---|---|
| 4k | 0.75 GiB | 233.17 GiB | 49.7 tok/s | COMFORTABLE |
| 8k | 1.50 GiB | 234.27 GiB | 46.4 tok/s | COMFORTABLE |
| 16k | 3.00 GiB | 235.77 GiB | 40.9 tok/s | COMFORTABLE |
| 32k | 6.00 GiB | 238.77 GiB | 33.2 tok/s | COMFORTABLE |
| 64k | 12.00 GiB | 244.77 GiB | 24.0 tok/s | COMFORTABLE |
| 128k | 24.00 GiB | 256.77 GiB | 15.5 tok/s | COMFORTABLE |
Buy-vs-Cloud-vs-API Monthly TCO Break-Even
USE SERVERLESS APIOwn Hardware/mo
$179.28
140.5h active + power
Cloud GPU/mo
$563.99
@$3.49/hr spot/pod
Serverless API/mo
$32.50
Payback: 249.7 mo
Recommended Hardware & Cloud Deployment
Contextual to fit statusEngineering FAQ — Llama 4 Maverick 400B-A17B
How much VRAM does Llama 4 Maverick 400B-A17B require in Q4_K_M?
Llama 4 Maverick 400B-A17B weights occupy 231.51 GiB in Q4_K_M. Including 32k FP16 KV cache and runtime buffers, total memory is 238.77 GiB.
What is the cheapest local hardware that runs Llama 4 Maverick 400B-A17B?
Apple Mac Studio M3 Ultra (512 GB) (512 GB) runs Llama 4 Maverick 400B-A17B Q4_K_M at ~33.2 tok/s decode and 4.42s TTFT.
How does Llama 4 Maverick 400B-A17B scale KV cache at long context?
Llama 4 Maverick 400B-A17B uses GQA with 8 KV heads across 48 layers (128 head_dim).