DeepSeek-V4.1-Flash: Run Locally Guide
Run DeepSeek-V4.1-Flash-1017 locally with Unsloth GGUFs and Engram n-gram offloading.
DeepSeek-V4.1-Flash-1017 is the new update to V4.1-Flash, making it the strongest open model to date for coding, agentic tasks and more. With 1M context, its 552B backbone + 196B Engram parameters support SSD offloading to reduce RAM/VRAM needs. This guide shows how to run DeepSeek-V4.1 locally with Unsloth Dynamic V3.1 GGUFs which has 10-15% increased accuracy and 30% less token usage vs other quants of the same size.
Unsloth Desktop + llama.cpp enables ~3x faster DeepSeek-V4.1 inference than other CPU/VRAM/ngram repos. DeepSeek and runs locally on 128GB+ RAM setups or 64GB RAM (slower). UD-Q8_K_XL (lossless) is 508.4 GB, while UD-Q4_K_XL (near lossless) is 500.7 GB. GGUF: DeepSeek-V4.1-Flash-1017-GGUF
Dynamic V3.1 Update (November 2nd 2026)
We're releasing new DeepSeek-V4.1-Flash-1017 GGUFs which using our new Unsloth Dynamic V3.1 (preview) algorithm which improves Unsloth quants on nearly all benchmarks and is the best in class vs other providers.

If we benchmark ISTA's Coder model as well, we see the pruned Coder model does much worse on Agentic tasks - Aider Polyglot can get 47.6% accuracy vs 78.2% and is only 20% smaller in size. This partially means every 1% decrease in size is associscated with a ~1% decrease in accuracy.

We ran agentic benchmarks including Terminal Bench 2.1, DeepSWE v1.1, Automation Bench v1.0.6, Aider Polyglot, and general benchmarks like SciCode, HLE Diamond (text-only), LiveCodeBench v6, GPQA Diamond, MMLU-Pro, AIME25, IFEval, MATH-500 (Level 5), HMMT 2025, HMMT 2026. We addressed some issues people mentioned with these new benchmarks:
32K context was too short - we did 512K context for agentic + 128K for general tasks
Saturated benchmarks - new unsaturated agentic style ones including Terminal Bench, DeepSWE and Automation Bench
Benchmarks are noisy - we did 35.1B tokens of benchmarking vs 1.3B before so 27x more data. See Benchmark runs per model where we did 64x AIME 2025 runs, 3x DeepSWE, 3x TB runs and more.
Our graders are wrong - we used Math Verify, improved graders, used gpt-6-luna xhigh for HLE, and all official graders for Terminal Bench (Harbor), DeepSWE and the rest. See DeepSeek-V4.1-Flash and DeepSeek-V4.1-Flash
Full benchmark results are provided as well, with the first plot being a percentage accuracy recovery from the baseline and averaged across all 14 benchmarks (not weighted). This approximately is a metric of what each quant retains in accuracy vs the DeepSeek baseline.

We still cannot reproduce GSQ-RCO's recovery numbers
GSQ-RCO IQ1_M claims 98.7% recovery, but we measured 97.24 [96.23, 98.21] with a p-value of 0.0013 (statistically significant so extremly unlikely)
GSQ-RCO IQ2_XS retaining 100% claimed recovery is possible with a p-value of 0.21. We measured 98.38% [97.52, 99.22].
GSQ-RCO IQ2_XXS claims 99.80% recovery but we measured 98.38 [97.52, 99.22] with a p-value of 0.0001 (extremey significant).
The claimed recovery tested directly against our measurement (the card's definition: sum of the 3 scores / the base's sum, vs official FP8/FP4): p (no loss) = paired sign-flip permutation test of recovery = 100%; p (recovery >= claim) = one-sided paired bootstrap over questions.
GSQ-RCO IQ1_M
98.70
97.24 [96.23, 98.21]
0.00002
0.0013
GSQ-RCO IQ2_XXS
100.00
98.38 [97.52, 99.22]
0.0003
0.0001
GSQ-RCO IQ2_XS
99.80
99.54 [98.88, 100.18]
0.16
0.21
Claimed vs true recovery per benchmark, all against official FP8/FP4 (the card's baseline). Claimed = card score / card base; true = our mean over 12-64 samples per question / the official model's mean on the same questions, paired 95% bootstrap CI. p (true >= claim): one-sided paired bootstrap, the chance the true recovery reaches the claimed figure. p (no loss): two-sided paired permutation test of true recovery = 100% (each question's quant / official pair swapped at random). Unsloth quants (measured only) for reference at similar sizes.
AIME 2025 questions GSQ-RCO IQ1_M got wrong
GSQ-RCO IQ1_M scores 97.34% on AIME 2025 (51 wrong of 1,920 samples, 64 per question) and misses at least one sample on 15 of the 30 questions, so a 30/30 single run happens about 43% of the time. Every wrong answer is a genuinely wrong value (2 hit the 128K cap without a final answer). Other models' correct counts on the same questions for reference:
Q28 and Q22 are quantization damage (IQ1_M misses 8 and 6 of 64; GSQ IQ2_XS and the official model almost never do); Q15 and Q24 are hard for every model (UD-Q8_K_XL gets Q24 right 48/64, often answering 150 for 149).
Dynamic V3.1 Update (October 30th 2026)
We ran AIME25, Aider Polyglot, LiveCodeBench v6, HMMT 2026, GPQA Diamond, MMLU-Pro, IFEval and more across all our quants for UDv3 and UD3.1 vs the GSQ-RCO variants which claims to recover 100% on AIME25 for all quants, but we could not reproduce those numbers.
We provide a full average of 6 benchmarks (excluding Aider Polyglot - if you include Aider it's even more pronounced), and show UD3.1 does great across nearly all tasks.

We cannot reproduce GSQ-RCO's numbers

The GSQ-RCO DeepSeek-V4.1-Flash-1017 quants which are created by ISTA-DASLab mentioned they scored 100% on AIME25 for all quants - we could not reproduce this, and show on AIME25 across multiple runs and after you average them, GSQ-RCO retains 94.64% of the baseline (not 100%). We scaled all baseline numbers as well on the 2nd plot to account for methodology differences.


For AIME25 specifically ISTA reported 100% accuracy for all 3 quants, however when we tested it on AIME25 16 times per question for each quant: 30 problems * 16 samples = 480 answers per quant with temperature 1.0, reasoning effort 50, we see a clear degradation for quants, and not 100% accuracy at all bit widths.

The GSQ-RCO benchmarks are conducted with reasoning effort 50 as well as per the README.md
KLD is a reasonable metric
There are some recent claims that KLD is not a good metric. KL divergence (KLD) measures how far a quantized model's next-token predictions drift from a reference model's predictions on the same text.
The primary goal of quantization is to minimize KLD to 0, whilst also reducing the disk space of the quantized model (you can also include other items to optimize like generation speed for example).
If you have a KLD of 0, then the model has perfectly reconstructed the output logits, and so the quantized model creates 100% the same output as the original model.
You can see GSQ-RCO clearly having higher KLD and lower top-1% agreement vs even our old Unsloth v3 quants - v3.1 further improves it.

Some people say that KLD can be "gamed" or benchmaxed by cheating and running KLD on the test set, or using 1 dataset to run KLD on. To test this theory, we ran it across multiple held out tests, and show UDv3.1 does better than GSQ-RCO on all areas.

We also provide top-1% agreement for all held out tests as well:

Quantization increases reasoning lengths
We also tested if lower bit quants think for longer - we set all tests at a 32K context length and fail quants if they think for too long. We also ran Livecodebench for up to 128K tokens, and the results are similar. We provide the number of answers that are truncated across all 6 bechmarks, and show that Unsloth quants truncate much less than GSQ's quants (so we think less).

However this does show that quantization increases thinking reasoning lengths, so be prepared to have a higher reasoning budget for smaller bit quants.
Engram removal for benchmarks
We also removed the engram for graphing, but this does not change anything, as all low bit quants use IQ4_NL as the engram - Q2_K_XL and IQ2_XXS use Q5_K.

Full Benchmarking results
Full benchmarking methodologies
⚙️ Usage Guide
DeepSeek-V4.1-Flash-1017 pairs MoE with Engram conditional memory: n-grams of up to four tokens access a few table rows per token, so the table need not stay in GPU memory. It's best to use Unsloth for inference as it enables up to 3x faster DeepSeek-V4.1 inference than other CPU/VRAM/ngram-focused repos by optimizing ontop of llama.cpp.
1-bit UD-IQ1_S will work on 128GB RAM setups like a Macbook, DGX Spark or RTX Spark while 3-bit UD-IQ3_XXS will work on 256GB RAM setups like a Mac Studio.
Like the PLE / n-gram layers in our Qwen3.8-Flash-Next guide, Engram’s 110.6–202.8 GB table can stay on SSD via mmap. Rows load on demand into the OS cache, saving RAM/VRAM while retaining the full disk requirement.
DeepSeek-V4.1-Flash-1017 Requirements:
Table: Hardware requirements (RAM + VRAM, or unified memory; Engram on SSD).
128–145 GB
176–205 GB
256–290 GB
305 GB
315 GB
Estimates allow roughly 5–10 GB above non-Engram weights. Runtime and context can require more.
n-gram storage: Lookup formats and weight sizes appear below. Rest GB is the absolutely minimum amount of RAM/VRAM that is needed.
UD-IQ1_S
IQ4_NL / 110.6
122.4
UD-IQ1_M
IQ4_NL / 110.6
139.8
UD-IQ2_XXS
Q5_K / 135.2
165.3
UD-Q2_K_XL
Q5_K / 135.2
199.6
UD-IQ3_XXS
Q6_K / 161.3
233.5
UD-IQ3_S
Q6_K / 161.3
262.3
UD-Q3_K_XL
MXFP8 / 202.8
282.3
UD-Q4_K_XL
MXFP8 / 202.8
297.9
UD-Q8_K_XL
MXFP8 / 202.8
305.6
Recommended Settings
DeepSeek recommends temperature = 1.0, top-p = 1.0 and disabling top-k and min-p:
temperature
1.0
top_p
1.0
Maximum context window
1,048,576 tokens
DeepSeek recommends allowing at least 256K output tokens for its long-generation setup.
Thinking effort
Thinking is enabled by default, with reasoning_effort=75 (“high”). You can set an integer from 1 to 100. Higher values ask the model to reason more thoroughly; they are not a token limit. The included template also accepts low = 50, medium = 62, high = 75 and max = 100.
For example, add one of these options to your launch command:
Run DeepSeek-V4.1-Flash-1017 Tutorials:
For this tutorial, we use UD-Q2_K_XL. Unsloth automatically selects the near optimal DeepSeek-V4.1 offloading, ngram etc. configurations ensuring your setup gets the near best speed possible.
🦥 Unsloth Guide
Unsloth Desktop is our open-source UI for local AI on macOS, Windows and Linux. You can search and download GGUFs, configure CPU and GPU offloading, adjust inference settings and connect tools from one app.
Install Unsloth
The easiest way to get started is by downloading the Unsloth Desktop app. Works on macOS, Windows, and Linux.
Or, if you prefer to install manually:
Search and download DeepSeek-V4.1-Flash-1017
Go to Unsloth Chat or Model hub, search for DeepSeek-V4.1-Flash-1017 and select unsloth/DeepSeek-V4.1-Flash-1017-GGUF. Download your desired quant using the sizes and memory requirements above.
Run DeepSeek-V4.1-Flash-1017
Thinking is enabled by default with 75, you can change it in our toggle. Unsloth automatically selects the near optimal DeepSeek-V4.1 offloading, ngram etc. configurations ensuring your setup gets the near best speed possible.
For more information, you can view our Unsloth inference guide.
With UD-IQ1_S, the 233.0 GB download includes a 110.6 GB Engram n-gram table and 122.4 GB of other weights. Use Engram on-demand loading to keep the lookup table on SSD, with additional RAM/VRAM for cached rows, context and runtime buffers. Follow the Usage Guide above for memory requirements.
Serve DeepSeek-V4.1-Flash-1017 with Unsloth API
You can use unsloth run command and serve DeepSeek-V4.1-Flash-1017 via an API using llama-server runtime flags, including context sizing, GPU layers, threading, sampling, networking, and tool configuration. For more info see our API docs or unsloth start.
Use a runtime with DeepSeek-V4.1-1017 and Engram on-demand loading support. Apply the SSD-offload and memory settings from the Usage Guide when keeping the n-gram table on disk.
Unsloth is now ready
You can connect DeepSeek-V4.1-Flash-1017 to your tools through Unsloth Desktop. Unsloth also supports the following workflows:
Connect tools: Claude Code, Codex, web search, MCP and more
Train models: Fine-tune other supported text, diffusion, embedding, and more

🦙 Run DeepSeek-V4.1-Flash in llama.cpp
We need to use our specific llama.cpp PR here. You can follow the build instructions below as well. Change -DGGML_CUDA=ON to -DGGML_CUDA=OFF if you don't have a GPU or just want CPU inference. For Apple Mac / Metal devices, set -DGGML_CUDA=OFF then continue as usual - Metal support is on by default.
To run the model, you can do:
Keep all seven shards in the same folder and point --model at the first shard. llama.cpp loads the remaining shards automatically.
Then to run it:
This example loads the Engram n-gram table from SSD on demand. Keep --load-mode mmap and --lazy-mode on enabled for SSD offloading.
⚡DSpark - Speculative Decoding
DeepSeek-V4.1 includes DSpark, a speculative decoding architecture that proposes multiple tokens before the main model verifies them. It is separate from the Engram n-gram lookup table: Engram supplies learned memory; DSpark accelerates decoding. The similarly named n-gram speculative decoding option is also a different feature.
For DSpark, pair the main model with a matching V4.1-1017 drafter and a runtime with DSpark support. Keep the drafter and main checkpoint versions matched, and reserve extra memory for the drafter. The CLI and server examples in this guide use ordinary decoding.
DSpark enables inference for DeepSeek-V4.1-Flash-GGUF to be around 1.3 to 1.5x faster for decoding!
We provide a Q8_0 DSpark module at 8GB, and a full BF16 at 8.5GB.
🏁Mix n matching the engram
You can also change the engram precision for DeepSeek-V4.1 to whatever you desire.
MXFP8 (original)
202.8 GB
Q6_K
161.3 GB
Q5_K
135.2 GB
IQ4_NL
110.6 GB
For example after downloading the dynamic 1-bit quant IQ1_S which uses by default the IQ4_NL engram, you can switch it out for the MXFP8 one by only downloading the MXFP8 engram at https://huggingface.co/unsloth/DeepSeek-V4.1-Flash-1017-GGUF/tree/main/engram called DeepSeek-V4.1-Flash-1017-engram-MXFP8.gguf_file To do this, follow the script below:
📊 Benchmarks
📊 Quantization Analysis

Results compare against DeepSeek’s official reference on wiki1100 and long17k. Lower KL means closer next-token probabilities; higher top-1 means more matching predictions.
DeepSeek mixes MXFP4, FP8 and BF16. Q4 and Q8 retain MXFP4 experts and the same Engram table; their labels do not describe every tensor’s precision. Q4 stores many non-expert weights in Q8_0; Q8 uses BF16.
We also show when we change the engram precision from IQ4_NL to Q5_K to Q6_K and MXFP8 and we provide standalone engrams which allow you to mix n match.
Choosing a quant: IQ1_S saves about 54% disk space versus Q8. IQ1_M adds 17.4 GB and improves top-1 agreement by 4.3 points on wiki1100 and 3.1 on long17k. IQ3 variants reach 94.6–96.8% agreement.
GGUF KLD and Top-1% Benchmarks
Our quants span 82.8–98.5% top-1 agreement against the official F32 reference on wiki1100 and 85.1–98.7% on long17k. UD-Q4_K_XL saves 7.7 GB compared with UD-Q8_K_XL, with an agreement gap of 0.3 percentage points on wiki1100 and 0.2 on long17k. Q8 also has lower KL divergence on both sets.
We also alter the engram table precision from IQ4_NL to Q5_K, Q6_K and MXFP8, and show how KLD gets affected

Official Benchmarks
DeepSeek reports the following results for V4.1-Flash-1017 compared with the previous V4.1-Flash release. These are official model results, not measurements of the GGUFs in this guide. Source: DeepSeek’s 1017 model card.
HLE without tools
42.6 (44.0†)
36.8 (39.1†)
Terminal-Bench 4.0
42.3
31.2
DeepSWE v1.1
77.0
74.2
ProgramBench
29.1
20.3
NL2Repo-Bench
68.2
65.4
Automation-Bench v1.0.6
60.5
54.8
Agents’ Last Exam
35.4
31.8
Apex Bench v1.1
72.1
64.6
Chartography (with tools)
83.0
78.9
BabyVision (with tools)
92.5
89.6
ZeroBench-main (with tools)
51.0
49.0
† Text-only subset of HLE. DeepSeek uses the Claude Code harness for Terminal-Bench 4.0 and Mini-SWE-V2 for DeepSWE v1.1. Scores depend on the evaluation setup, reasoning effort and context budget.
GGUF Benchmark Breakdown
Graders:
Infrastructure and benchmark issues and fixes:
DeepSWE setup for benchmarks:
Terminal Bench setup for benchmarks:
Excluded Terminal Bench tasks due to issues:
Benchmark runs per model
We ran multiple runs to be fair - Terminal bench, DeepSWE 3x per quant. AIME 2025 64x per quant. LiveCodeBench 12x per quant and more. Some trials had to be re-run to fix infrastructure related issues (timeouts, CPU overload etc) - otherwise it'll be a fail - these only account for a few questions overall.
Last updated
Was this helpful?

