cd /news/ai-infrastructure/run-deepseek-v4-1-1017-flash-2-bit-o… Β· home β€Ί topics β€Ί ai-infrastructure β€Ί article
[ARTICLE Β· art-178306] src=github.com β†— pub= topic=ai-infrastructure verified=true sentiment=↑ positive

Run DeepSeek v4.1 1017 Flash(2-bit) on a single 80GB VRAM GPU at 100 tok/s

A published recipe runs DeepSeek-V4.1-Flash-1017, a 748B-parameter model, as a local coding agent on a single H100 80GB GPU with about 230GB of host RAM using a 392.9GB 2-bit GGUF (routed experts in Q2_K) and two llama.cpp patches on Unsloth's fork release b12823-mix-034de92. The patches lifted pooled decode from 107.0 to 114.5 tok/s (+7.0%) on a 60-task coding gate at 64k context, with 59 of 60 tasks faster and all 60 outputs identical, while the 110-task run measured median decode of 102.9 tok/s for coding and 90.3 tok/s for agent turns. The recipe keeps all routed experts in host RAM, caches the most-used experts in free GPU memory (--moe-cache-mib 55000), runs cache misses on CPU 80% of the time, and leaves the 202.8GB n-gram table on disk; setting -t to all 26 vCPUs collapsed decode to under 3 tok/s.

recommendation

Pin MoE experts in host RAM and cache the hottest in free GPU VRAM, but set decode threads to physical cores only; on this box -t 26 fell below 3 tok/s while -t 13 held 114.5 tok/s.

more in playbook: Inference and self-hosting
read4 min views3 publishedNov 29, 2026
Run DeepSeek v4.1 1017 Flash(2-bit) on a single 80GB VRAM GPU at 100 tok/s
Image: Michielbdejong (auto-discovered)

A recipe for running DeepSeek-V4.1-Flash-1017 (748B parameters) as a local coding-agent model on one H100 80 GB with about 230 GB of host RAM, using a 2-bit GGUF and two small llama.cpp patches.

bash scripts/build_llama_h100.sh ./llama_build_h100          # downloads the fork's source (sha256-checked), applies both patches, builds for sm_90

MODEL_PATH=/models/DeepSeek-V4.1-Flash-1017-Tensward-Coding-2bit-00001-of-00009.gguf \
DSPARK_PATH=/models/dspark-DeepSeek-V4.1-Flash-1017-Q8_0.gguf \
bash scripts/serve_coding_64k.sh                             # Recipe 1: one user, 64k context, OpenAI-compatible API on 127.0.0.1:8080

Before the first start, once as root: echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag. Put the model on local NVMe if you have it. configs/opencode.json points OpenCode at the server. For non-thinking replies, send "chat_template_kwargs": {"enable_thinking": false}.

All routed experts stay in host RAM (-ot ...ffn_.*_exps=CPU, -lm none so they are pinned rather than memory-mapped), and the free GPU memory becomes a cache of the most-used experts (--moe-cache-mib 55000). Experts that miss the cache run on the CPU 80% of the time (--moe-cache-cpu-share 0.80) instead of being copied over PCIe. The 202.8 GB n-gram table stays on disk and is read lazily. Decode threads are the physical cores (-t 13); prefill uses more (-tb 24). Do not set -t to all vCPUs: on our box -t 26 (all 26 vCPUs) made decode collapse to under 3 tok/s.

Both are off unless their environment variable is set; the serve scripts set them.

  • 01_decode_fast.patch (LLAMA_DECODE_FAST=1). Less CPU work per token in the expert cache's CPU path: rows the GPU cache already served are skipped instead of quantised and zero-filled on one thread, the expert ids are read back through pinned memory, and one scheduler wait is skipped when the cache's own copy step has already synchronised.
  • 02_spec_max_concurrency.patch (LLAMA_SPEC_MAX_CONCURRENCY=2). Switches the draft model off while more than N requests are generating and back on when the load drops. With several users, drafting multiplies the batch size and pushes the expert cache out of its fast path.

Hardware: GCP a3-highgpu-1g, H100 80 GB (host link PCIe Gen4 x16), Xeon Platinum 8481C (13 cores, 26 vCPUs), 230 GiB RAM, 2 x 375 GB local NVMe.

Answers. We ran this recipe, built with the scripts in this folder, on 110 tasks we wrote for the test (none from public benchmarks: coding with hidden tests, multi-turn agent repairs with real tool execution, 30k-54k-token long context, tool calls), against the same model on two FP8 API providers. No quality loss was readable at this size (details and limits on the model card). The patched build's 997 responses were byte-identical to the unpatched build's.

Single user (Recipe 1). "Patches off" is the patched binary with LLAMA_DECODE_FAST=0 on the gate and 7.2k rows, and an unpatched build in our 110-task run; the 7.2k row is three restarts per arm, the others one run each:

Patches off Patches on
60-task coding gate at 64k context, pooled decode 107.0 tok/s 114.5 tok/s (+7.0%; 59 of 60 tasks faster, all 60 outputs identical)
Our 110-task run, median decode: coding / agent turns 98.7 / 90.0 tok/s 102.9 / 90.3 tok/s
Prefill, 53k-token prompts (our run) about 680 tok/s about 650 tok/s
Prefill, 7.2k-token prompt ( -ub 4096 ) 662-691 tok/s 662-691 tok/s (1.3% lower on average)

Draft acceptance on the gate: 91.4%; expert cache hit rate: 86.8%; GPU memory at the end of the run: 77.2 GiB.

Prompt cache. With --cache-ram 8192, a follow-up turn after another request had evicted the slot started in 0.30 s instead of 13.4 s at 8k tokens, and 0.39 s instead of 44.0 s at 32k (one trial each, on an earlier experimental build that also carried other patches).

Several users. Auto-flip against always-on drafting, same binary and box, one session each, -np 8 -c 16384 -kvu, 56,000 MiB expert cache, --cache-ram 0:

Concurrent requests Always-on drafting Auto-flip
4 73.7 tok/s 119.2 tok/s
8 42.4 tok/s 146.5 tok/s

No draft tokens were wasted during bursts, and single-request speed after a burst stayed within the burst-to-burst spread (81.0 vs 86.1 tok/s).

Recipe 2 (scripts/serve_team_multistream.sh: no draft, 63 GiB cache, -np 8) reached 165.3 tok/s decode at 8 concurrent requests and 61.3 at 1 (one session). At 4 concurrent requests 2 of 3 bursts collapsed to about 54 tok/s, because idle and busy slots interleave and the server stops reusing its decode graph; CACHE_RAM_MIB=0 should avoid it at the cost of the RAM prompt cache (not tested on this recipe). We are working on a fix.

Without the recipe. The default memory-mapped load with -ub 512 prefilled a 7.2k-token prompt at 64.3 tok/s; -lm none alone made that 170.4 tok/s, and the full recipe reaches 662-691.

── more in #ai-infrastructure 4 stories Β· sorted by recency
── more on @deepseek 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/run-deepseek-v4-1-10…] indexed:0 read:4min 2026-11-29 Β· β€”