LLM RAM & VRAM Requirements: Exact Memory Formula & Hardware Tiers

Updated: November 26, 2026 • Hardware-First Local AI Guide

Memory Formula: Total Memory (GB) ≈ (Parameters in Billions × Bits per Weight) / 8 + KV Cache + 0.5–1 GB Runtime Overhead. As a quick rule of thumb, 4-bit quantized models need ~0.6 GB per 1 billion parameters for weights alone—plus headroom for your OS and context length.

Understanding LLM RAM requirements prevents the most frustrating beginner error: assuming a 4.5 GB model file fits inside 4.5 GB of free memory. Total runtime memory consists of three distinct parts that must coexist in RAM or VRAM while you chat.

Chart showing memory budgets for 8GB RAM, 16GB RAM, and 24GB VRAM systems running local LLMs
How model weights, KV cache, and OS overhead divide up your laptop memory.

The 3 Components of Local LLM Memory

  1. Model Weights: Determined by parameter count and quantization precision. Uncompressed 16-bit weights (FP16) take 2 bytes per parameter (~14 GB for a 7B model). Compressing to 4-bit (Q4_K_M, ~0.55–0.6 GB per billion parameters) drops that same 7B model to ~4.4 GB.
  2. KV Cache (Active Context Window): Every token in your system prompt, chat history, and pasted source code is stored in the Key-Value cache. Expanding context from 4,096 tokens to 32,768 or 128,000 tokens can consume multiple gigabytes of extra VRAM/RAM independent of model weights.
  3. Runtime & Operating System Overhead: CUDA/Vulkan/CPU runtime buffers require ~0.5–1.0 GB (or a 15–20% multiplier), and Windows/Linux desktops consume 2–3 GB before you launch a terminal.

Quick Reference: RAM & VRAM by Parameter Size

Model ParametersFP16 (16-bit)Q8_0 (8-bit)Q4_K_M (4-bit)Recommended Hardware Tier
1.5B – 4B3–8 GB2–4.5 GB~1.2–2.6 GB8 GB RAM laptop (CPU or integrated GPU)
7B – 9B14–18 GB7.5–9.5 GB~4.4–5.8 GB16 GB RAM laptop or 8 GB+ VRAM GPU
12B – 14B24–28 GB13–15 GB~7.5–9.0 GB16 GB Unified / 12–16 GB VRAM
20B – 34B40–68 GB22–36 GB~12–22 GB24 GB VRAM or 32 GB Mac Unified RAM
70B – 72B140+ GB72–76 GB~40–45 GB48+ GB VRAM or 64 GB+ Workstation RAM

Worked Example: Why 8 GB Laptops Prefer 3B Models Over 7B

Suppose you own an 8 GB RAM Windows laptop:

  • Windows + browser/terminal overhead: ~3.2 GB used (leaving ~4.8 GB free).
  • If you pull a 7B Q4_K_M model (~4.4 GB weights + ~0.8 GB KV cache/runtime = ~5.2 GB), you overflow free RAM and force disk swapping.
  • If you pull a 3B Q4_K_M model (~2.0 GB weights + ~0.6 GB KV cache/runtime = ~2.6 GB), the entire model stays safely in fast RAM with ~2.2 GB spare headroom.

How Context Length Multiplies Memory Usage

Many users notice an 8B model works fine for short chat questions yet crashes as soon as they paste a long code file or PDF. That happens because KV-cache allocation grows linearly with active context length (num_ctx) and parallel batch size (OLLAMA_NUM_PARALLEL). On tight 8 GB–16 GB laptops, keep num_ctx capped at 4096 unless you explicitly verify spare headroom.

What Happens During Partial CPU/GPU Offloading?

If your GPU has 6 GB VRAM and a model requires 7.5 GB, runtimes like Ollama and llama.cpp can split layers between VRAM and system RAM. While this prevents a hard crash, every token pass must wait on system RAM bandwidth, slowing output significantly. Whenever possible, keep the entire model + KV cache inside either VRAM or available RAM.

Frequently Asked Questions

How much RAM do I need for a 7B parameter LLM?

In 4-bit quantization (Q4_K_M), a 7B model needs roughly 4.4 GB for weights plus 1–2 GB for KV cache and runtime overhead—meaning at least 8 GB VRAM or a 16 GB system RAM laptop is recommended for comfortable use.

Does SSD speed affect local LLM performance?

SSD speed only impacts initial model loading time if everything fits inside RAM/VRAM. Once loaded, generation speed depends entirely on RAM/VRAM capacity and bandwidth—unless you run out of memory and hit disk swapping.

What free tools check if my PC can run a specific model?

You can calculate weights manually using our 0.6 GB-per-billion-parameters Q4 shortcut above or inspect active loaded sizes directly inside Ollama using the ollama ps command.