How to Run DeepSeek V4-Flash Locally
From 82.5GB IQ1 to the official 166.9GB build: pick your quantization tier, then serve DeepSeek V4-Flash-0731 with Ollama or llama.cpp on the hardware you have.
Note
Before you start
- A machine with at least 96GB of system RAM and one GPU with 80GB+ VRAM (two 80GB GPUs if you want the 4-bit tier)
- A terminal and 120GB+ free disk space for the model files
- Ollama or llama.cpp installed (step 2 covers both)
- Roughly 45 minutes: most of it is the model download, not setup
Jump to section
- 1
Pick your quantization tier
Use the ladder below: match the build size to your VRAM, remembering that runtime and KV cache add roughly 10-15% on top of the weight file.
- 2
Install a runner
Install Ollama (the easiest path, bundles llama.cpp) or plain llama.cpp. Both commands are below.
- 3
Pull the GGUF for your hardware
Use the exact `hf.co/unsloth/...` tag from the quantization ladder. This is the long step: downloads are 80-160GB.
- 4
Verify it loaded onto the GPU
Run `ollama ps` and confirm the Processor column shows GPU memory, not 100% CPU. On two GPUs, Ollama splits the model across both automatically.
- 5
Chat and call it from code
Use the OpenAI-compatible endpoint at localhost:11434/v1 with the sampling settings DeepSeek recommends for agentic work.
You’re going to serve DeepSeek V4-Flash-0731 - the MIT-licensed, 284B/13B-MoE agentic model that tops the official Terminal-Bench 2.1 charts at 82.7 - on your own GPUs, sized honestly to your hardware. This guide is the practical companion to our VRAM reality check: same official figures, but with the exact commands to make it run.
What you need to know up front: this is a 284B-parameter MoE (13B active per token), and the smallest community build is 82.5GB. This is not a laptop project. The good news is that compute is cheap - the active params are small - so memory is the entire game.
The numbers you can trust
Every size in this guide was fetched from the official DeepSeek-V4-Flash-0731 card or the unsloth GGUF tree on 13 August 2026, cross-checked against the VRAM reality article (fetched 12 August 2026). The 520GB figure you see in threads matches no official artifact.
Step 1: Pick your quantization tier
Community GGUFs (unsloth’s Dynamic 2.0 builds) come in a ladder from 82.5GB to 162GB, and the official repo ships at 166.9GB. Rule of thumb from the VRAM guide: VRAM needed ≈ weights + 10–15% headroom for runtime and KV cache. With the 1M-token context, cache grows into the tens of GB for long prompts.
| Build | Size | Fits on (VRAM budget) | Verdict |
|---|---|---|---|
| UD-IQ1_S | 82.5 GB | nothing realistic (80GB card + overhead = no) | the floor, quality heavily reduced |
| UD-IQ2_M / IQ2_XXS | 90.9 GB | 2x80GB, tight | runs, expect quality loss |
| UD-Q2_K_XL | 96.8 GB | 2x80GB | entry point for two cards |
| UD-IQ3_S | 116 GB | 2x80GB | solid middle tier |
| UD-Q3_K_M / Q3_K_XL | 128 GB | 2x80GB (the community sweet spot) | best bang per card pair |
| UD-IQ4_NL / IQ4_XS | 137 GB | 2x96GB or 4x48GB (192GB class) | recommended if memory allows |
| UD-Q4_K_XL | 155 GB | 192GB class | the 4-bit standard |
| UD-Q8_K_XL | 162 GB | 192GB class | near-lossless, only 7GB more than Q4 |
| Official HF repo | 166.9 GB | 192GB class | the vendor build, 48 weight files |
One 80GB card is not enough
Even the 82.5GB IQ1_S build exceeds one 80GB GPU’s usable capacity once the runtime and KV cache are counted. If you are on a single GPU, this guide’s answer is: pick a different model - our open-weight model chooser has field-appropriate sizes, or run a much smaller model that fits one card.
Step 2: Install a runner
Option A - Ollama (recommended to start). One install, and it spreads big models across all your GPUs automatically:
# macOS / Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows (PowerShell)
irm https://ollama.com/install.ps1 | iex
Option B - plain llama.cpp (if you want the raw server and its flags):
# macOS / Linux
curl -LsSf https://llama.app/install.sh | sh
# Windows
winget install llama.cpp
Both verify with a version check - you should see a version number, not an error:
ollama --version
Step 3: Pull the GGUF for your hardware
The tag is hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:<quant>. Replace <quant> with the tier from Step 1 - for a 2x80GB box, that’s UD-Q3_K_M:
# Ollama (substitute your tier in the tag)
ollama run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M
The first ollama run pulls the weights, so expect a long progress bar for a 128GB file. Later runs are instant.
With plain llama.cpp the same model works directly from the HF tree:
# terminal chat (same :UD- tag syntax)
llama cli -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M
# OpenAI-compatible server on port 8080
llama serve -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M
Disk space, checked twice
ollama run downloads the 128GB file to your models directory (macOS: ~/.ollama/models, Linux: /usr/share/ollama/.ollama/models) and needs space to stage it. If df -h shows less than ~2x the model size free, move the models dir with OLLAMA_MODELS before you pull - the rebuild of a failed 128GB download is more painful than the setup.
Step 4: Verify it loaded onto the GPU
This is the step most people skip, and the one that catches real problems:
ollama ps
Expected output shape (a row for your model, Processor column):
NAME ID SIZE PROCESSOR UNTIL
hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M bcfb190ca3a7 128 GB 100% GPU 4 minutes from now
The Processor column is the whole story:
- 100% GPU - fully in VRAM, best speed. On a 2x80GB box, Ollama loads the model spread across both cards (that’s the documented behavior when a model doesn’t fit a single GPU).
- 48%/52% CPU/GPU - partially offloaded; works, slower.
- 100% CPU - your GPU was not discovered. Skip to Troubleshooting, error #3.
Step 5: Chat and call it from code
In the terminal runner, just type. For the API, DeepSeek’s official card recommends temperature = 1.0, top_p = 0.95 for agentic scenarios (top_p = 1.0 otherwise), and reasoning effort levels low / high / max - with a recommended 384K maximum output at high/max effort. OpenAI-compatible call:
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M",
"messages": [
{"role": "user", "content": "Write a bash script that finds the 10 largest files in a directory tree."}
],
"temperature": 1.0,
"top_p": 0.95
}'
Any tool that takes a custom OpenAI base URL now points at http://localhost:11434/v1 - your agent stack is running the 82.7 Terminal-Bench model locally.
How to verify it worked
Run this exact sequence and confirm each check:
ollama ps # 1. your model listed, GPU in Processor
curl http://localhost:11434/api/tags # 2. JSON lists your tag
ollama run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q3_K_M "Say hello in three words."
# 3. responds promptly (vs seconds of CPU crawl)
A slow CPU-level crawl on a model that shows 100% GPU in ollama ps is expected first-token warm-up latency for 128GB of weights; sustained slowness means the model is not actually on the GPU.
Troubleshooting
1. ollama pull dies halfway, “transfer interrupted”.
The download is huge; the connection dropped. Network resume is flaky for 100GB+ files. Best fix: derive the artifact locally - download the official repo once (166.9GB) and let the runner pick the quantization, or retry ollama run overnight on a stable connection.
2. The model loads, then errors out of memory. Your budget math was off. Recheck Step 1 with the 10-15% headroom rule: a 128GB build needs ~140GB+ of total memory across your cards, and context (KV cache) eats more at 1M tokens. Steps: drop a quant tier, reduce context, or add memory. A single 80GB card cannot run any V4-Flash build - do not spend a day trying.
3. ollama ps shows 100% CPU - GPU not discovered.
Follow the official GPU-discovery checklist, in order: reboot; update drivers; on Linux confirm the container runtime works with docker run --gpus all ubuntu nvidia-smi; for NVIDIA load the uvm driver with sudo nvidia-modprobe -u; for AMD, Ollama ships ROCm 7 libraries and requires a ROCm 7 kernel driver - an older driver makes discovery hang and fall back to CPU. Logs on Linux: journalctl -u ollama -f. On macOS: ~/.ollama/logs/server.log.
4. “model not found” when running the tag.
Tag typos are the classic cause - the tree uses hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF (that exact repo) with a suffix like :UD-Q3_K_M. Run ollama ls to list exactly what you have pulled, and compare the tag character by character.
5. Responses are slow even though ollama ps says GPU.
Two usual suspects: context is set very high (1M context on 128GB of weights means the KV cache can dominate), and single-user single-request throughput expectations. Lower the context for interactive use, and confirm you are not running CPU-bound layers by checking the CPU/GPU split in ollama ps.
6. You want the DSpark speedup but don’t see it. DSpark is optional speculative decoding - the draft weights are in the GGUF tree (DSPARK Q8_0 ~10.9GB / BF16 ~11.3GB). Not every runner enables it by default. unsloth’s DeepSeek-V4 docs cover enabling it per runner; with it on, decoding reports up to 2x faster (community claim, not official DeepSeek figures).
When local beats the API
Before you buy GPUs, the honest math matters: DeepSeek’s official price for the 0731 build is $0.14 in / $0.28 out per million tokens (cache hits $0.0028), and our V4-Flash vs Qwen3.8-Max reconciliation shows why below a 192GB-class node, self-hosting mostly loses on cost. Local wins on three fronts only: privacy and air-gapped data, infinite agent-loop volume where per-call charges add up, and having the weights in-house under MIT terms. If none of those apply to you, use the API and skip the GPU budget - our model chooser has the full comparison.
Questions, answered first
Does it really require two GPUs, or is that hype?
For the useful tiers, basically yes. The smallest community build is 82.5GB (IQ1_S), and that already exceeds the usable capacity of one 80GB GPU once runtime and KV cache are counted. Two 80GB GPUs fit the 3-bit tier (128GB); the 4-bit tier and the official 166.9GB build want a 192GB-class node - two 96GB or four 48GB cards.
Why do I see 520GB mentioned for this model?
That figure matches no official artifact: the official Hugging Face repo is 166.9GB across 48 weight files, and a full BF16 conversion of the 304.2B parameters works out to roughly 610GB. The 520GB number circulates in threads with no published file listing behind it - treat it as unsourced.
Ollama or llama.cpp for running it?
Ollama, unless you need llama.cpp's server flags. Ollama wraps llama.cpp, handles multi-GPU splitting automatically, and gives you an OpenAI-compatible endpoint for free. Plain llama.cpp (`llama serve -hf ...`) is the right choice when you want finer control over the server process.
What is DSpark, and do I need it?
DSpark is the speculative decoding module shipped with the model - a small draft model that generates tokens ahead of the main model to speed up decoding. The draft weights are included in the GGUF tree (about 11GB at Q8_0 or BF16), and unsloth reports decoding up to 2x faster with it enabled. It's optional: you can run the model without it.
Why go local when the official API costs $0.14 per million input tokens?
Local only wins when you have the hardware already. The official API price - $0.14 in / $0.28 out for the 0731 build - is so cheap that below a 192GB-class node, self-hosting mostly does not beat it on cost. Going local makes sense for privacy, air-gapped work, and high-volume agent loops where per-call economics disappear.
You did it
- You can name the quant tier your hardware can actually fit, and the size it downloads at
- `ollama ps` shows the model loaded with GPU in the Processor column
- `curl localhost:11434/api/tags` returns your model tag
- You sent one chat message through the terminal runner with a real answer
- You called the model once through the OpenAI-compatible /v1 endpoint
- You know what DSpark is and whether your runner uses it