Can I run DeepSeek V4 Flash locally?
DeepSeek V4 Flash is a mixture-of-experts model supported by llama.cpp (architecture deepseek4). The local GGUF files come from Unsloth; levels without a plain file use Unsloth’s dynamic quantizations, which the tables mark.
Its compressed attention is what makes long context cheap: every layer keeps a 128-token window, 21 layers add a cache compressed 4× (with indexer keys) and 20 layers one compressed 128×. At 1M tokens the KV cache is about 6.7 GB at FP16, so the weights decide almost everything.
Estimates with default assumptions: 10% runtime overhead, ~90% usable VRAM (~72% on Macs), FP16 KV cache, one sequence. Model data synced from Hugging Face on 2026-11-23. Methodology.
DeepSeek V4 Flash 0731 (MoE): memory by quantization
304B parameters, 43 layers. Weights are real GGUF file sizes from unsloth/DeepSeek-V4-Flash-0731-GGUF.
| Quantization | Weights | Total at 8K context | Total at 32K context |
|---|---|---|---|
| Q8_0Unsloth dynamic file (UD-Q8_K_XL) | 150.8 GB | 165.9 GB | 166.1 GB |
| Q4_K_MUnsloth dynamic file (UD-Q4_K_XL) | 144.4 GB | 159.0 GB | 159.1 GB |
| IQ4_XSUnsloth dynamic file (UD-IQ4_XS) | 127.3 GB | 140.1 GB | 140.2 GB |
| Q3_K_MUnsloth dynamic file (UD-Q3_K_M) | 119.3 GB | 131.3 GB | 131.4 GB |
| Q2_KUnsloth dynamic file (UD-Q2_K_XL) | 90.2 GB | 99.3 GB | 99.4 GB |
Which hardware runs DeepSeek V4 Flash 0731 (MoE)?
Highest-quality quantization that fits fully. “Offload” means it runs only with part of the model in system RAM (64 GB assumed).
| Hardware | 8K context | 32K context |
|---|---|---|
| 2× NVIDIA GeForce RTX 5090 | Offload Q2_K (~23 layers on GPU) | Offload Q2_K (~23 layers on GPU) |
| NVIDIA RTX PRO 6000 Blackwell (96 GB) | Offload Q2_K (~37 layers on GPU) | Offload Q2_K (~37 layers on GPU) |
| Mac Studio M5 Max (128 GB) | Doesn’t fit | Doesn’t fit |
| Mac Studio M3 Ultra (256 GB) | Q8_0 (165.9 GB) | Q8_0 (166.1 GB) |
| 2× NVIDIA H100 SXM (80 GB) | Q3_K_M (131.3 GB) | Q3_K_M (131.4 GB) |
| 4× NVIDIA H100 SXM (80 GB) | Q8_0 (165.9 GB) | Q8_0 (166.1 GB) |
Try your own setup
Result
Fits fully
DeepSeek V4 Flash 0731 (MoE) · Q4_K_M · 128K → Mac Studio M3 Ultra (256 GB). 24.6 GB of headroom.
| Component | Memory |
|---|---|
| Weightsactual GGUF file: UD-Q4_K_XL | 144.4 GB |
| KV cache128K tokens × 1 seq, F16 | 0.85 GB |
| Recurrent statelinear-attention layers, fixed size | 0.01 GB |
| Runtime overhead10% of weights | 14.4 GB |
| Total needed | 159.7 GB |
| Usable on your hardware72% of 256.0 GB | 184.3 GB |
- Only an Unsloth “dynamic” file exists at this level (UD-Q4_K_XL); its size is used.
- Mixture-of-experts: all experts must be in memory, so memory uses total parameters. Speed depends on active parameters.
Run it
Starting point, not a guarantee. Downloads the GGUF from Hugging Face.
llama-server -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL -c 131072 -ngl 999Split file: llama.cpp downloads all parts automatically.
OLLAMA_CONTEXT_LENGTH=131072 ollama serve
ollama run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XLThis GGUF is split into several files; if Ollama refuses it, use llama.cpp.
Model details
- Parameters
- 304BHugging Face safetensors parameter count (may include extra modules such as a vision encoder or MTP layers)
- Layers
- 43
- Attention
- Compressed attention (sliding window + 4× / 128× compressed KV)2× window 128 (K 512) · 21× window 128 + 4× compressed (K 512 + indexer 128) · 20× window 128 + 128× compressed (K 512)
- Max context
- 1024K
- License
- mit
- Config source
- deepseek-ai/DeepSeek-V4-Flash-0731synced 2026-10-24
Questions
Can DeepSeek V4 Flash run on a single GPU?
Not fully. Even Q2_K needs about 99 GB with overhead. A 96 GB RTX PRO 6000 or an 80 GB H100 runs it with partial CPU offload (the tables show the estimated GPU layers), and two RTX 5090s also need offload. Four 80 GB H100s hold Q8_0.
Which Mac can run DeepSeek V4 Flash?
With the default 72% of unified memory usable, a Mac Studio with 256 GB holds Q8_0 (about 166 GB in total). Machines with 128 GB or less cannot hold even Q2_K fully.
Why does long context cost so little memory?
Most layers do not keep a full-length cache. Each keeps only the last 128 tokens, and the compressed caches store one row per 4 or 128 tokens. At 128K tokens the KV cache is under 1 GB; at 1M tokens about 6.7 GB.