LLM VRAM calculator: model weights, KV cache, and GPU tier sizing

Choose an open-weight model preset (architectures verified from official model specifications and Hugging Face config.json files) or enter custom parameters, quantization, context length, and batch concurrency to estimate total VRAM in GiB and GPU requirements.

Default preset shown. Enable JavaScript to adjust inputs.

Total VRAM
6.53 GiB
GPU tier
1 x 8 GB GPU
Weights
4.53 GiB
KV cache
1.00 GiB
Runtime
1.00 GiB

Example: RTX 4060

VRAM by weight quantization

Each row keeps the selected model, context, batch size, KV cache precision and inference engine.

QuantBits/weightWeightsTotal VRAMGPU tier
FP161614.96 GiB16.96 GiB1 x 24 GB GPU
Q8_08.57.95 GiB9.95 GiB1 x 12 GB GPU
FP887.48 GiB9.48 GiB1 x 12 GB GPU
Q6_K6.566.13 GiB8.13 GiB1 x 12 GB GPU
Q5_K_M5.75.33 GiB7.33 GiB1 x 8 GB GPU
Q4_K_M4.854.53 GiB6.53 GiB1 x 8 GB GPU
IQ3_XS3.33.08 GiB5.08 GiB1 x 8 GB GPU
CPU-only VPS (no discrete GPU)

VPS plans for AI agents that call hosted APIs

These plans provide 4 to 16 GB of system RAM for agent processes and API calls. Best VPS for AI agents

For a model with a memory estimate of up to 12 GiB, llama.cpp can use CPU offload and system RAM for low-throughput personal testing.

Provider and planSpecsOngoing costProvider link
RackNerdBlack Friday 4 GB KVM VPS 4 GB4 vCPU $4.00/mo Visit
AlphaVPSCheap C4G 4 GB2 vCPU $4.39/mo Visit
LuxvpsKVM Rootserver Tiny 4 GB1 vCPU $4.95/mo Visit
VPSDimeLinux 4GB 4 GB2 vCPU $5.00/mo Visit
OVHcloudVPS-1 4 GB2 vCPU $5.35/mo Visit
AlphaVPSCheap C6G 6 GB3 vCPU $5.48/mo Visit
Model configuration sources

How is total LLM VRAM calculated from model weights and KV cache?

Total LLM VRAM equals model weight memory plus key-value (KV) attention cache memory plus inference engine CUDA and activation overhead, all measured in binary GiB (1,024^3 bytes, matching nvidia-smi GPU reporting).

Weight memory scales directly with parameter count and effective bits per weight (for example, FP16 uses 16 bits, Q8_0 uses ~8.5 bits with quantization scales, and Q4_K_M averages ~4.85 bits). KV cache memory uses the exact Grouped Query Attention (GQA) formula: 2 × layers × kv_heads × head_dim × context_length × batch_size × kv_bytes / 1,024^3, which is why modern GQA models such as Llama 3.1 and Qwen 2.5 hold far larger contexts in VRAM than legacy Multi-Head Attention architectures.

How much VRAM do Q4_K_M, Q8_0, and FP16 save on 8B to 70B models?

Moving from FP16 to Q4_K_M cuts model weight VRAM by roughly 70%, letting an 8B model fit comfortably inside an 8 GB GPU and a 70B model fit inside a single 48 GB GPU or dual 24 GB GPUs at moderate context lengths.

However, weight quantization alone does not shrink an FP16 KV cache: at 32K to 128K context or multi-user concurrency, switching llama.cpp KV cache precision from FP16 to Q8_0 (34/32 bytes per element including FP16 block scales) or Q4_0 (18/32 bytes per element) cuts cache VRAM by roughly 47% to 72%, while vLLM FP8 KV cache cuts it by 50%. When a chosen context length exceeds a model's native max_position_embeddings (such as 32,768 tokens on Qwen 2.5), the calculator flags that RoPE or YaRN scaling is required.

When do you need a GPU server vs a standard CPU VPS for AI workloads?

Rent a GPU server when running local open-weight LLM inference for interactive tokens per second; rent a standard 4 GB+ CPU VPS when running AI agents, MCP tools, or RAG pipelines that call external LLM APIs.

CPU-only RAM offloading via llama.cpp can run small quantized models (such as 7B to 8B Q4_K_M) for low-throughput personal scripts on a high-RAM CPU VPS, but never confuses system RAM with GPU VRAM bandwidth. If your stack orchestrates hosted OpenAI, Anthropic, or Gemini APIs around the clock, open our Best VPS for AI Agents guide to filter cost-effective 4 GB+ CPU VPS plans.