How much VRAM do I need for an LLM?

Pick a model or load any one from Hugging Face, choose a quantization, context length and number of parallel requests, and see how much VRAM inference needs and which GPUs it fits on. Everything runs in your browser.

Advanced: the model numbers and overhead used

Editing any of these switches the model to Custom.

– estimated GPU memory

Weights
–
KV cache
–
Runtime overhead
–
KV cache per token
–

Displayed GB, MB and KB denote GiB, MiB and KiB (powers of 1,024).

Which GPUs fit the memory estimate

GPUMemoryResult
RTX 3060 12 GB –
RTX 4060 Ti 16GB 16 GB –
RTX 3090 / 4090 24 GB –
RTX 5090 32 GB –
A100 40GB 40 GB –
Mac, 64 GB unified memory about 75% of it is usable by the GPU by default 48 GB –
L40S / RTX 6000 Ada 48 GB –
A100 / H100 80GB 80 GB –
Mac, 128 GB unified memory about 75% of it is usable by the GPU by default 96 GB –
H200 141 GB –
B200 180 GB –

llama-server --fit preview

Without -c, -np or -ngl, llama-server sizes itself (--fit on is the default): it starts from the model's full trained context, shrinks the context until --fit-target (1024 MiB) stays free, and only then moves layers to the CPU. This box replays those steps with the estimate above.

What --fit picks

Context (-c)
–
Longest request
–
Slots
4
GPU layers (-ngl)
–
Projected GPU memory
–

    Explicit flags instead

    One slot, the longest context that fits with room for the mmproj, and a margin the fit will honour:

    llama-server -m model.gguf -c 8192 -np 1

    The same settings as environment variables (llama.cpp reads them for these flags):

    LLAMA_ARG_CTX_SIZE=8192 LLAMA_ARG_N_PARALLEL=1 LLAMA_ARG_FIT_TARGET=1024

    Steps from llama.cpp common/fit.cpp, common/arg.cpp and tools/server/server.cpp at a6ea155 (2026-09-29). llama.cpp measures its own buffers, so its numbers differ a little from this estimate; llama-fit-params --model model.gguf prints the exact flags it would use.

    Share the result on your site

    Copy a static HTML card for this model, precision, context and GPU. The source link is optional and always visible when included.

    Badge for your model card

    A static VRAM badge for the selected model at 8K context, for a Hugging Face or GitHub README. It links to the model’s page here. How the badges work.

    Qwen3.6 35B-A3B VRAM: 23.0 GB at Q4_K_M, 8K context

    Fits? Then see how many tokens per second it will write.

    The LLM VRAM Calculator on the home page runs this same estimate.

    Training instead of running it? Estimate VRAM for full fine-tuning, LoRA and QLoRA.

    VRAM for popular models

    Total GPU memory with 8,192 tokens of context, one request and an FP16 KV cache. Each model name leads to its own page, with every quantization, the cache at long context and the GPUs that fit.

    Announced, weights not out yet: Mistral Large 4 (1.05T), estimated from Mistral's figures until the weights land on October 31.

    What can your GPU run?

    Every model above, checked against one card or Mac: the best precision that fits, the longest context and the speed.

    All 73 GPU, Mac and CPU-only setups in one table

    Can I run a given model on a given GPU? One answer per popular model and card, with the quant, offload or card count it takes.

    Serving with vLLM? The vLLM KV cache calculator works out the pool vLLM allocates at startup, in tokens, how many requests fit at once, and the vllm serve command.

    See the best local LLMs for 8 to 96 GB of VRAM (for example 24 GB), or compare models and GPU memory in the reproducible report. The numbers are an open dataset (CSV and JSON, CC BY 4.0). Every precision is also in a CSV file on GitHub, free to reuse. Not sure which GGUF type to pick? See GGUF quantization explained, or, for Qwen3.8 27B on 8–16 GB, Ternary Bonsai 2 vs GSQ-RCO vs UD quants. How these estimates compare with real runs: predicted vs measured; measured one yourself? Submit a measurement with the log lines.

    How to use

    1. Choose a model, or type a Hugging Face id such as Qwen/Qwen3-8B and press Load.
    2. Pick the weight precision you plan to run, for example Q4_K_M for llama.cpp or FP8 for vLLM.
    3. Set the context length and how many requests run at the same time.
    4. Read the total and the GPU table. Open Advanced to see or change every number behind the estimate.

    Frequently asked questions

    How much VRAM does Qwen3.6 27B need at Q4_K_M?

    About 18.3 GB with 8,192 tokens of context and 19.9 GB with 32,768, for one request with an FP16 KV cache; the weights alone take 15.7 GB. So it fits one 24 GB card such as an RTX 3090 or 4090 with a 32K context.

    How is LLM VRAM calculated?

    Weights = parameters × bits per weight ÷ 8. KV cache = 2 × layers × KV heads × head dimension × bytes per value × tokens × requests. Runtime overhead = 0.5 GB for the CUDA context plus 10% of weights and cache for activations and fragmentation; you can change the 10% under Advanced.

    Why does context length matter so much?

    The KV cache grows with every token of every request. Llama 3.1 8B needs 128 KB of FP16 cache per token, so one 128K-token conversation adds 16 GB on top of the weights. An FP8 cache halves that.

    Do MoE models like Qwen3-30B-A3B need less memory?

    They compute with a few experts per token, but every expert has to be loaded, so weight memory follows the total parameter count: 30.5 billion for Qwen3-30B-A3B, not 3 billion.

    Which GGUF quantization should I pick?

    Q4_K_M is the usual default at about a third of the BF16 size; Q5_K_M and Q6_K keep more quality for coding and small models; Q3_K_M and Q2_K make a model fit at a clear cost in quality. The GGUF quantization guide on this site lists the bits per weight of each type and the size of popular models.

    Does quantizing the weights shrink the KV cache?

    No. Weight precision and KV cache precision are separate settings, so Q4 weights with an FP16 cache still need the full-size cache.

    How are newer architectures handled?

    Architecture data comes from model configs or GGUF headers, with runtime details checked against inference-engine sources. Multi-head latent attention (DeepSeek V3, GLM-5.3, Kimi K3) caches 576 values per token per layer instead of full keys and values; DeepSeek V3.2 and ordinary GLM-5 indexers add a 128-value FP8 key per token; GLM-5.3-Flash instead adds three 128-value vectors at the selected KV precision, following llama.cpp 5fc4f3c. Sliding-window layers keep only their window: 128 tokens in half of gpt-oss, 1,024 tokens in 50 of Gemma 4 31B’s 60 layers, whose other 10 layers cache 4 heads of 512 values that serve as both keys and values. Linear-attention layers keep a fixed-size state instead of a growing cache: 48 of Qwen3.8 27B’s 64 layers and 69 of Kimi K3’s 93. DeepSeek V4 also shares and compresses its cache across layers, which the calculator does not model, so its KV figure is an upper bound.

    What does "As published" mean?

    It uses the size of the model’s weight files on Hugging Face, so it matches the download even for checkpoints that mix formats, such as MXFP4 experts in gpt-oss or the 4-bit experts of DeepSeek V4 and MiMo V2.6.

    How accurate is the VRAM estimate?

    It is an estimate. Inference engines add their own buffers: vLLM reserves a fixed share of GPU memory up front, and llama.cpp allocates the cache for the full context when it starts. Leave some headroom, especially on a GPU that also drives your display.

    Why do the llama-server commands on this site leave out -ngl 99?

    Since b7440, llama.cpp fits unset arguments to free device memory (-fit, on by default). It keeps a -c you set and chooses how many layers go on the GPU, but a number given to -ngl stops the fit, and llama.cpp then loads exactly that many layers, which can run out of memory on a smaller card. So the commands set -c and leave -ngl at auto. On old builds such as b6000, which put no layer on the GPU by default, add -ngl 99. CPU-only commands keep -ngl 0 so that no layer goes to a GPU.

    Is anything I enter sent anywhere?

    The calculation runs in your browser. The only network requests go to Hugging Face, when you load a model.

    More calculators

    Updated