localairecipes launch configs for local inference

DeepSeek-V4.1-Flash-1017 SAGE EXL3 1.62bpw 1x DGX Spark DSpark

00 upvotes — sign in to vote sign in to vote

community Community submission — verify on your own hardware.

recipe by vcruz305 (recipe author, SAGE quant, packs, measurements, MIT)↗, Christopher Owen (spark-ds41f r6w base image, upstreams pinned at 2dc95329)↗, vcruz305/exllamav3 feat/moe-warp-private-stages @ 909ad8564c - mixed-K unified MoE + warp-private pipeline stages↗, vcruz305/vllm-exl3 feat/dsv41-1017-tp1 @ 30e8b94137 - Exl3MoEMethod / ATS loader↗, AgentSparko (REXL3 overlay path used by the sibling 1.55bpw pack)↗, deepseek-ai/DeepSeek-V4.1-Flash-1017 - upstream weights (MIT)↗ · listed by localai-recipes

Initial version · updated 9 h ago · license MIT

chat code dspark exl3 speculative engram-nvme tp1 tilelang cold-expert-alias

DeepSeek-V4.1-Flash-1017 at 1.62 bpw (SAGE MixedK EXL3 routed experts, EXL3 MTP draft experts, EXL3 K8 output head, block-32 FP8 non-routed linears) served on one NVIDIA DGX Spark (GB10, 121.7 GiB unified). The full pack does not fit, so the 1,418 least-routed experts plus the embedding are gathered into an 8.59 GiB read-only cold-expert alias side file while every hot expert stays device-resident; the ~111 GB Engram n-gram tables are streamed from NVMe. vLLM TP1 with TileLang attention/linear/MoE kernels, DSpark spec decode k=5, 524,288-token window, 1 GiB KV pool (959,768 tokens), armed memory guard. Author-measured on the serving build: 35.1 tok/s mean decode at 1 request (137.4 ms/step, 4.73 accepted tok/step), ~720 tok/s real-text prefill, 3 min 11 s to API-ready, 2.9-3.2 GiB MemAvailable at 524K. recipe by vcruz305.

Launch command

'bash packs/1.62bpw/scripts/download_and_verify.sh (hf_xet download of vcruz305/DSV4.1-Flash-1017-SAGE-EXL3-1.62bpw @ c852150e06f5... + sha256 verify vs packs/1.62bpw/scripts/SHA256SUMS - the SUMS file is the authority, the pinned revision may stop resolving); bash scripts/build_image.sh; bash packs/1.62bpw/scripts/build_cold_alias.sh (8.59 GiB read-only side file, ~10-20 s)' 'bash packs/1.62bpw/scripts/serve.sh: host wrapper - sets vm.compaction_proactiveness=0 vm.watermark_boost_factor=0 vm.swappiness=0, swapoff/swapon, drop_caches, refuses a stale alias manifest (serve.sh compares ALIAS_DIR/manifest.json against configs/cold-alias-selection.json) or an image whose build labels do not match the pins (PLUGIN_REF 30e8b941376c, FORK_REF 909ad8564fcb, MOE_TILESIZE_K=16), then runs the docker command below and arms scripts/guard.sh. DRY_RUN=1 prints the plan.' 'Env knobs of the measured run (scripts/env.sh defaults): CONTAINER=dsv41-tp1 API_PORT=8000 SERVED_MODEL_NAME=dsv41 MAXLEN=524288 KVB=1073741824 MNBT=2112 LPT=2047 MTP_K=5 CG_MODE=FULL_DECODE_ONLY CAPTURE_SIZES=1,2,3,4,5,6,7 PREFIX_CACHING=1 DEFAULT_MAX_TOKENS=32768 DEFAULT_TEMPERATURE=0.6 DEFAULT_TOP_P=0.95 ALIAS_DIR=$HOME/.cache/dsv41-ds41f/alias-cold MOE_TILESIZE_K=16' 'sudo -n docker run -d --name dsv41-tp1 --gpus all --memory=118g --memory-swap=118g --oom-score-adj 1000 --ulimit core=0 --shm-size=2g --security-opt=seccomp=unconfined --security-opt=label=disable --ulimit=memlock=-1:-1 -v $HOME/models:/models:ro -v $HOME/.cache/dsv41-ds41f:/cache:rw -v $HOME/.cache/dsv41-ds41f/alias-cold:/alias:ro -v <RUN>/ctr:/mem:rw -v packs/1.62bpw/scripts/serve_inner.sh:/root/serve.sh:ro -p 8000:8000 --entrypoint /bin/bash dsv41-1017-exl3:r6w /root/serve.sh' 'container env: HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 B12X_AUTOTUNE=0 B12X_BIND_COMPILE_WORKERS=2 B12X_STATE_COMPILE_WORKERS=2 B12X_WEIGHTS_COMPILE_WORKERS=4 B12X_DENSE_SPLITK_TURBO=1 B12X_W4A8_TINY_DECODE=0 CUDA_DEVICE_MAX_CONNECTIONS=32 VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 VLLM_USE_FLASHINFER_SAMPLER=1 VLLM_ENGINE_READY_TIMEOUT_S=3600 VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=900' 'container env (EXL3/ATS): VLLM_EXL3_MOE_KERNEL=exllamav3 VLLM_EXL3_V41_NATIVE_MOE=0 VLLM_EXL3_MIXEDK_LEGACY=1 VLLM_EXL3_MIXEDK_MODE=unified VLLM_EXL3_TRIM_AFTER_LAYER=1 VLLM_EXL3_MODEL_DIR=/models/dsv41-1.62bpw-v3 VLLM_EXL3_ATS_ALIAS=1 VLLM_EXL3_ATS_ALIAS_DIR=/alias VLLM_EXL3_ATS_ALIAS_LAYERS=38,39 VLLM_EXL3_ATS_ALIAS_MTP=1 VLLM_EXL3_ATS_ALIAS_EMBED=1 VLLM_EXL3_ATS_PREFETCH=1' 'container env (kernels/stops): VLLM_DS41_ROPE_TRIM=1 VLLM_DS41_ROPE_TRIM_MAX_POS=524288 VLLM_DS41_MARKOV_NVFP4=1 VLLM_DS41_L2_PREFETCH=0 VLLM_DS41_ATTENTION_COMPUTE=auto VLLM_DS41_KERNEL_BACKEND=tilelang VLLM_DS41_HEAD_DTYPE=float32 DSV41_DSML_STOP=1 DSV41_DSML_PARAM_REPAIR=1 DSV41_REP_STOP=64:512:8; JIT caches under $HOME/.cache/dsv41-ds41f/kkref/jit (mounted /cache)' 'scripts/guard.sh watch dsv41-tp1 <stage> <guard.log> 524288 <base_swap>: MUST be armed - 0.5 GiB MemAvailable floor, 64 MiB swap-growth allowance, 0.05 s sampling; kills the container on breach. guard.sh stop restores the sysctls' 'vllm serve /models/dsv41-1.62bpw-v3' --served-model-name dsv41 --host 0.0.0.0 --port 8000 --tokenizer-mode deepseek_v41 --dtype bfloat16 --tensor-parallel-size 1 --distributed-executor-backend uni --quantization exl3_dsv41 --block-size 256 --enable-prefix-caching --enable-chunked-prefill --max-model-len 524288 --max-num-seqs 1 --max-parallel-prefills 1 --max-num-batched-tokens 2112 --gpu-memory-utilization 0.90 --kv-cache-memory-bytes 1073741824 --generation-config vllm --override-generation-config '{"max_new_tokens": 32768,"temperature": 0.6,"top_p": 0.95}' --engram-config '{"table_memory":"disk","disk_resident_scales":false,"projection_tp":true}' --attention-backend tilelang --linear-backend tilelang --moe-backend tilelang --jit-monitor-mode warn --compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","custom_ops":["all"],"cudagraph_capture_sizes":[1,2,3,4,5,6,7]}' --max-cudagraph-capture-size 7 --speculative-config '{"method":"dspark","num_speculative_tokens":5,"draft_tensor_parallel_size":1,"attention_backend":"tilelang","draft_sample_method":"greedy","rejection_sample_method":"block","enable_adaptive_verification":true,"adaptive_verification_row_cost":0.01}' --reasoning-parser deepseek_v41 --tool-call-parser deepseek_v41 --enable-auto-tool-choice --long-prefill-token-threshold 2047 --async-scheduling --no-scheduler-reserve-full-isl --no-enable-flashinfer-autotune --language-model-only --mm-processor-cache-gb 0 --hf-overrides '{"quantization_config":{"quant_method":"exl3","bits":2,"codebook":"mcg","scope":"deepseek_v41_routed_experts","non_routed_quantization":{"quant_method":"deepseek_v41_fp8","weight_block_size":[32,32],"is_checkpoint_fp8_serialized":true,"activation_scheme":"dynamic"},"mtp_experts":"exl3"}}' 'Do NOT add --enforce-eager (the 74.4 ms/token no-draft path); do NOT raise --max-num-batched-tokens past 2112 (8192 OOMs); --gpu-memory-utilization is INERT because serve_inner.sh always passes --kv-cache-memory-bytes; MAXLEN=32768 is 1-5% faster on short prompts.' 'DEFAULT_MAX_TOKENS/DEFAULT_TEMPERATURE/DEFAULT_TOP_P (32768/0.6/0.95) exist because agent clients send none - without them replies ran 906 vs 277 completion tokens and 83% vs 89% valid tool calls. The repo also carries a sibling SAGE REXL3 1.55bpw pack (packs/1.55bpw-rexl3/, AgentSparko overlay, MAX_NUM_SEQS>1, vision) sharing the same engine - not part of this measured recipe. scripts/env.sh + packs/1.62bpw/scripts/env.sh are the pin authority.'

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-sage-exl3-1-62bpw-1x-dgx-spark-dspark.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-sage-exl3-1-62bpw-1x-dgx-spark-dspark.json

Engine

Install note: Derived image dsv41-1017-exl3:r6w = Christopher Owen's spark-ds41f r6w base (upstreams pinned at 2dc95329) + vcruz305/exllamav3 feat/moe-warp-private-stages @ 909ad8564fcb + vcruz305/vllm-exl3 feat/dsv41-1017-tp1 @ 30e8b941376c + quant-config shim + TP1 decode tiles; MoE tile-K compiled at 16; built by scripts/build_image.sh (base fetched from vcruz305/DSV4.1-Flash-1017-Spark-base-image @ 17ed433666f4, archive sha256 97d31344b0e5f8e17bf69e05d679a25b3256a452a7275bc294eb6bd149f58e9a, layer sha256:8d743923e09a...). Needs passwordless sudo -n docker, zstd, huggingface_hub[hf_xet]; sudoers must grant docker, sysctl for the three vm.* keys, swapoff/swapon, tee /proc/sys/vm/drop_caches and pkill. The 326.6 GB pack plus 8.6 GiB alias side file plus ~37 GB images need ~400 GB free NVMe. HF token required (model repo is gated - accept terms once). guard.sh MUST be armed.

Model

Context

  • max context: 512K tokens

KV pool

  • 959,768 tokens across concurrent requests

Performance

Speed by context

ContextConc.PrefillDecodeTTFT
14,000—720 tok/s——reported
32,7681—34 tok/s—reported
43,0081—36.3 tok/s—reported
131,034—1179 tok/s—111100 msreported
518,103—1102 tok/s—470200 msreported
519,984—1007 tok/s—516400 msreported
519,9841—29.3 tok/s—reported
524,2881—35.1 tok/s—reported
534,5281—39.6 tok/s—reported

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

reported

notesAuthor-measured on one DGX Spark 2026-10 (README speed tables at recipe pin 8036aa74). Decode = client-observed tok/s, engine's own spec-decode counters; bench7.py single stream 512 tokens. Serving build (W2 warp-private MoE kernel, shipped cold set 1,418 experts/43 keys, MAXLEN=524288): four boots mean 137.4 ms/step, 4.73 tok/step, 35.1 tok/s. Cold set at MAXLEN=32768 (another GB10 box): 129.7/131.3 ms/step, 4.69, 35.6/36.3 tok/s. Pre-W2 tile-K 16 k=5: 140.0-145.6 ms/step, 4.35-4.74 tok/step, 31.3-34.0 tok/s; 39.6 tok/s with prefix caching on at 524288 (127.6 ms/step, 5.07). Prefill ~720 tok/s varied real text; 1,179 tok/s at 131,034-token needle (229,376, TTFT 111.1 s); 519,984-token prefill at 524,288 TTFT 516.4 s, decode 29.3, min MemAvailable 2.23 GiB. Bring-up 3 min 11 s to /v1/models 200. Memory: engine reservation 110.5 GiB at ready; steady MemAvailable ~4.0 GiB at 32768, 2.9-3.2 at 524288, 0 swap growth. Honest limit: 50-60 tok/s is NOT reached; ~31-39 is the best measured.

Install requirements

NVIDIA driver floor: unknown - check the image tag

Source: NVIDIA CUDA Toolkit Release Notes - driver compatibility tables (https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/, fetched 2026-10-03).

Map the placeholders to your rig

Downloads

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.

Export

recipe.yaml (raw)