localairecipes launch configs for local inference

DeepSeek-V4.1-Flash-1017 Metal MXFP4 on 1x M3 Ultra 512GB DSpark

00 upvotes — sign in to vote sign in to vote

community Community submission — verify on your own hardware.

recipe by IngeniousIdiocy (Mark Shank)↗, antirez (Salvatore Sanfilippo) - DwarfStar upstream↗, Ivan Fioravanti - public V4.1 optimizations↗, Tarjei Mandt - public V4.1 optimizations↗, oMLX contributors - batched-decode origins↗ · listed by localai-recipes

Initial version · updated 44 h ago · license MIT

chat code vision batched-decode apple-silicon metal mxfp4 dwarfstar ds4 exact-mode dspark

DwarfStar ds4 branch with Metal speed-ups for DeepSeek V4.1 Flash on a 512 GB M3 Ultra (80 GPU cores), MXFP4 build of the October 17 checkpoint: 43.7 tok/s serial decode at 8K and 42.8 at 131K vs main's 19.9/17.9; DSpark code answers 67.7 tok/s; 77.7 tok/s aggregate with three concurrent sessions; cold 131K prefill 139.7 s (vs main's 189.5 s); 4K screenshot first token 2.9 s. 96 LM + 8 image speed groups, each with its own off-switch; --exact (DS4_V41_EXACT=1) restores bit-exact serial decode. Built on antirez/ds4 main @ 5379c1c9; branch pinned at 43f6851c (fast-mover: 438 commits since the scout pin; re-pinning expected). First m3-ultra recipe on the site. All figures author-measured (T0, docs/REPRODUCE-V41.md); recipe by the repo author.

Launch command

./ds4-server -m gguf/DeepSeek-V4.1-Flash-MXFP4.gguf --metal --host 127.0.0.1 --port 8000 -c 1048576 --prefill-chunk 8192 --batched-session 4 --mtp-model gguf/DeepSeek-V4.1-Flash-DSpark-MXFP4.gguf --dspark --mtp-exact-sampling --kv-disk-dir kvcache --kv-disk-space-mb 122880 --kv-cache-cold-max-tokens 1048576 --kv-cache-continued-interval-tokens 4096 --default-top-p 1.0 --default-min-p 0 --default-reasoning-effort low --utility-ctx 32768 --serial-reasoning --vision

notes

"Launch argv transcribed verbatim from the README Quick start server block at 43f6851c (the configuration the several-sessions figures were measured in, plus --vision as that section states). '-c' is EACH session's context (1048576); the example keeps ~380 GiB wired on the 512 GB Mac. For one session drop --batched-session and use a smaller -c. Serial-decode table figures (43.7/42.8/42.6/67.7) come from ./ds4 with the same model+drafter, 128 greedy tokens from saved caches, not from this server launch. Build: 'make' at repo root."

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-metal-mxfp4-on-1x-m3-ultra-512gb-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-metal-mxfp4-on-1x-m3-ultra-512gb-dspark.json

Engine

Install note: Not pip/docker-installable: build from source on macOS with 'make' (Metal; the binary builds its Metal kernels from metal/ at startup, run from the repository root). Requires Xcode CLT (cc, make). MXFP4 model + DSpark drafter are prepared from the published files with 'python3 gguf-tools/deepseek41_prepare.py --shards shards --dspark-source dspark-source --out gguf' then '--verify' (hf download antirez/deepseek-v4.1-flash-gguf @ 9dcee516 for the nine MXFP4 expert files; deepseek-ai/DeepSeek-V4.1-Flash-1017 @ 1bae0e10 for config/tokenizer/last 3 shards); needs Python 3.10+ with numpy/tokenizers/sympy and ~544 GB free beside --out. Main's download_model.sh does not offer MXFP4 or its drafter. 96 LM + 8 image speed groups each have an off-switch; '--exact' / DS4_V41_EXACT=1 turns off every non-bit-exact default.

Model

Context

  • max context: 1M tokens

Performance

Speed by context

ContextConc.PrefillDecodeTTFT
218———1000 msreported
806———2200 msreported
1,002———2900 msreported
3,0721—43.9 tok/s—reported
3,0722—68.7 tok/s—reported
3,0723—77.7 tok/s—reported
3,0724—90.9 tok/s—reported
8,1921—43.7 tok/s—reported
18,4321—42.6 tok/s—reported
28,6721—67.7 tok/s—reported
32,768—963.8 tok/s——reported
131,072—938.2 tok/s——reported
131,0721—42.8 tok/s—reported

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

reported

notesAuthor-measured on a Mac Studio M3 Ultra (80 GPU cores, 512 GB), quiet-machine protocol per docs/REPRODUCE-V41.md (no number taken until GPU <=5%). Decode rows: 128 greedy tokens after restoring an 8K/131K prompt from a saved cache, drafter loaded, mean of two timed passes. DSpark prose/code rows are DSpark on at 8K. Session rows (context_len 3072): AGGREGATE tok/s through ds4-server, N sessions x 256 tokens from 2K-3K-token C-source prompts, DSpark on, temp 1/top_p 1 (per-session 43.9/34.6/26.0/22.8 for N=1/2/3/4). Prefill rows: cold prompt in an empty session without drafter (32K 34.0 s, 131K 139.7 s; --exact 37.5/150.8 s). Image rows: TTFT median of four images through ds4-server with --vision, max_tokens 1. Marker offsets: the DSpark prose/code rows are context 8192+10240 and 8192+20480 to keep the (ctx,conc) tuples unique. All figures submitter-claimed (T0); no Apple Silicon hardware on site to reproduce.

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)