localairecipes launch configs for local inference

DeepSeek-V4.1-Flash-1017 Fidelity-First 4x CMP 170HX alanoo81

00 upvotes — sign in to vote sign in to vote

community Community submission — verify on your own hardware.

recipe by alanoo81 (recipe, graft, measurements)↗, GNmac-lab (base recipe 1.2.0 @ 2ad5741ab1, MIT)↗, LibertAIDAI (EXL3 2.9bpw @ 0be63c33 / 3.5bpw @ 04a492fc)↗, Curtis White (hybrid layout + quantization_config.json)↗, vcruz305/vllm-exl3 (AGPL-3.0-only, inside the built image)↗, Morrowmake 1.0.1 CMP170HX engine (vllm_sm80 plugin 0b34823c)↗ · listed by localai-recipes

revision r3 · commit 0740456f1a · updated 2 d ago · license MIT (recipe); engine image contains AGPL-3.0-only vllm-exl3

chat code vision sm80 prefix-caching community-recipe hybrid-checkpoint long-context fidelity-first fp8-kv exl3 tp4 engram-ram

DeepSeek-V4.1-Flash-1017 (748B MoE) on 4x CMP 170HX (sm_80, 64 GB each, PCIe Gen2 x16), TP4, as a fidelity-first variant of the GNmac-lab recipe 1.2.0 @ 2ad5741ab1 with four changes: routed experts of layers 18-22 grafted 2-bit to 3-bit (LibertAIDAI EXL3 3.5bpw shards 00020-00024-of-00044 into the 2.9bpw pack, all 40 layers 3-bit); no DSpark drafter (SPEC_TOKENS=0, frees ~2.8 GiB/card for KV); Engram tables genuinely loaded (ENGRAM_STORAGE=ssd from a 200 GiB RAM tmpfs); gpu_memory_utilization 0.98, KV pool 2,717,420 tokens at 262,144 context. Author-measured: 300/300 exact identifier copies, byte-identical repeats; perplexity -1.80% overall / -4.45% French vs the 2.9bpw pack (95% CIs exclude zero); ~105 tok/s decode c1, 449-560 tok/s aggregate c8; cold prefill 2,514 tok/s median. Documents a silent failure: leaving DSV41_ENGRAM_STORAGE unset (host mode) leaves the Engram tables unfilled - layers 1 and 14 act as identity functions, 15/20 copies, temp-0 output drift, no error.

Launch command

'docker run -d --name ds41-flash --device nvidia.com/gpu=all --ipc=host --cap-add SYS_NICE' '--ulimit memlock=-1 --ulimit stack=67108864' '-v <MODELS_DIR>:/models:ro -v /opt/engram-ram/DeepSeek-V4.1-Flash-1017-engram:/engram:ro' '-v <CACHE_DIR>/root-cache:/root/.cache -v <CACHE_DIR>/triton:/root/.triton -v <CACHE_DIR>/tilelang:/root/.tilelang' '-p 127.0.0.1:8011:8011' '-e VLLM_PLUGINS=vllm_exl3 -e VLLM_ENGINE_READY_TIMEOUT_S=3600 -e VLLM_EXL3_MODEL_DIR=/models/DeepSeek-V4.1-Flash-1017-hybrid' '-e VLLM_USE_V2_MODEL_RUNNER=0 -e DSV41_DSPARK_V1=1 -e VLLM_EXL3_COOP=1' '-e VLLM_EXL3_TC_MOE_V2=1 -e VLLM_EXL3_TC_MOE_PREFILL=1 -e VLLM_EXL3_TC_PREFILL_ROWS=2048' '-e VLLM_EXL3_TC_MOE_SO=/opt/dsv41-tc-moe/_dsv41_tc_moe_C.abi3.so -e VLLM_EXL3_TC_HOOK=/opt/dsv41-tc-moe/exl3_tc_hook.py' '-e VLLM_EXL3_MOE_TP_ALIGN=128 -e VLLM_EXL3_MOE_TP_ROTATE=1' '-e NCCL_CUMEM_ENABLE=0 -e NCCL_CUMEM_HOST_ENABLE=0 -e NCCL_P2P_LEVEL=SYS -e VLLM_ALLREDUCE_USE_FLASHINFER_PCIE_IPC=1' '-e DSV41_ENGRAM_DIR=/engram -e DSV41_ENGRAM_STORAGE=ssd' '-e DSV41_EXPERTS_ONLY_FILES_RE=^model-[0-9]+-of-000(43|44|39)\.safetensors$' '-e TORCH_CUDA_ARCH_LIST=8.0 -e TORCHINDUCTOR_CACHE_DIR=/root/.cache/inductor' '-e VLLM_DSV41_DECODE_SPLITK=1 -e DSV41_SHARED_HEAVY_BLOCKS=1 -e DSV41_DRAFT_HEAD_FP8=1' '-e DSV41_PREFILL_CHUNK_REQS=1 -e DSV41_INDEXER_BUF_MULT=4 -e VLLM_EXL3_FAT_THRESHOLD=2048' '--entrypoint vllm ds41-cmp170hx:1.2.0-fidelity serve /models/DeepSeek-V4.1-Flash-1017-hybrid' '--quantization exl3 --load-format safetensors --safetensors-load-strategy lazy' '--tensor-parallel-size 4 --pipeline-parallel-size 1' '--served-model-name deepseek-v4.1-flash --host 0.0.0.0 --port 8011' '--max-model-len 262144 --max-num-seqs 8 --max-num-batched-tokens 2048 --gpu-memory-utilization 0.98' '--kv-cache-dtype fp8_ds_mla --enable-prefix-caching' '--compilation-config {"cudagraph_mode": "FULL_AND_PIECEWISE", "cudagraph_capture_sizes": [1,2,3,4,5,6,8,12,16,18,20,24,28,30,32,36,42,48]}' --async-scheduling '--tokenizer-mode deepseek_v41 --enable-auto-tool-choice --tool-call-parser deepseek_v41 --reasoning-parser deepseek_v41' --enable-prompt-tokens-details

env

P2P: 1
BIND: 127.0.0.1
PORT: 8011
IMAGE: 'ds41-cmp170hx:1.2.0-fidelity'
LAYOUT: tp4
EXTRA_ARGS: '--enable-prompt-tokens-details'
SPEC_TOKENS: 0
MAX_NUM_SEQS: 8
MAX_MODEL_LEN: 262144
ENGRAM_STORAGE: ssd
ENGRAM_HOST_DIR: /opt/engram-ram/DeepSeek-V4.1-Flash-1017-engram
GPU_MEMORY_UTILIZATION: 0.98
VLLM_EXL3_FAT_THRESHOLD: 2048

runtime

notes: "Patched serve.sh: SPEC_TOKENS=0 drops --speculative-config entirely (no DSpark drafter, no DSV41_DYNK); ENGRAM_HOST_DIR mounted read-only at /engram with DSV41_ENGRAM_STORAGE=ssd; start.sh runs engram-ram.sh first when ENGRAM_HOST_DIR is under /opt/engram-ram/ (tmpfs ENGRAM_TMPFS_SIZE=200G, copy ~94 s from NVMe). API has no auth by default - bind stays 127.0.0.1 until EXTRA_ARGS carries --api-key. Startup log must show 'Built engram token map (129280 -> 99092 ids) for layers (1, 14)' per rank and NO 'offloaded to pinned' line; 'GPU KV cache size: 2,717,420 tokens' at 0.98 (2,417,392 at 0.97, 1,817,233 at 0.95). Graft build: tools/make_hybrid_graft.py k3 = 188,241 tensors, 23,040 grafted at 3 bits, 88 links. SECOND, OPT-IN ENGINE LANE at repo pin 2009574b3299 (NOT part of the launch above, which stays the GNmac 1.2.0 build and owns every perf point on this record): Morrowmake 1.0.1 (image ghcr.io/morrowmake/vllm-cmp170hx@sha256:32ae8b0e..., plugin vllm_sm80 0b34823c, Apache-2.0) plus the author's compact KV cache. morrowmake/compact-kv/build-overlay.sh extracts and patches 7 engine files from the pinned image and start.sh.patch mounts them read-only over it (sm80_kv_pack.py added); inert unless the env sets VLLM_SM80_COMPACT_KV=1. Launchers: start-dspark.sh (DSpark on, ~1.47M-token pool) and start-nospec.sh (no drafter, ~3.09M). The author reports prompt log-probabilities bit-identical to Morrowmake's BF16 rows over ~1.39M tokens, at 2-5% decode and 6-10% prefill cost, KV pool x1.99; the compact-cache timings were measured on 1.0.0 and not repeated on 1.0.1. All of that is self-measured on the author's own harness, so it is carried as author-claimed, never as a site-measured fact. The repo's new bench rows (m101-*, mm-*, gnmac-dspark) come from different stacks (Morrowmake engine and/or DSpark enabled) and are deliberately NOT published as site perf points against this GNmac no-drafter configuration."

Use this recipe with your agent

Paste this into any agent chat — it fetches and applies the recipe:

Fetch https://localairecipes.com/api/v1/recipes/deepseek-v4-1-flash-1017-fidelity-first-4x-cmp-170hx-alanoo81.json and apply the inference recipe it describes (engine flags, model, quant, context) to my setup. Ask before overwriting any existing config.

Or fetch it directly:

curl -fsSL https://localairecipes.com/api/v1/recipes/deepseek-v4-1-flash-1017-fidelity-first-4x-cmp-170hx-alanoo81.json

Engine

Install note: Published lane: GNmac 1.2.0. Image ds41-cmp170hx:1.2.0-fidelity = GNmac-lab 1.2.0 @ 2ad5741ab1 via docker/build.sh (patches do not touch the Dockerfile; 17.8 GB). Clone GNmac-lab/deepseek-v41-flash-1017-cmp170hx @ 2ad5741ab1, apply recipe/*.patch with patch -p1, copy recipe/tools/*, recipe/engram-ram.sh and recipe/env.example (as .env), run tools/download-pinned.sh (~428 GiB pinned), tools/make_hybrid_graft.py <MODELS_DIR> DeepSeek-V4.1-Flash-1017-hybrid k3, then ./start.sh (engram-ram.sh then serve.sh; ~10 min kernel compile). CDI (--device nvidia.com/gpu=all); driver 610.43.02 (cmpunlocker fork + P2P patch). SECOND, OPT-IN lane at 2009574: Morrowmake 1.0.1 + the author's compact KV cache (VLLM_SM80_COMPACT_KV=1; 7 engine files patched, mounted over image sha256:32ae8b0e..., built separately). Author claims bit-identical caches vs BF16, 2-5% slower decode. WARNING: the image carries AGPL-3.0-only vllm-exl3 code; serving it over a network triggers AGPL-3.0 s.13 - see NOTICE.md.

Model

Context

  • max context: 256K tokens

KV pool

  • 2,717,420 tokens across concurrent requests

Performance

Speed by context

ContextConc.PrefillDecodeTTFT
32,768—2514 tok/s——reported
262,1441—105.4 tok/s—reported
262,1442—174.3 tok/s—reported
262,1444—325.2 tok/s—reported
262,1448—505 tok/s—reported
272,3841—105 tok/s—reported
272,3848—482.4 tok/s—reported
282,6241—104.8 tok/s—reported
282,6248—449.2 tok/s—reported

prefill = prompt processing · decode = generation. All decode/prefill figures are shown as reported.

reported

notesclaimed_by=submitter T0 - the author's own harness (docs/results.md @ da967740; MiaAI-Lab decode protocol: temp 0, thinking off, 400-token cap; cold prefill = median of 9 runs of texts ~24k/34k/38k tokens, no cache hits). The speed table was measured at gpu_memory_utilization 0.95 (changes the KV pool size, not the kernels); production runs at 0.98. Cards 200 W, 170tune +200 MHz. Fidelity (paired NLL, 64 x 1,024-token windows per set): perplexity vs the published 2.9bpw pack -1.80% all [-2.00,-1.60], -4.45% French [-4.97,-3.93] (64/64 better), -0.70% English, -0.18% code; copy test 300/300 exact (100 lists x 40 ids x 3 passes), repeats byte-identical; A-B-A restart check bit-identical prompt logprobs on 192 long windows. Stress: 2 waves of 8 unique 100k prompts, 16/16; peak 63,580/64,911 MiB usable per card at 0.98 (~1.3 GiB left); prompt_logprobs on 1,024-token windows peaks 64,676 MiB (~0.23 GiB) - use 0.97 (2,417,392 tokens) or <=512-token windows for that workload. UPDATE 2026-10-31: a 2,001-token prompt_logprobs request is CUDA OOM on GPU 0 (~1 GiB requested) and KILLS the engine, which then stays down (no restart policy) - so the 1,024-token-window guidance below is the safe workload and a 2K-token scoring window is not. HumanEval/GSM8K on 2026-10-30 (docs/comparison-morrowmake.md 0.4): 157-158/164 and 1,277-1,280/1,319 over two runs, statistically inseparable from Morrowmake 1.0.0 on the same machine.

Downloads

Revision notes

Community ingest by localai-recipes from alanoo81's repo @ da967740 (single commit, verified live 2026-10-30; HEAD at sweep == HEAD at ingest). Recipe by alanoo81 - a fidelity-first variant of GNmac-lab 1.2.0 @ 2ad5741ab1 with four changes (3-bit graft layers 18-22, no DSpark, Engram genuinely loaded, 0.98). KEY FINDING (silent-failure disclosure, the most valuable part of this recipe): DSV41_ENGRAM_STORAGE unset / host mode fails SILENTLY. The stack reserves 2 x 23.6 GiB pinned per rank but never fills it; the hybrid index contains only the small Engram tensors (q, k, wkv), not engram.embed.*; vLLM skips its missing-weights check when a quantization method is set. Symptoms: 15/20 exact copies, identifiers with dropped _ separators, output changing between runs at temperature 0 - no error, and decode speed is unchanged, so benchmarks do not catch it. The upstream author never tested host mode; the documented path is ssd. Startup log data/logs/01-first-start-engram-NOT-loaded.txt; those benchmarks kept as data/bench/INVALID-no-engram*. Fix: ENGRAM_STORAGE=ssd reading a 200 GiB tmpfs (2 x ~101.5 GB shards, ~189 GiB); after the fix copy test 20/20 then 100/100 x 3 passes, byte-identical repeats. NOT a dupe: distinct launch from all three existing DS41 4x-170HX recipes (GNmac EXL3 2.9bpw TC-MoE, Morrowmake hybrid, EXL3 3bpw TC-MoE) - English/French documented, no drafter, RAM-tmpfs Engram, 3-bit graft at 0.98. License: repo MIT (LICENSE 1,065 B); the built engine image contains AGPL-3.0-only vllm-exl3 code per NOTICE.md - do not claim the image is MIT. All perf/fidelity numbers author-reported (T0). corrections_to_card: none - README 17,317 B + README.fr.md, NOTICE.md 5,759 B, MIT LICENSE, HEAD, and every quoted figure match the repo at the pin; the c8 speed rows published per-suite (559.7/482.4/449.2) and the card's 505 aggregate mid-range are both carried (505 as the aggregate headline with the published range 449-560 in notes). UPDATE 2026-10-31 (repo @ 7615d9e): A-B-A on the SAME machine (4x CMP 170HX 200 W, cmpunlocker driver + P2P patch, no TRAP31, EPYC 7F52, 512 GB), both stacks, same tools, frozen windows, fresh server each. Supersedes the earlier inferences. To 1,024 tokens the two ENGINES score equal within 0.3%; ours is better by ~2% overall (5% French) because of its WEIGHTS (layers 18-22 at 3 bits), NOT its engine. Ours bit-identical across A1/A2 and to k3-098 (zero noise floor). Self-check |decode-prefill| logprob 0.0205 vs 0.0476; prefill-argmax mismatch 1.2% vs 3.9% (internal consistency only). HumanEval/164 157/158 vs 153 (p 0.22); GSM8K/1,319 1,277/1,280 vs 1,271 (p 0.11): these do NOT separate the stacks - the gap is our own noise (11 GSM8K differ at temp 0). Long contexts and speed NOT measured. CORRECTED CRASH FINDING: prompt_logprobs on a 2,001-token prompt is CUDA OOM on GPU 0 (~1 GiB requested) and the ENGINE DIES; the server has no restart policy, so it STAYS DOWN. The earlier advice to use 0.97 with 1,024-token windows is narrowed accordingly - the 1,024-token NLL windows (peaking ~0.23 GiB) are explicitly NOT the failing case. Harness changes shipped alongside: recipe/quality.py.patch adds QUALITY_API_KEY auth so GNmac's bench/quality.py can reach a key-protected server, tests/nll_eval.py gains the same path; raw run files under data/nll/ and data/quality/. UPDATE 2026-11-06 (repo @ 2009574b3299): the repo now ALSO ships an OPT-IN second engine lane - Morrowmake 1.0.1 (image sha256:32ae8b0e..., plugin vllm_sm80 0b34823c) + the author's compact KV cache, on only when VLLM_SM80_COMPACT_KV=1. NOT a replacement: the published launch and every perf point here remain the GNmac 1.2.0 engine, unchanged. Author reports bit-identical caches vs BF16 over ~1.39M tokens at 2-5% decode cost - author-measured, never site-measured. No new perf points added (different stacks). The 2026-10-31 A-B-A above is condensed for the notes cap with every published figure kept; its crash finding and narrowed advice are unchanged.

Revision history

Fork

Sign in to fork this recipe — a fork is your own copy; you own it and only you can update it.

Export

recipe.yaml (raw)