ImageFirm Research Note · Systems / Local AI · reviewed 06 Sep 2026

How much memory do you actually need to run a local LLM?

Parameter count is only the first term. A defensible answer requires weight precision, architecture, KV-cache geometry, context length, concurrency, runtime overhead and the memory topology of your machine.

Core rule: size the deployment envelope, not the model name. “70B fits in 64 GB” can be true at Q4 with moderate context and false at the model’s maximum context.
01 · Interactive sizing laboratory

Build the memory budget before you download the model.

This estimator uses transparent first-principles math. It is deliberately conservative: the result is a planning estimate, not a promise that a specific backend will allocate exactly the same amount.

ImageFirm Local LLM Memory Lab
Read methodology
B
For MoE, use total stored parameters.
B
Compute proxy; does not shrink stored weights.
KV memory grows approximately linearly with sequence count.
%
OS, apps and operational safety margin.
Advanced architecture + runtime parameters
% weights
GiB
GiB
23.5GiB peak
32 GiB

Recommended installed memory for this scenario.

● Practical fit
Weights16.0 GiB4.5 bpw estimate
KV cache3.0 GiB32K · batch 1 · 16-bit
Runtime2.8 GiBworkspace + fixed allowance
Peak before reserve21.8 GiBbackend allocations can vary
0 GiB64 GiB planning scale
Context-length memory curvesame architecture · same quantization

Unified memory lets CPU and GPU share the same pool, but the operating system and applications share it too. Do not plan to consume 100% of installed memory.

02 · First principles

The memory equation is simple. The architecture hidden inside it is not.

For autoregressive inference, the dominant persistent allocations are usually the model weights and the KV cache. Activations, scratch buffers, allocator fragmentation, multimodal components and the host runtime create additional headroom requirements.

TERM 01 / WEIGHTS

Stored parameters

Mw ≈ Ptotal × beff / 8

A 30.5B-parameter model at an effective 4.5 bits/weight is about 16.0 GiB before format-specific and runtime effects. In an MoE model, active parameters primarily reduce compute per token; the full expert set still has to be stored unless the serving system explicitly offloads or sparsely loads experts.

TERM 02 / KV CACHE

Sequence state

MKV ≈ B × T × L × 2 × HKV × dhead × bytes

The two is for keys + values. Grouped-query attention (GQA) cuts KV memory by using fewer KV heads than query heads. Context length T and concurrency B scale the cache roughly linearly for standard dense caches.

TERM 03 / HEADROOM

Everything else

Mpeak ≈ Mw + MKV + Mruntime

Then reserve capacity for the OS, other apps, framework buffers, tokenization, graph workspaces and transient peaks. The exact overhead is implementation-specific, so a planning margin is more honest than a universal fixed number.

Why the blueprint’s “model + KV + context + overhead” formula needs correction

Context length is not normally a second large memory object added independently after the KV cache. Its dominant persistent cost is expressed through the KV cache (plus comparatively smaller token/input/runtime buffers). Adding a generic “context GB” term on top of a KV calculation can double-count the same phenomenon.

03 · Blueprint fact-check

What the infographic gets right—and where experts should add caveats.

The original is useful as an introductory mental model. The upgrade is to replace categorical RAM tiers with explicit assumptions and architecture-aware arithmetic.

“Hold the whole model + context”
Mostly correct

Keep the intuition, refine the language. You need the stored weights plus sequence-state memory and runtime allocations. On CPU+GPU hybrid systems, all weights need not sit in GPU VRAM simultaneously.

“Unified memory counts”
Correct, scoped

Apple’s MLX uses a shared memory pool accessible by CPU and GPU. That is a genuine advantage for large local models, but installed unified memory is also consumed by macOS and other processes.

16 / 32 / 64 / 128 GB tiers
Useful heuristic

The tiers are not model-class laws. A 70B Q4 can fit in a 64 GiB envelope at moderate context, while 128K FP16 KV cache for a 70B GQA architecture can consume tens of GiB by itself.

“Lower Q = smaller and faster”
Oversimplified

Lower-bit weights are usually smaller, but speed depends on kernels, hardware and memory bandwidth. Mixed GGUF quantizers have real bits-per-weight that differ from their labels; for example, Hugging Face documents Q4_K at 4.5 bpw and Q6_K at 6.5625 bpw.

MoE examples by active size
Potentially misleading

For memory sizing, total stored parameters matter more than active parameters. Qwen3-30B-A3B activates roughly 3.3B parameters per token but stores about 30.5B total. Llama 4 Scout similarly separates active and total parameter counts.

04 · Revised 2026 capacity guide

Use RAM tiers as deployment envelopes, not promises.

These are conservative, single-user inference guidelines for broadly supported 4–6 bit quantization. They assume reasonable system headroom and do not imply acceptable speed. A model can fit and still be painfully slow.

Installed memoryComfortable local envelopeRepresentative useWatch-outs
16 GiBentry local AI3B–8B models; some 12B/14B at aggressive or balanced quantization and short contextchatlight codinglearningOS pressure arrives quickly; avoid assuming max advertised context.
24 GiBcompact workstation8B–14B with generous context; many ~20B-class Q4 deploymentscodingRAGsmall agents24B-class Q4 can be feasible but leaves less room for long context.
32 GiBstrong mainstream tier24B dense Q4; ~30B total-parameter MoE Q4; 8B/14B with very large contextserious codingmultilinguallocal RAG“Fits in 32 GB” often means moderate, not maximum, context.
48 GiBupper-mid local tier30B-class at higher precision; 70B at Q3/Q4 with constrained contextresearchagents70B Q4 is possible but operational headroom can be narrow on some stacks.
64 GiBlarge-model sweet spot70B Q4 with short-to-moderate context; smaller models with long context or concurrency70B-classadvanced codingFull 128K context can invalidate the fit depending on KV geometry and precision.
96 GiBhigh-headroom local70B Q5/Q6; 70B Q4 with long context; 100B-class Q4 in selective caseslong contextmulti-agentMemory bandwidth increasingly dominates usability.
128 GiBpower workstation70B at high quantization fidelity; 100B+ Q4; larger MoE models if total weights fitresearchlarge RAGMoE total weights still matter; “active B” is not a RAM number.
192–256+ GiBspecialist / server class100B–400B-class quantized experiments, depending strongly on precision and architecturelabmulti-modelextreme contextFit becomes a weak proxy for practicality; bandwidth, interconnect and backend support are decisive.

GiB uses binary units (2³⁰ bytes). Model repositories often report GB/file sizes in decimal units. Always compare like with like.

05 · Quantization atlas

“4-bit” is a family name, not always four physical bits per weight.

Block scales, minima, importance matrices and mixed tensor types add overhead. The GGUF documentation therefore reports effective bits-per-weight (bpw) for several K-quants.

FP16 / BF16
16.0

Reference precision. Roughly 1.86 GiB per billion parameters.

Q8_0
≈8.5

High-fidelity legacy GGUF block quantization; larger than naïve “8 bit” arithmetic.

Q6_K
6.5625

High-quality K-quant; documented effective packing cost.

Q5_K
5.5

Middle-high precision for users with extra memory.

Q4_K
4.5

Common balanced local-inference class. Real files can vary with mixed tensors.

IQ4_XS
4.25

Importance-matrix-informed 4-bit family with lower packing cost.

Q3_K
3.4375

Aggressive compression; quality sensitivity becomes model/task dependent.

Q2_K / IQ2
2.06–2.625

Extreme memory saving. Validate quality for your workload rather than trusting a generic ranking.

Quantization is a rate–distortion trade-off, not a moral hierarchy.

GPTQ and AWQ established practical low-bit post-training quantization; newer importance-aware GGUF families push size lower. But the “best” format is backend- and workload-specific. Measure task accuracy, latency, throughput and memory together.

06 · Worked examples

Why maximum context can overturn an otherwise sensible RAM recommendation.

The examples use the standard dense GQA KV formula and publicly documented architecture values. They isolate KV cache to make the effect visible; real runtimes add further allocations.

Mistral Small 3.1 · 24B
40 layers · 8 KV heads · head dim 128 · 128K context
KV(fp16) ≈ 1 × 131072 × 40 × 2 × 8 × 128 × 2 bytes ≈ 20 GiB

Its Q4_K weight estimate is about 12.6 GiB. At the full 128K context, a conventional FP16 KV cache alone is about 20 GiB. So “fits on a 32 GB machine once quantized” does not mean “fits at 128K context with an FP16 KV cache and full headroom.”

Qwen3-30B-A3B
30.5B total / 3.3B active · 48 layers · 4 KV heads · dim 128
KV(32K, fp16) ≈ 3 GiB · KV(128K, fp16) ≈ 12 GiB

Q4_K weights are roughly 16 GiB by parameter arithmetic. The MoE’s low active parameter count helps compute efficiency, but it does not turn the model into a 3.3B-memory model. GQA’s four KV heads keep cache growth relatively efficient.

Llama 3.1 · 70B
80 layers · 8 KV heads · head dim 128 · 128K context
KV(fp16, 128K) ≈ 40 GiB

Q4_K weights are roughly 36.7 GiB. At 128K context, standard FP16 KV pushes persistent weights + cache toward ~77 GiB before runtime overhead. This is why a 64 GiB machine can be a good 70B-Q4 box at moderate context yet fail at maximum context.

07 · Architecture exceptions

The simple formula is a model of the model—not the model itself.

Use the standard equation as a baseline, then inspect what the architecture and backend change.

A / ATTENTION

GQA, MQA & sliding windows

  • GQA reduces KV memory via fewer KV heads.
  • MQA can reduce it further to a single KV head.
  • Sliding-window or chunked attention can cap cache growth for eligible layers instead of extending every layer across the full context.
B / SPARSE MODELS

Mixture-of-Experts

  • Total parameters determine stored weight memory.
  • Activated experts influence compute per token.
  • Expert offloading changes the equation but can exchange memory pressure for bandwidth/latency pressure.
C / CACHE METHODS

Quantized & paged KV

  • Quantized caches trade precision/latency for lower memory.
  • Paged KV management reduces fragmentation and enables better serving utilization.
  • Prefix sharing/caching can reduce duplicated work in multi-request systems.
D / MULTIMODAL

Vision / audio components

  • Vision encoders and projectors add weights and runtime buffers.
  • Images can become many input tokens.
  • Do not size a VLM from its text-decoder parameter count alone.
E / DECODING

Speculative decoding

  • A draft model adds its own weights/cache.
  • It can improve speed while increasing memory footprint.
  • The optimum depends on draft acceptance rate and hardware balance.
F / NON-STANDARD

MLA, hybrid & recurrent state

  • Architectures such as latent-attention or hybrid state-space designs may not follow the vanilla KV formula.
  • Always inspect model/back-end documentation before extrapolating from Llama-like models.
08 · Hardware topology

RAM, VRAM and unified memory are not interchangeable labels.

The exact same model can be memory-feasible on one machine and awkward on another because the accessible pool, memory bandwidth and CPU↔GPU interconnect are different.

Apple Silicon / MLX

UNIFIED

CPU and GPU can operate on arrays in the same unified memory pool without explicit device copies in MLX. This makes large-memory Macs unusually straightforward for local inference. The trade-off is that the OS and everything else share the same pool.

NVIDIA / discrete GPU

VRAM FIRST

For fully GPU-resident inference, VRAM is the hard fit constraint. CPU RAM does not magically become VRAM. Frameworks can offload weights/cache, but the interconnect and host memory path then become part of the latency model.

CPU + llama.cpp

RAM FIT

System RAM can hold very large GGUF models, and llama.cpp supports CPU+GPU hybrid inference. The practical ceiling is often memory bandwidth rather than capacity. A model that fits can still decode slowly.

Multi-GPU servers

SHARDED

Tensor/expert parallelism can aggregate capacity across devices, but effective fit depends on how weights, activations and KV cache are partitioned. Interconnect topology becomes a first-order performance variable.

09 · Performance sanity check

Fit is binary. Usability is a bandwidth problem.

For batch-1 autoregressive decoding, large quantized models are often memory-bandwidth-bound: much of the model must be streamed to produce each token. A simple roofline gives an optimistic ceiling before compute, cache traffic and kernel inefficiency.

GB/s
GiB
optimistic token/s ceiling ≲ memory bandwidth ÷ model bytes

This is intentionally a ceiling, not a benchmark. Actual throughput is lower and depends on kernel efficiency, cache traffic, compute, quantization support, batching and interconnects.

5.1

optimistic tokens/s bandwidth ceiling

10 · Config.json inspector

Paste architecture metadata. Let the page extract the KV geometry.

This parser runs entirely in your browser. Paste a Hugging Face-style model config.json; no content is uploaded anywhere.

Detected fields

Layers
KV heads
Head dimension
Max context
Attention typeWaiting for JSON
11 · Deployment protocol

A five-step way to stop guessing.

The best practice is to move from file facts → architecture facts → workload facts → platform facts → measured peak memory.

STEP 01

Get the real weight size

Prefer the actual GGUF/safetensors shard total over parameter-count arithmetic. Quantization labels are an approximation to file size, not a substitute for it.

STEP 02

Read the config

Record layers, KV heads, head dimension, attention pattern and maximum context. Determine whether the standard GQA cache formula applies.

STEP 03

Model your workload

Choose the context you will actually allocate, plus batch/concurrency and multimodal requirements. Maximum advertised context is not a default target.

STEP 04

Map to hardware

Decide what must fit in VRAM, unified memory or system RAM. If offloading is required, explicitly account for the performance cost.

STEP 05

Measure peak allocation

Launch the exact backend, model, context and cache precision. Verify actual memory and token/s under representative prompts. Production sizing ends with measurement, not arithmetic.

NON-GOAL

Do not use this for training

Fine-tuning and training add gradients, optimizer states, master weights, activations and checkpointing behavior. QLoRA changes the economics, but it is a different memory model.

12 · Research ledger

Primary documentation first. Papers where the mechanism matters.

Research reviewed for this page includes official model cards/configs, framework documentation and peer-reviewed or primary academic work. Links open the original sources.

Official docsHugging Face · GGUF quantization typesEffective bits-per-weight for Q2_K, Q3_K, Q4_K, Q5_K, Q6_K and importance quants. Official docsTransformers · KV cache strategiesDynamic, static, offloaded and quantized cache behavior and memory trade-offs. Official docsOllama · Context lengthLarger context increases memory requirements; deployment defaults vary with available VRAM. Primary projectMLX · Unified MemoryApple silicon CPU and GPU access the same memory pool; arrays do not require device copies. Primary projectllama.cppGGUF inference, broad hardware support, low-bit quantization and CPU+GPU hybrid execution. Primary projectllama.cpp · quantizationCurrent tooling and caveats for GGUF quantization and importance matrices. Model cardMistral Small 3.1 · 24B24B parameters, 128K context, local deployment claim. Model configMistral Small 3.1 · architecture40 layers, 8 KV heads, 128 head dimension, 131,072 max positions. Model cardQwen3-30B-A3B30.5B total / 3.3B active, 48 layers, GQA with 4 KV heads. Model configQwen3-30B-A3B · architectureHead dimension 128 and detailed attention configuration. Model releaseDeepSeek-V3671B total and 37B activated parameters; an example of why active ≠ stored parameter memory. Model cardMeta · Llama 4Scout: 17B active / 109B total; Maverick: 17B active / 400B total. PaperGPTQAccurate post-training 3–4 bit weight quantization for generative transformers. PaperAWQActivation-aware weight quantization and hardware-friendly 4-bit inference. ICML 2024KIVI2-bit asymmetric KV-cache quantization and its memory/throughput implications. SOSP / paperPagedAttention / vLLMPaged KV-cache management to reduce fragmentation and improve serving throughput. NeurIPS / paperFlashAttentionIO-aware exact attention; foundational context for memory traffic and long-sequence performance. Web qualityCore Web VitalsCurrent LCP, INP and CLS user-experience thresholds informing this page’s performance design. Web standardWCAG 2.2Keyboard focus, target size, predictable interaction and accessibility requirements.