LLM VRAM Calculator , Will it fit on your GPU?
Pick a model, a quantization, and a context length. We'll tell you exactly how much VRAM you need, which GPUs in our database can run it, and what to do when nothing fits.
Configure
Set your workload, see the numbers update live.
Meta's flagship 70B model. Competitive with GPT-4 on many tasks.
Q4_K_M — 4-bit medium, popular
You need approximately
0.0 GB
of VRAM to run Llama 3 70B at Q4_K_M.
GPU compatibility
31 of 189 GPUs in our database can run this.
Doesn't fit a 24 GB card? Try this.
Practical workarounds, ranked by ease.
How VRAM is consumed by LLMs
The total number you see above is the sum of four components. Knowing them lets you tune for any GPU.
1. Model weights
The weights themselves. parametersB × bytesPerParam[quantization] × 1.10 framework overhead. This is the biggest term and the only one you control with quantization.
2. KV cache
During generation, each token's attention keys and values are cached. Grows linearly with context length and batch size. 2 × layers × hidden × bytes per token.
3. Activations
Forward-pass intermediates. Flash Attention keeps this small in modern frameworks, we budget a 1 GB floor or 5% of weights, whichever is larger.
4. Safety margin
CUDA kernel cache, allocator fragmentation, OS reservation, runtime buffers. Already rolled into the overhead term, never run a model at 100% of your VRAM.
Quantization explained
Each step down halves precision roughly. Quality loss is small until you cross the Q4 cliff.
| Quant | Bits per weight | Quality loss | Notes |
|---|---|---|---|
| FP16 | 16 | 0% | Reference precision. Datacenter inference. |
| Q8_0 | 8 | <0.1% | Effectively lossless. The safe quantization. |
| Q6_K | 6.6 | ~0.2% | Very high quality. Great if you can afford the VRAM. |
| Q5_K_M | 5.7 | ~0.5% | Excellent balance. Recommended above Q4 when room allows. |
| Q4_K_M | 4.85 | ~1% | Sweet spot. Most popular GGUF quant. Highly recommended. |
| Q4_0 | 4.55 | ~2% | Legacy 4-bit. Use Q4_K_M instead when available. |
| Q3_K_M | 3.9 | ~4% | Noticeably degraded but still usable. Last resort for VRAM-starved setups. |
| Q2_K | 3 | ~10% | Significant degradation. Only when nothing else fits. |
| INT8 | 8 | <0.5% | Datacenter-format 8-bit. Used by vLLM, TensorRT-LLM. |
| INT4 | 4 | ~2% | Datacenter-format 4-bit. AWQ, GPTQ, smoothquant. |
When to use CPU offloading
llama.cpp lets you keep a portion of model layers on the GPU and spill the rest to system RAM. The CPU computes those layers, which is dramatically slower, typically 5-15x below a fully-resident GPU run.
- Use the
-ngl Nflag in llama.cpp to choose how many layers stay on the GPU. - Push
-nglas high as it goes without OOM. Each additional layer is a measurable speedup. - DDR5-6400 dual-channel pushes ~80 GB/s. That's the ceiling for CPU-resident layers, vs ~1000 GB/s on an RTX 4090.
- Prefer offloading for batch=1 chat. For batched serving, multi-GPU beats CPU offload.
Example: Llama 3 70B Q4_K_M on RTX 4090 + 64 GB DDR5
Approximate speeds. Real numbers depend on prompt length and batch shape.
Tip: set -fa for Flash Attention and --cache-type-k q8_0 to cut KV memory in half.
Apple Silicon unified memory
When VRAM and system RAM are the same pool, the calculator's rules change.
The good news
An M3 Ultra Mac Studio with 192 GB unified memory can hold a 70B model at FP16 (~154 GB), something no single consumer GPU can do. The GPU sees the full RAM as addressable VRAM.
The catch: bandwidth
M3 Ultra: ~800 GB/s. RTX 4090: ~1000 GB/s. M3 Max: ~400 GB/s. A 4090 with 24 GB will outpace an M3 Max on anything that fits in 24 GB. Apple wins on capacity, not throughput.
How to use it
Use llama.cpp Metal backend, or MLX. The OS reserves some memory for itself, practical ceiling is ~75% of total RAM for model weights + KV cache. Plan for that headroom.
Rule of thumb: Apple's unified memory wins when you need to hold a model bigger than any consumer GPU offers (>24 GB). For models that fit in a 4090, the 4090 will be faster.
Frequently asked questions
Sanity checks, edge cases, and how the math actually works.
Now find the right hardware.
You know how much VRAM you need. Next step: pick the GPU, benchmark its real-world tokens-per-second, or design a full build.
Formulas based on public documentation from Hugging Face, llama.cpp, and vLLM.
Calibrated against measured llama.cpp, vLLM, and ExLlamaV2 workloads. Last updated 2025.