Llama 3.1, 3.2 & 3.3 VRAM & GPU Sizing Calculator
Estimates the GPU memory each Llama 3.1, 3.2 and 3.3 model needs to run: weights, KV cache and overhead. Weights are parameters times bits per weight divided by 8, with embeddings left at 16 bits in FP8 and INT4; Meta's FP8 recipe converts only the feed-forward weights between the first and last layers. The cache is 2 × layers × 8 KV heads × head size × bytes per token and sequence, and overhead is 20% of the weights.
Choose one of Meta's five Llama 3.1, 3.2 and 3.3 models, a weight format, the tokens of context each request holds and how many requests run at once, and the calculator works out the GPU memory inference needs. It shows how many of each of ten common GPUs it takes to hold the total, and a second table sizes all five models at the same settings in four formats. The math runs entirely in your browser.
How the estimate works
Three things share the GPU. The weights depend only on the model and the format they are stored in. The KV cache holds a key and a value from every layer for every token of every request in flight, so it grows with context and concurrency. The allowance stands for everything else, activations and the CUDA context among them, and defaults to 20% of the weights, the rule of thumb the LLM VRAM calculator traces to its source.
total = parameters × bits ÷ 8 + 2 × layers × 8 × head size × bytes × tokens × sequences + overhead
Two formats bend the first term. FP8 / INT8 and INT4 leave the embedding table and output layer in 16-bit, and INT4 counts 4.156 bits a weight, 4 + 20/128, for the 16-bit scale and 4-bit zero point stored with each group of 128 weights. That is why INT4 needs more memory than Q4_K_M on the 1B to 8B models. Llama 3.1 8B in INT4 takes 5.33 GiB of weights against 4.58 GiB, within 0.01% of the 5,727,938,576-byte AWQ checkpoint on Hugging Face, which stores exactly those scales and zero points.
All five models have 8 KV heads, and each head holds 128 values except in the 1B, where it holds 64. The defaults run Llama 3.3 70B as a GGUF Q4_K_M file with a 32,768-token context and one sequence. Its 70,553,706,496 parameters at 4.8944 bits each take 40.2 GiB. Each token caches 2 × 80 layers × 8 heads × 128 × 2 bytes, which is 320 KiB, so 32,768 tokens add exactly 10 GiB. The allowance adds 8.04 GiB, for 58.24 GiB in all: one 80 GB H100 filled to 73%, or two 32 GB RTX 5090s at 91%. Cards are counted at their rated memory, read as GiB, though a little less is usable in practice.
The five models
| Model | Parameters | Layers | KV heads × head size | KV cache per token, 16-bit | Embedding table |
|---|---|---|---|---|---|
| Llama 3.2 1B | 1,235,814,400 | 16 | 8 × 64 | 32 KiB | Shared by input and output |
| Llama 3.2 3B | 3,212,749,824 | 28 | 8 × 128 | 112 KiB | Shared by input and output |
| Llama 3.1 8B | 8,030,261,248 | 32 | 8 × 128 | 128 KiB | Separate input and output |
| Llama 3.3 70B | 70,553,706,496 | 80 | 8 × 128 | 320 KiB | Separate input and output |
| Llama 3.1 405B | 405,853,388,800 | 126 | 8 × 128 | 504 KiB | Separate input and output |
Meta's own model list gives Llama 3.3 70B exactly the architecture of Llama 3.1 70B, so one entry covers both. All five read up to 131,072 tokens, the limit Meta's code sets for them and the "128k" of its model cards, and the calculator stops there.
From LLaMA to Llama 3.3
The LLaMA paper, posted on 27 February 2023, described models from 7 billion to 65 billion parameters. The 65B had 80 layers of 64 attention heads, 128 values each, and every head kept its own key and value, so in 16-bit its cache took 2,560 KiB a token. The Llama 2 paper followed on 18 July 2023 with twice the context, 4k tokens, and noted that "the memory costs associated with the KV cache size in multi-head attention (MHA) models grow significantly". Its 34B and 70B models therefore shared key and value projections across several query heads, which is grouped-query attention.
Llama 3, released on 18 April 2024 in 8B and 70B sizes with an 8k context, used grouped-query attention in both. Its 70B serves 64 query heads from 8 key and value heads, so its cache takes 320 KiB a token, an eighth of the 65B's. Llama 3.1, on 23 July 2024, stretched the context to 128K tokens and added 405B, which the Llama 3 paper says, in BF16, "does not fit in the GPU memory of a single machine with 8 Nvidia H100 GPUs"; Meta ran it across 16 GPUs on two machines. Llama 3.2 added 1B and 3B text models on 25 September 2024, built to "fit onto edge and mobile devices", and Llama 3.3 70B arrived on 6 December 2024. Meta's model card scores it above 3.1 405B on instruction following (IFEval, 92.1 against 88.6) and maths (MATH, 77.0 against 73.8), for less than a fifth of the memory: 167.7 GiB against 922.9 GiB in BF16 at 32,768 tokens.
Meta's FP8 recipe for 405B
To fit 405B in one server, Meta "quantized our models from 16-bit (BF16) to 8-bit (FP8) numerics", in the words of its launch post, "allowing the model to run within a single server node". Section 6.2 of the paper quantizes "most parameters and activations in the feedforward network layers", with a scaling factor for each row, but adds that "We do not quantize parameters in the self-attention layers of the model" and "we do not perform quantization in the first and last Transformer layers".
The published checkpoint follows that rule. Its configuration on Hugging Face leaves every attention projection, and the feed-forward weights of layers 0 and 125, unconverted. Its files hold 324,538,466,304 parameters in FP8, exactly 3 × 16,384 × 53,248 × 124, and the other 81,314,922,496 in BF16. Choose FP8, Meta's 405B recipe, to size it: 453.71 GiB of weights, against 381.89 GiB for the generic FP8 / INT8 option, which converts everything but the embeddings and output layer. Meta's code lists the eight FP8 checkpoint files at 60,903,742,309 bytes each, within 0.02% of that estimate.
At 32,768 tokens the total is 560.2 GiB, eight H100s filled to 88%, which agrees with vLLM's July 2024 note that it runs "on a single 8xH100 or 8xA100". The same settings in BF16 need 922.9 GiB, twelve H100s. Of these five models Meta published FP8 weights only for 405B, so the recipe is offered for the other sizes as a comparison.
How close the estimate gets
Ollama's library lists each model in 16-bit, Q8_0 and Q4_K_M. In decimal gigabytes, and to the precision Ollama shows, the weights here match all ten of its 16-bit and Q8_0 sizes, from 2.5 GB for the 1B to 812 GB for 405B, and its Q4_K_M sizes for 3B, 8B and 70B. Q4_K_M is a k-quant mixture whose bits per weight vary by model; the 4.8944 used here is llama.cpp's measurement on Llama 3.1 8B. Ollama's 405B Q4_K_M file is 243 GB, about 2% under the 248.3 GB estimated here, and its 1B file is 808 MB, about 7% over 756 MB. For another GGUF type, choose Other bits per weight and enter llama.cpp's figure, such as 5.7036 for Q5_K_M, the default, or 6.5633 for Q6_K.
Long contexts and many GPUs
The cache is the part that grows. One sequence at the full 131,072 tokens holds 4 GiB of it on the 1B, 14 GiB on the 3B, 16 GiB on the 8B, 40 GiB on the 70B and 63 GiB on 405B, and an 8-bit FP8 cache halves each. Concurrent sequences multiply it again: eight 32,768-token sequences on the 70B keep 80 GiB of cache, about twice its Q4_K_M weights. How fast those tokens come out is a separate question, which the LLM inference speed calculator answers.
The GPU counts are a floor, because they assume the total splits evenly across the cards. Splitting 405B 16 ways, twice its 8 KV heads, means copying heads: Meta's 16-way checkpoint of 405B lists 16 KV heads rather than 8, so each token caches 1,008 KiB instead of 504 KiB.
Why Llama 4 is not here
Llama 4 Scout and Maverick, released on 5 April 2025, activate 17 billion parameters per token from a mixture of experts holding 109 billion in total for Scout and 400 billion for Maverick, and every expert must be loaded because any token can be routed to it. Three of every four of their attention layers look only at a local chunk of the context, which vLLM's documentation lists as "3 local : 1 full", so the every-layer formula here does not describe their cache. Meta says Scout "can fit within a single H100 GPU with on-the-fly int4 quantization" and that Maverick's "FP8 quantized weights fit on a single H100 DGX host". Neither is offered as a preset.
Figures are planning estimates, not guarantees: real memory use depends on the inference engine, its settings and the driver. This site is not affiliated with Meta or any hardware maker named above. See the site disclaimer.
Frequently asked questions
How much VRAM does Llama 3.3 70B need?
At a 32,768-token context with one sequence and the 20% overhead allowance, 167.7 GiB in BF16, 91.2 GiB in FP8, 54.44 GiB in INT4 and 58.24 GiB as a GGUF Q4_K_M file. That is three 80 GB H100s in BF16, two in FP8 and one for either 4-bit format. Llama 3.1 70B has the same architecture and needs the same memory.
Can Llama 3.1 405B run on one server with eight H100s?
Only in FP8. Meta's FP8 release, which keeps attention and the first and last layers in BF16, needs 560.2 GiB at a 32,768-token context, eight H100s filled to 88%. In BF16 the weights alone take 755.96 GiB and the total is 922.9 GiB, twelve H100s, which is why Meta's paper ran BF16 inference on 16 GPUs across two machines.
How much VRAM does Llama 3.1 8B need?
21.95 GiB in BF16 at a 32,768-token context, which fills one 24 GB RTX 4090 to 91%. As a GGUF Q4_K_M file it needs 9.49 GiB, of which 4.58 GiB is weights and 4 GiB is the KV cache, so at that context the cache weighs almost as much as the model.
How much memory does Llama's 128K context take?
Each token adds a fixed amount of 16-bit cache: 32 KiB on Llama 3.2 1B, 112 KiB on 3B, 128 KiB on 8B, 320 KiB on 70B and 504 KiB on 405B. One sequence at the full 131,072 tokens therefore holds 4, 14, 16, 40 and 63 GiB. An 8-bit FP8 cache halves each figure, and every concurrent sequence adds the same again.
Why isn't Llama 4 in the calculator?
Llama 4 Scout and Maverick, released on 5 April 2025, are mixture-of-experts models with 109 billion and 400 billion parameters in total, of which 17 billion are active for each token. Three in four of their attention layers look only at a local chunk of the context, so the every-layer cache formula used here does not describe them. Meta says Scout fits one H100 with int4 quantization and Maverick's FP8 weights fit one H100 DGX host.
Sources
- The Llama 3 Herd of Models, arXiv, 2024
- sku_list.py: model architectures and checkpoint sizes, Meta, llama-models on GitHub
- sku_types.py: maximum sequence length by model, Meta, llama-models on GitHub
- Meta-Llama-3.1-8B-Instruct-AWQ-INT4 quantization config, Hugging Face, 2024
- Meta-Llama-3.1-8B-Instruct-AWQ-INT4 model metadata, Hugging Face, 2024
- Llama-3.1-405B-Instruct-FP8 model metadata, Hugging Face, 2024
- Introducing Llama 3.1: Our most capable models to date, Meta AI, 2024
- Announcing Llama 3.1 Support in vLLM, vLLM, 2024
- Llama 3 model card, Meta, llama-models on GitHub, 2024
- Llama 3.1 model card, Meta, llama-models on GitHub, 2024
- Llama 3.2: Revolutionizing edge AI and vision with open, customizable models, Meta AI, 2024
- Llama 3.3 model card, Meta, llama-models on GitHub, 2024
- Llama 4 model card, Meta, llama-models on GitHub, 2025
- LLaMA: Open and Efficient Foundation Language Models, arXiv, 2023
- Llama 2: Open Foundation and Fine-Tuned Chat Models, arXiv, 2023
- llama-quantize README, llama.cpp on GitHub
- llama3.1 tags, Ollama
- llama3.2 tags, Ollama
- Hybrid KV Cache Manager, vLLM documentation