Llama · 8B parameters
Llama 3.1 8B: GPU memory requirements and which GPU to rent
Meta's 8-billion-parameter Llama 3.1 is the default small model for chat, RAG and fine-tuning experiments: 32 layers with grouped-query attention, so its KV cache stays modest even at long contexts.
- Weights at FP88.0 GB16 GB at 16-bit · 4.4 GB at 4-bit
- FP8, 8k context, 1 sequence11 GBweights + KV cache + runtime
- Suggested here1× L4$169 a month · dedicated
Inference
How much GPU memory Llama 3.1 8B needs to serve
Total memory for one sequence at each context length, and for 16 concurrent sequences at 8k — weights, KV cache at 16-bit and runtime overhead included.
| Weights precision | Weights | 4k context | 32k context | 128k context | 8k × 16 sequences | Suggested here, 8k |
|---|---|---|---|---|---|---|
| 16-bit (BF16 / FP16) | 16 GB | 19 GB | 22 GB | 35 GB | 35 GB | 1× L4 · $169/mo |
| 8-bit (FP8 / INT8) | 8.0 GB | 10 GB | 14 GB | 27 GB | 27 GB | 1× L4 · $169/mo |
| 4-bit (GPTQ, AWQ, Q4) | 4.4 GB | 6.6 GB | 10 GB | 23 GB | 23 GB | 1× L4 · $169/mo |
GB are 109 bytes. Context lengths are shown for scale where the model supports them; an FP8 KV cache halves the cache part of each figure.
Hardware
GPU servers that run Llama 3.1 8B
For FP8 inference with an 8k context and one sequence: the configurations we would suggest, in order — one large card ahead of several small ones.
Fine-tuning Llama 3.1 8B
Memory for a 2k-token sequence and a micro-batch of 4, with gradient checkpointing. Full fine-tuning keeps gradients and Adam states for every parameter; LoRA and QLoRA train small adapters on a frozen base.
| Method | Memory | Suggested here |
|---|---|---|
| QLoRA, 4-bit base | 11 GB | 1× L4 · $169/mo |
| LoRA, 16-bit base | 23 GB | 1× RTX 5090 · $279/mo |
| Full fine-tune, mixed precision | 135 GB | 2× A100 · $1,298/mo |
Architecture at a glance
Grouped-query attention: every layer keeps keys and values for every token of the context. Figures from the model's published configuration; method on the calculator page.
Llama 3.1 8B hardware: questions answered
How much VRAM does Llama 3.1 8B need?
For the weights alone: about 16 GB at 16-bit, 8.0 GB at FP8 and 4.4 GB at 4-bit. Serving it at FP8 with an 8k-token context and one sequence takes about 11 GB in total once the KV cache and the runtime are counted; long contexts and many concurrent users add the KV cache on top — about 0.13 GB per 1,000 tokens at 16-bit.
Can Llama 3.1 8B run on a single GPU?
Yes, at FP8 with a moderate context: one NVIDIA L4 (24 GB GDDR6) holds it, for $169 a month here. Longer contexts or more concurrent users may need a larger card or a second GPU.
What is the cheapest GPU setup to run Llama 3.1 8B?
For FP8 inference with an 8k context and one sequence, the configuration we would suggest is 1× L4 · $169/mo; at 4-bit, 1× L4 · $169/mo. Suggestions favour one large card over several small ones: splitting a model across PCIe cards costs speed.
How much GPU memory do I need to fine-tune Llama 3.1 8B?
With a 2k-token sequence and a micro-batch of 4: about 11 GB for QLoRA on a 4-bit base, 23 GB for LoRA on a 16-bit base, and 135 GB for a full fine-tune with Adam in mixed precision. Gradient checkpointing is assumed; sharding the optimizer across GPUs spreads the full fine-tune over several cards.
Run Llama 3.1 8B on 1× L4 for $169 a month
Dedicated, single-tenant and live in under 10 minutes — with vLLM, the Hugging Face stack or Ollama preinstalled if you want. Paid in BTC, ETH or USDT, with no KYC.