How Much VRAM Do You Need for Local LLMs? 8B to 70B Guide
See which model sizes fit 8, 12, 16, 24, 48, and 80 GB GPUs, then account for quantization, KV cache, context length, and runtime overhead.
Research · Guides · Explainers
Independent AI research & technical writing
Topic hub · 36 articles · updated
What fits, what crashes, and what is really slowing your GPU down.
VRAM sizing, CUDA and PyTorch errors, out-of-memory diagnosis, multi-GPU behavior, and measured prefill and decode performance on RTX 4090-class hardware.
New to GPUs, CUDA & VRAM?
See which model sizes fit 8, 12, 16, 24, 48, and 80 GB GPUs, then account for quantization, KV cache, context length, and runtime overhead.
Learn how to reduce local LLM VRAM usage with quantization, shorter context, KV-cache compression, CPU offloading, smaller models, and runtime tuning.
Find why a local LLM is slow by separating prompt processing from token generation, checking GPU offload, memory pressure, context growth, and CPU bottlenecks.
Search this page for your exact error text
Diagnose CUDA out-of-memory errors by separating live tensors, PyTorch's caching allocator, non-PyTorch allocations and fragmentation before changing batch sizes or allocator settings.
failed to allocate buffer for rs cache: Fix Recurrent-State OOMFix llama.cpp startup failures reporting failed to allocate buffer for rs cache by separating recurrent-state memory from KV cache, GPU weights, and server concurrency.
Fix torch.cuda.is_available() returning False by checking nvidia-smi, the active PyTorch wheel, Python environment, GPU visibility, and Docker passthrough.
Fix vLLM startup errors caused by insufficient KV-cache capacity. Separate weight OOM from long-context sizing, batch concurrency and CUDA graph memory.
Fix llama.cpp SPLIT_AXIS_UNKNOWN assertions by testing layer split, updating old builds, isolating tensor-distribution graph failures, and separating them from VRAM errors.
Diagnose H100/SM90 FA4 decode regressions by checking the pinned FlashAttention commit: v0.31.0 still uses the pre-fix pin, while current vLLM main includes PR #198.
SPLIT_MODE_TENSOR not implemented: Update the RuntimeFix the qwen4exp SPLIT_MODE_TENSOR not implemented error by updating stale llama.cpp builds, verifying the actual binary, and using layer split as a fallback.
failed to allocate compute pp buffers: Fix -ub and VRAMFix llama.cpp compute pp buffer failures by lowering -ub/--ubatch-size first, then checking VRAM headroom, backend allocation limits, --fit, and speculation.
failed to allocate buffer for kv cache: Fix VRAM and ContextFix llama.cpp KV-cache allocation failures by lowering context or parallelism, leaving VRAM headroom, checking cache types, and reading the real allocator error.
Diagnose vLLM speculative-decoding CUDA illegal-memory-access crashes by comparing target and draft context limits; route over-limit requests without speculation or align the limits.
Issue #29168 initially bisected an MTP acceptance drop to CUDA MoE fusion, but the reporter later found it was specific to one raw prompt and closed the issue.
A practical llama.cpp CUDA-vs-Vulkan guide: verify the backend actually loaded, compare device support and kernels, benchmark the same workload, and avoid mistaking CPU fallback for a backend result.
Find the largest llama.cpp context that fits your GPU by separating weights, KV cache, compute buffers, concurrency, auto-fit, and backend limits.
Understand it, then set it up
AI Foundations #30 explains why variable-length KV caches fragment GPU memory, how paging divides cache into blocks, how logical token positions map to physical memory, and why this helps serving throughput.
AI Foundations #28 explains static batching, continuous batching, request scheduling, chunked prefill, head-of-line blocking, fairness, and why server throughput and user latency can pull in opposite directions.
A new llama.cpp CUDA patch shows that Blackwell NVFP4 prefill was limited by tile delivery, barriers, and register pressure—not simply tensor-core arithmetic.
Learn what LLM context length means, what counts toward the context window, how tokens, chat history, KV cache, VRAM, truncation, and long-context models work.
Learn what an LLM KV cache stores, why it speeds up token generation, how to estimate its VRAM use, and how context length and quantization affect memory.
Tested on real hardware
A controlled RTX 4090 + RTX 3060 experiment traced a severe Strata Q2_0 multi-GPU prefill slowdown to the Linux expert-copy path. Allowing full CUDA host registration raised 32K prefill from 665 to 2,110 tok/s.
An independent Ubuntu RTX 4090 reproduction of NInfer's Qwen3.8-27B A8 claims reaches 4,999.5 tok/s pp2048, 500.9 tok/s edit decode, and exact retrieval at 260K context.
Independent RTX 4090 testing finds UD-IQ3_XXS only ~2% slower than UD-Q3_K_XL at matched context, while reducing the 200K GPU memory budget from 16 to 15 GiB cuts prompt processing by 19%.
What changed, and why it matters
A version-aware guide to vLLM import failures after PyTorch or CUDA changes, with environment checks, clean-install controls, and a recovery decision tree.
A source-level look at llama.cpp PR #29963, which explores pipeline parallelism when MoE expert weights remain in host RAM and must be uploaded to the GPU that owns each layer.
Merged llama.cpp PR 29958 stabilizes k-pool graph shapes for GLM-5.3 and Qwen4exp, addressing reallocation after mutable state changed the reserved graph.
Independent EXL3 4.0 bpw measurements for Xiaomi MiMo-V2.6-Distill-Qwen-9B across RTX 4090, RTX 3060 12GB, mixed-GPU layer split, long context, TabbyAPI, vision, and tool calling.
An independent Qwen3.8 Flash-Next benchmark on RTX 4090 + RTX 3060 showing how auto-fit, manual MoE placement, quantization, and MTP changed decode speed.
A new llama.cpp CUDA PR targets duplicate activation quantization and intermediate FP32 traffic in dense Q4_K MLP prefill, with contributor-reported gains from 4.1% to 14.7%.
A production-inference analysis of PR #28320, which temporarily reclaims llama.cpp compute scratch so a vision projector can run on GPU without reducing context.
Two new llama.cpp reports show how batch-dependent CUDA kernels can break greedy speculative-decoding equivalence on Blackwell GPUs.
Independent RTX 4090 CUDA testing of adaptive DFlash2 in llama.cpp: fixed n=7 reached 80.11 tok/s on structured JSON, versus 70.61 tok/s for adaptive 3–7.
An independent llama.cpp PCTree test on RTX 4090 with Qwen3-8B Q8: DSpark doubled decode speed, while wider trees raised acceptance but still lost throughput.
A hands-on guide to running Qwen3.8-27B on one RTX 4090 with patched vLLM, 64K context, MTP speculative decoding, tool calling, and OpenWebUI.
Qwen3.8-27B is here. See which GGUF fits 24GB GPUs, the best llama.cpp starting point, context limits, MTP, and what makes this 27B model exciting.