DeepSeek-R1 (671B MoE) — VRAM Requirements, Quantization Matrix & GPU Guide

DeepSeek-R1 (671B MoE) (DeepSeek, MIT) is a Mixture-of-Experts (MoE) architecture with 671B resident parameters (37B active per token), 61 layers, and Multi-head Latent Attention (MLA) supporting up to 163,840 context tokens.

Interactive DeepSeek-R1 (671B MoE) Memory & Context Simulator

32,768 tokens

Memory Breakdown & Bandwidth Ceiling

Fits Comfortably
Model Weights: 90.8% KV: 0.5% Overhead: 8.7%
Total Required Memory
417.21 GB
Per-Device Allocation: 52.15 GB
Model Weights
378.86 GB
KV Cache (FP16): 2.14 GB
Est. Single-Stream Decode
558.9 tok/s
Runtime & TP Overhead: 36.21 GB
Max Context Before OOM
1,048,576
tokens

Architecture KV compression saves 98.2% vs naive MHA FP16 (122.00 GB).

Precision & Quantization VRAM Matrix (8K / 32K / 128K Context)

Total GPU memory required across weight precisions and context lengths (batch = 1, FP16 KV cache)
Precision / Format Effective bpw Weights Only Total @ 8K ctx Total @ 32K ctx Total @ 128K ctx Recommended Tier (@ 32K)
FP16 / BF16 16.00 bpw 1249.83 GB 1289.19 GB 1290.80 GB 1297.24 GB 8× NVIDIA H100 80GB
FP8 8.50 bpw 663.97 GB 685.76 GB 687.37 GB 693.80 GB 8× NVIDIA H100 80GB
Q8_0 8.50 bpw 663.97 GB 685.76 GB 687.37 GB 693.80 GB 8× NVIDIA H100 80GB
Q6_K 6.56 bpw 512.43 GB 529.67 GB 531.28 GB 537.71 GB 8× NVIDIA H100 80GB
Q5_K_M 5.69 bpw 444.47 GB 459.67 GB 461.28 GB 467.71 GB 8× NVIDIA H100 80GB
Q4_K_M 4.85 bpw 378.86 GB 392.09 GB 393.69 GB 400.13 GB 8× NVIDIA H100 80GB
AWQ INT4 4.50 bpw 351.52 GB 363.93 GB 365.53 GB 371.97 GB Mac Studio 512GB
IQ4_XS 4.25 bpw 331.99 GB 343.81 GB 345.42 GB 351.85 GB Mac Studio 512GB

Hardware Compatibility & Decode Speed (DeepSeek-R1 (671B MoE) @ Q4_K_M, 32K Context)

Fit status, memory utilization, and estimated decode throughput across flagship GPUs and Apple Silicon
Hardware Tier Memory & Bandwidth Required (32K) Fit Verdict Est. Decode Speed
RTX 3090 24GB 24 GB · 936 GB/s 393.69 GB (1640%) Out of Memory (OOM) —
RTX 4090 24GB 24 GB · 1008 GB/s 393.69 GB (1640%) Out of Memory (OOM) —
RTX 5090 32GB 32 GB · 1792 GB/s 393.69 GB (1230%) Out of Memory (OOM) —
Apple M-Max 64GB 64 GB · 546 GB/s 387.67 GB (606%) Out of Memory (OOM) —
Mac Studio 128GB 128 GB · 546 GB/s 387.67 GB (303%) Out of Memory (OOM) —
Mac Studio 192GB 192 GB · 800 GB/s 387.67 GB (202%) Out of Memory (OOM) —
NVIDIA A100 80GB 80 GB · 2039 GB/s 393.69 GB (492%) Out of Memory (OOM) —
NVIDIA H100 80GB 80 GB · 3350 GB/s 393.69 GB (492%) Out of Memory (OOM) —

Verified Transformer Architecture Parameters

Checkpoint ID
deepseek-ai/DeepSeek-R1
Ollama Tag
deepseek-r1:671b
License / Release
MIT · 2025-Q1
Topology & Attention
Mixture-of-Experts (MoE)
Attention Mechanism
Multi-head Latent Attention (MLA)
Total Params (B)
671B
Active Params / Token (B)
37B
Hidden Layers / Hidden Size
61 / 7168
Query Heads / KV Heads
128Q / 128KV (d=128)
MLA kv_lora_rank / rope_dim
512 / 64
MoE Routed Experts
8 active / 256 total
Vocab / Max Position
129,280 / 163,840

Quantized formats store per-block scale factors and zero-points alongside packed integer weights. A 4-bit GGUF Q4_K_M checkpoint averages 4.85 effective bits per parameter (not 4.00), while Q8_0 averages 8.50 bpw. For Mixture-of-Experts models, all routed and shared experts remain resident in memory to prevent token-by-token host paging.

Standard Grouped-Query Attention allocates 2 × L × H_kv × d_head × S × B × bytes_kv across layers. DeepSeek Multi-head Latent Attention (MLA) compresses keys and values into L × (d_kv_lora + d_qk_rope) × S × B × bytes_kv, slashing long-context memory by over 90%. Hybrid sliding-window models cap local-attention layers at min(S, window_size) while scaling global layers linearly with S.

Quick-Start vLLM & Ollama Commands for DeepSeek-R1 (671B MoE)

vLLM CLI (8× NVIDIA H100 80GB)
vllm serve deepseek-ai/DeepSeek-R1 \
  --tensor-parallel-size 8 \
  --max-model-len 32768 \
  --max-num-seqs 8 \
  --gpu-memory-utilization 0.80 \
  --kv-cache-dtype fp8 \
  --enable-expert-parallel \
  --enable-prefix-caching \
  --port 8000
Ollama Modelfile
# Save as Modelfile, then run: ollama create deepseek-r1-671b-custom -f Modelfile
FROM deepseek-r1:671b
PARAMETER num_ctx 32768
PARAMETER num_batch 512
PARAMETER flash_attn true

# Environment variables for ollama serve:
# OLLAMA_NUM_PARALLEL=8 OLLAMA_FLASH_ATTENTION=1 OLLAMA_KV_CACHE_TYPE=q8_0 ollama serve

Compare Sibling & Similar-Scale Open-Weight Models