DeepSeek-V4.1-Flash-1017 Fidelity-First 4x CMP 170HX alanoo81
00 upvotes — sign in to vote sign in to votecommunity 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)↗ · listed by localai-recipes
Initial version · updated 21 h ago · license MIT (recipe); engine image contains AGPL-3.0-only vllm-exl3
chat code vision fp8-kv long-context exl3 sm80 tp4 prefix-caching community-recipe hybrid-checkpoint engram-ram fidelity-first
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-detailsenv
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."
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.jsonDownloads
- Weights https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017official FP8 1017 @ 1bae0e1088993b9b82de08f59de5be5a34e42170 - non-expert tensors + Engram shards 00047/00048-of-00048
- Weights https://huggingface.co/LibertAIDAI/DeepSeek-V4.1-Flash-1017-EXL3-2.9bpwEXL3 2.9bpw routed experts @ 0be63c3337efbb2a0061d5b8bb4006fa186d433f
- Weights https://huggingface.co/LibertAIDAI/DeepSeek-V4.1-Flash-1017-EXL3-3.5bpwEXL3 3.5bpw @ 04a492fc3b4d25ddbab8f2d2f07f235ec77c9010 - shards 00020-00024-of-00044 grafted into layers 18-22
- Reference https://github.com/alanoo81/deepseek-v41-flash-4x-cmp170hxda96774006515269bcf9eebfdc993874b59df1ba (patches, scripts, tests, raw measurement data; no weights, no engine code)
- Reference https://github.com/GNmac-lab/deepseek-v41-flash-1017-cmp170hx2ad5741ab1a278d64f33b842706a41717dfbf181 (base recipe release 1.2.0, image + kernels + benchmarks)
- Reference https://github.com/CurtisAccelerate/DeepSeekv41-Flash-1017-EXL3-CMP170HXb8b9e99 - hybrid layout + quantization_config.json (Curtis White)
Revision notes
Initial version.
Revision history
Initial version.
Fork
Sign in to fork this recipe — a fork is your own copy; you own it and only you can update it.