Llama 3.1 8B Instruct VRAM & Memory Requirements
Specific checkpoints with sourced architecture and weight files. Official BF16 safetensors: 16.58 GiB–18.49 GiB at 8,192 tokens, 1 sequence, FP16 KV, vllm.
This result is an estimate, not a measured trace.Not verifiedFile-backed weights
Publisher and provenance
- PublisherMeta
- Hugging Face
meta-llama/Llama-3.1-8B-Instruct - Revision
0e9e39f249a16976918f6564b8830bc894c89659 - Total parameters8,030,261,248
- Layers32
- Query heads32
- KV heads8 (gqa)
- Head dimension128
- Recorded context capability131,072
- Completenesscomplete · full
Memory layers in this estimate
Artifact bytes, raw KV, engine extras, and total demand are separate. This is not a runtime trace.
- Weight artifact
- 14.96 GiB (16,060,556,376 bytes)
- Raw KV cache
- 1.00 GiB (1,073,741,824 bytes)
- Engine extras / workspace
- 0.63 GiB–2.53 GiB
- Total estimated demand
- 16.58 GiB–18.49 GiB
Published artifacts
| Quantization | Selected files | Bytes | Engine | Evidence |
|---|---|---|---|---|
| Official BF16 safetensors bf16 | model-00001-of-00004.safetensors, model-00002-of-00004.safetensors, model-00003-of-00004.safetensors, model-00004-of-00004.safetensors | 16,060,556,376 (14.96 GiB / 16.06 GB) | vllm, sglang, unspecified | file-metadata |
| INT4 theoretical | No published file | 4,015,130,624 (theoretical) | — | theoretical |
Memory by quantization and context
Concurrent sequences = 1. KV defaults to FP16. The range includes documented runtime extras for the listed engine. These figures use the same core as the interactive calculator.
| Quantization | 2,048 tokens | 8,192 tokens | 32,768 tokens |
|---|---|---|---|
| Official BF16 safetensors | 15.83 GiB–17.72 GiB | 16.58 GiB–18.49 GiB | 19.58 GiB–21.58 GiB |
| INT4 theoretical Theoretical rows are not downloadable artifacts. | 4.11 GiB–5.68 GiB | 4.86 GiB–6.62 GiB | 7.86 GiB–10.31 GiB |
Raw KV contribution
Standard GQA/MHA raw KV is 2 × layers × kvHeads × headDim × tokens × sequences × bytes per element. This page uses KV heads (8), not query heads (32). Using query heads would overstate this cache by 4×.
- 8,192 tokens, 1 sequence, FP16: 1,073,741,824 bytes (1.00 GiB)
- 32,768 tokens: 4,294,967,296 bytes (4.00 GiB)
Related pages
Sources
- Llama 3.1 8B Instruct model card (Meta) — Context length 128k, GQA, Llama 3.1 Community License. Parameters as printed on the card.
- Meta llama-models sku_list.py (architecture arguments) — arch_args dim=4096, n_layers=32, n_heads=32, n_kv_heads=8. head_dim is dim ÷ n_heads = 128 (Meta's reference model derives it that way; sku_list.py has no head_dim key). The Hugging Face config.json is gated (HTTP 401), so it was not read.
- Hugging Face API — sha 0e9e39f249a16976918f6564b8830bc894c89659; gated manual; safetensors.total=8030261248; 4 safetensors siblings.
- Cross-check only: GGUF header of a community conversion (not an official source) — Header read with an HTTP range request on 2026-10-18; it agrees with Meta's numbers: block_count 32, head_count 32, head_count_kv 8, embedding_length 4096, context_length 131072, rope.dimension_count 128. The catalog values above come from Meta, not from this file.
- Hugging Face model page — Gated (manual). Llama 3.1 Community License applies; this page states facts only and does not redistribute the weights.
Assumptions that affect this result
- Requested context is within the recorded native window of 131072 tokens.
- Full-resident weight estimates use total parameters, including inactive MoE experts.
- Weight bytes come from the selected weight files only, not from every file in the repository.
- Download file size is not peak GPU memory. Runtime layout, allocator padding, and KV are extra.
- Counted files: model-00001-of-00004.safetensors, model-00002-of-00004.safetensors, model-00003-of-00004.safetensors, model-00004-of-00004.safetensors.
- Context budget is the number of cached tokens per sequence (prompt plus reserved generation).
- Concurrent sequences share one model replica; weights are not multiplied by sequence count.
- KV dtype is independent of weight quantization unless you change it.
Calculator
Loading catalog snapshot…
Search or pick a catalog checkpoint to see memory demand.
Search or pick a catalog checkpoint to see memory demand.