Skip to tool
JoeLucky

Click ★ on a tool to save it

Tool Categories

Base64 Encoder/DecoderJSON Tree ViewerHOTJWT Encoder/DecoderUUID GeneratorURL Encoder / DecoderJSON to CSVCSV to JSONJSON to YAMLYAML to JSONJSON to XMLXML to JSONCSV to YAMLYAML to CSVJSON FormatterYAML FormatterXML FormatterHTML FormatterCSS FormatterRegex TesterHash GeneratorCron ParserHTML Entity Encoder/DecoderNumber Base ConverterURL Parser / Query InspectorCSV Viewer/ValidatorMarkdown PreviewSQL FormatterMermaid Live EditorLLM API Cost CalculatorNEWLLM VRAM CalculatorNEWRAG Chunk VisualizerNEWCloud Storage Cost Calculator (S3, R2, B2)NEWSLA Uptime CalculatorNEW
JoeLucky

Practical online tools, all in one place

Privacy PolicyTerms of Service

© 2026 JoeLucky®. All rights reserved.

  1. JoeLucky
  2. /Developer
  3. /LLM VRAM Calculator

LLM VRAM Calculator

Estimate the VRAM an LLM needs and check whether it fits on your GPU.

Report

SIMILAR DEVELOPER

View all
LLM API Cost Calculator

Compare per-request and monthly API costs across OpenAI, Anthropic and Gemini, with the price check date.

Open →
RAG Chunk Visualizer

Paste a document to see RAG chunking and embedding cost estimates live. Your text is never uploaded.

Open →
Unit Converter

Convert between units across 12 categories, including length, weight, temperature, area and volume.

Open →

💬 Comments

?

No comments yet. Be the first!

WHAT IS LLM VRAM CALCULATOR?

The LLM VRAM Calculator estimates how much memory you need to RUN a large language model locally or self-hosted. Total ≈ weights + KV cache + runtime overhead, where weights = parameters × bits per weight ÷ 8 and KV cache = 2 × layers × KV heads × head dimension × bytes per element × context × concurrent sequences. Choose a model, quantization and device and it tells you whether it fits, the headroom, the longest context that fits and a generation-speed ceiling.

How to use?

  1. Choose a model (or enter custom parameters, layers, KV heads and dimension) and a weight quantization.
  2. Set the KV-cache precision, context length and the number of concurrent sequences.
  3. Pick the device capacity and type (discrete GPU, Apple unified memory) and, if needed, the device count and memory bandwidth.
  4. Read whether it fits, the memory breakdown, the longest context and the per-quantization comparison table.

Notes

  • Example: Llama 3.1 8B in Q4_K_M with an 8,192-token context and one sequence needs about 4.6 GiB of weights and about 1 GiB of KV cache, about 7 GiB with the default overhead.
  • Model specs come from Hugging Face config.json files and safetensors metadata; quantization bit widths are llama.cpp measurements on Llama-3.1-8B and differ slightly for other models.
  • It estimates memory for inference only, not training or fine-tuning; real use varies with the engine, batching and CUDA version, so keep a margin.
  • Everything is calculated in your browser.

Frequently asked questions

How much VRAM do I need to run an LLM?

Total ≈ weights + KV cache + runtime overhead. Weights = parameters × bits per weight ÷ 8; for example an 8-billion-parameter model needs about 15 GiB in FP16 (16 bits) and about 4.6 GiB in Q4_K_M (about 4.9 bits). The KV cache grows with context length and the number of concurrent sequences, so set both.

What is the KV cache and why does a longer context use more memory?

For every token processed the model stores each layer's Key and Value so it need not recompute them while generating. Size = 2 × layers × KV heads × head dimension × bytes per element × context length × sequences, so it is proportional to context length. Models with grouped-query attention (fewer KV heads) or sliding windows need much less.

Which quantization should I pick? What separates Q4, Q5 and Q8?

Fewer bits make the weights smaller and usually faster, at the cost of quality. Q8_0 is close to the original, Q5_K_M and Q6_K are common compromises, Q4_K_M is the usual starting point when memory is tight, and quality loss becomes noticeable below Q3. The table shows whether each level fits under your current settings.

How is memory counted for MoE (mixture-of-experts) models?

Every expert has to be loaded, so weights use the TOTAL parameters, not the parameters active for each token. Generation speed, however, depends on the ACTIVE parameters, which is why MoE models often use lots of memory yet are not especially slow.

Can the model use all of an Apple Silicon Mac's unified memory?

Usually not. By default the system lets the GPU use only part of the unified memory (roughly two-thirds to three-quarters), so choosing "Apple unified memory" treats 75% as usable. Pick "Custom usable share" to match your actual setting.

How are several GPUs handled?

The weights and KV cache are assumed to split evenly across cards and every card pays its own fixed runtime overhead, so the total is slightly higher than on one card. The actual split (tensor or pipeline parallelism) and communication overhead depend on the engine, so leave extra margin.

How accurate is this? Does it cover training or fine-tuning?

It is a planning estimate for INFERENCE only: weights, KV cache and an adjustable overhead. Real use varies with the engine (vLLM, llama.cpp and others), batching, CUDA version and paged-KV settings. Training and fine-tuning need far more memory (gradients, optimizer state, activations) and are outside this tool.

How is the generation-speed ceiling estimated?

Generating each token reads the active weights once, so at batch size 1 the ceiling is roughly "memory bandwidth ÷ weight bytes read per token". It is a theoretical limit that ignores compute limits, KV-cache reads and software overhead, so real speed is usually lower. It only appears after you enter your device's bandwidth.

Device

Common sizes
Device type
Advanced: runtime overhead
%
Fits — This setup can be loaded on this device.
Weights4.58 GiB
KV cache1.00 GiB
Runtime overhead1.46 GiB
Total7.03 GiB
Needed per device7.03 GiB
Usable per device22.08 GiB
Headroom15.05 GiB
Longest context that fits on this device131,456
Most concurrent sequences at this context16
Generation speed ceiling (approx., tokens/s)—

Every quantization level (current settings)

Every quantization level (current settings)
QuantizationbpwWeightsTotalFits?
FP323229.92 GiB34.91 GiBNo
FP161614.96 GiB18.45 GiBYes
Q8_08.50087.95 GiB10.74 GiBYes
FP887.48 GiB10.23 GiBYes
Q6_K6.56336.14 GiB8.75 GiBYes
Q5_K_M5.70365.33 GiB7.87 GiBYes
Q5_K_S5.57045.21 GiB7.73 GiBYes
Q4_K_M4.89444.58 GiB7.03 GiBYes
Q4_K_S4.66724.36 GiB6.80 GiBYes
Q3_K_L4.29794.02 GiB6.42 GiBYes
Q3_K_M3.9963.74 GiB6.11 GiBYes
Q3_K_S3.64293.41 GiB5.75 GiBYes
Q2_K3.15932.95 GiB5.25 GiBYes

Model specs come from Hugging Face config.json files and safetensors metadata (verified 2026-10-20); quantization bpw values are llama.cpp measurements on Llama-3.1-8B and differ slightly for other models.

This is a planning estimate of the memory needed to RUN (infer) a model, not to train or fine-tune it. Real use varies with the engine (vLLM, llama.cpp, TensorRT-LLM…), batching and CUDA version, so leave some margin.

Formulas and assumptions
  • Weights = parameters × bits per weight ÷ 8.
  • KV cache = 2 × layers × KV heads × head dimension × bytes per element × context × sequences; sliding-window layers (e.g. Gemma 2) count at most the window length.
  • Runtime overhead = a fixed amount per device + a share of the weights; these are rules of thumb you can adjust.
  • With several devices, weights and cache are assumed to split evenly and each device pays the fixed overhead.
  • Speed ceiling = memory bandwidth ÷ bytes of weights read per token (batch 1, compute ignored).