GPU VRAM calculator · Llama

How much VRAM does Llama 3.1 405B need?

Llama 3.1 405B has 405 billion parameters. The weights alone take about 754.4 GB in FP16/BF16, 377.2 GB in FP8 and 228.7 GB at 4-bit. KV cache comes on top: about 3.9 GB per sequence at an 8K context in FP16.

At Q4_K_M / 4-bit with an 8K context it does not fit on one GPU: 4× A100 80GB / 4× H100 / 2× H200 / 2× B200.

At FP16 / BF16 with an 8K context it does not fit on one GPU: 7× H200 / 5× B200.

VRAM for inference (8K context, 1 sequence)

PrecisionWeightsTotalSmallest GPU
FP16 / BF16754.4 GB797 GB7× H200 / 5× B200
FP8 / INT8377.2 GB401 GB6× A100 80GB / 6× H100 / 4× H200 / 3× B200
Q6_K309.3 GB329.7 GB5× A100 80GB / 5× H100 / 3× H200 / 3× B200
Q4_K_M / 4-bit228.7 GB245 GB4× A100 80GB / 4× H100 / 2× H200 / 2× B200

Which GPU on CloudGPU fits Llama 3.1 405B

GPUVRAMFP16 / BF16FP8 / INT8Q6_KQ4_K_M / 4-bit
RTX 309024 GBToo smallToo smallToo smallToo small
RTX 409024 GBToo smallToo smallToo smallToo small
RTX 509032 GBToo smallToo smallToo smallToo small
RTX 4090 48GB48 GBToo smallToo smallToo smallToo small
L40S48 GBToo smallToo smallToo smallToo small
A100 80GB80 GBToo smallToo smallToo smallToo small
H10080 GBToo smallToo smallToo smallToo small
H200141 GBToo smallToo smallToo smallToo small
B200180 GBToo smallToo smallToo smallToo small

8K context, 1 sequence. Each card links to its rental page. Current prices are on the pricing page; availability is shown on the deploy page.

KV cache by context length (per sequence)

ContextKV cache (FP16)KV cache (FP8)
4K2 GB1 GB
32K15.8 GB7.9 GB
128K63 GB31.5 GB

Multiply by the number of concurrent sequences. Maximum context in the model config: 131,072 tokens. Models with sliding-window attention use less than this upper bound.

VRAM for fine-tuning (2K-token sequences, batch 1)

WorkloadTotalSmallest GPU
QLoRA fine-tune279.8 GB4× A100 80GB / 4× H100 / 3× H200 / 2× B200
LoRA fine-tune909.2 GB8× H200 / 6× B200
Full fine-tune6791.3 GB—

How the estimate works

Weights = parameters × bits per parameter ÷ 8. KV cache = per-token KV size from the model config × context × concurrent sequences (halved for an FP8 KV cache). Runtime overhead = 1 GB plus 5% of the weights. LoRA assumes a 16-bit base model ×1.2 + 2 GB, QLoRA a 4-bit base ×1.3 + 2 GB, and full fine-tuning 18 bytes per parameter (AdamW, mixed precision). Real usage varies with the framework, sliding-window attention and batch shape, so leave some headroom.

Parameter count and architecture read from NousResearch/Hermes-3-Llama-3.1-405B on Hugging Face on 2026-12-03. These are estimates, not measurements; leave some headroom.

Llama 3.1 405B VRAM FAQ

How much VRAM does Llama 3.1 405B need?

About 754.4 GB for FP16 weights, 377.2 GB for FP8 and 228.7 GB at 4-bit, plus KV cache (about 3.9 GB per sequence at an 8K context) and about 1 GB of runtime overhead.

Can Llama 3.1 405B run on an RTX 4090 (24 GB)?

Not on one 24 GB card: even at 4-bit it needs about 245 GB with an 8K context. At Q4_K_M / 4-bit with an 8K context it does not fit on one GPU: 4× A100 80GB / 4× H100 / 2× H200 / 2× B200.

How much VRAM do I need to fine-tune Llama 3.1 405B?

Roughly 279.8 GB with QLoRA, 909.2 GB with LoRA on a 16-bit base model, and 6791.3 GB for full fine-tuning with AdamW (2K-token sequences, batch 1).