LLM GPU VRAM & Hardware Sizing Calculator (Llama 3, DeepSeek, MoE)
Calculate exact GPU VRAM requirements, KV cache scaling, and tokens-per-second hardware fit for open-weight LLMs across FP16, FP8, INT4, and GGUF quantizations.
Calculate exact VRAM allocation, KV cache scaling, and hardware compatibility across consumer GPUs and data center accelerators.
Hardware Compatibility Matrix & Generation Speeds
| GPU / Accelerator | Total VRAM | Memory Bandwidth | Inference Fit | Speed Estimate |
|---|
About LLM GPU VRAM & Hardware Sizing Calculator (Llama 3, DeepSeek, MoE)
Deploying open-weight Large Language Models (LLMs) requires careful GPU memory planning. Running out of video memory (OOM) halts inference and crashes training runs. Accurately estimating memory before provisioning cloud GPU clusters on RunPod, Lambda Labs, or AWS saves substantial operational expenses.
GPU memory consumption consists of four primary components: model weights, KV cache buffers for maintaining conversation history, activation memory during forward passes, and CUDA framework context overhead. Quantization schemes like FP8, INT4, and GGUF drastically alter these figures.
This LLM GPU VRAM Calculator calculates complete hardware requirements for leading model architectures including LLaMA 3, Mistral, Mixtral Mixture of Experts, and DeepSeek Multi-Head Latent Attention (MLA). It computes memory footprints, KV cache scaling across long context windows, and tokens-per-second performance estimates.
For designing physical electrical systems and transformers, use our transformer calculator. To plan network topologies for GPU clusters, test the subnet calculator.
Usage Guide & CLI/Code Examples
- Select a model preset (such as LLaMA 3 8B, LLaMA 3 70B, Mixtral 8x7B, or DeepSeek-V3 671B) or enter custom model parameters.
- Specify your target context window length (from 4K up to 128K or 1M tokens) and concurrent inference batch size.
- Choose your model weight quantization format (FP16, BF16, FP8, NVFP4, INT4 / Q4_K_M, or BitNet b1.58).
- Optionally select KV cache quantization (FP16, FP8, or INT4) to inspect memory savings on extended context conversations.
- Review the itemized memory breakdown chart displaying weights, KV cache, activation memory, and CUDA runtime context.
- Check the Hardware Fit matrix to see which consumer GPUs (RTX 4090) and enterprise accelerators (A100, H100, B200) can run your model.
Syntax & Specification Reference
Model parameter calculations account for hidden dimension, number of layers, query attention heads, and key-value heads (Grouped-Query Attention).
Supports Mixture of Experts (MoE) architectures, calculating both total model parameters and active parameters per token.
Implements DeepSeek Multi-Head Latent Attention (MLA) formulas, quantifying dramatic KV cache compression via low-rank latent projections.
Computes KV cache size using formula:
2 * layers * contextLength * batchSize * kvHeads * headDim * bytesPerElement (standard MHA/GQA) and latent projection dimensions (MLA).
Quantization precision bytes-per-parameter mapping:
FP32 (4.0B), FP16/BF16 (2.0B), FP8/INT8 (1.0B), NVFP4 (0.56B), INT4/Q4_K_M (0.55B), BitNet (0.27B).
Hardware roofline performance model calculates memory-bandwidth-bound generation speed: GPU Bandwidth (GB/s) / Model Weights (GB).
Technical Implementation Notes
- AI engineers and machine learning teams sizing GPU instances before deploying vLLM, Ollama, or TensorRT-LLM production endpoints.
- Self-hosting enthusiasts determining whether a specific open-source model fits on home desktop GPUs like the RTX 3060, 4080, or 4090.
- Financial planners estimating annual cloud GPU cluster costs for serving high-concurrency LLM application backends.
Edge Cases & Compatibility
Extreme context windows (128K+ tokens):
At extended context lengths, KV cache memory frequently exceeds the size of the model weights themselves, demonstrating the necessity of KV quantization or MLA architectures.Mixture of Experts offloading:
While all experts must reside in VRAM for fast generation, only active experts execute per token, reducing compute requirements while maintaining large memory capacity requirements.
Frequently Asked Questions
How much VRAM do I need to run LLaMA 3 8B and 70B?
At 16-bit precision (FP16), LLaMA 3 8B requires roughly 16 GB for weights plus 2 to 4 GB for KV cache, fitting on a 24 GB RTX 4090. At 4-bit quantization (Q4_K_M), 8B needs 6 to 8 GB, while LLaMA 3 70B Q4_K_M requires roughly 42 to 48 GB (dual RTX 3090/4090 or a single A6000/A100).
What is Grouped-Query Attention (GQA) and how does it reduce memory?
GQA shares key and value projection heads across multiple query heads (such as an 8:1 ratio in LLaMA 3). This cuts the memory footprint of the KV cache by a factor of 8 compared to classic Multi-Head Attention (MHA).
How does DeepSeek Multi-Head Latent Attention (MLA) compress the KV cache?
DeepSeek MLA projects key and value states into a compact low-rank latent vector before caching, reducing KV cache memory usage during long-context inference by more than 80% compared to standard GQA.
Why does Mixture of Experts (MoE) require full VRAM for all experts?
Although an MoE model like Mixtral 8x7B or DeepSeek-V3 activates only a fraction of parameters per token for fast generation speed, every expert router weight must remain loaded in VRAM to avoid PCIe bus bottlenecks.
How are theoretical tokens per second estimated for LLM inference?
Single-batch autoregressive token generation is memory-bandwidth bound. Dividing the GPU memory bandwidth (in GB/s) by the active model weight footprint (in GB) yields the theoretical maximum token generation ceiling.