Recipe · Four DGX Sparks

DeepSeek V4.1 Flash on four DGX Sparks, with TensorFold.

Serve DeepSeek's own DeepSeek-V4.1-Flash-1017, in FP8 and MXFP4 exactly as published with no re-quantization, from four DGX Sparks over their ConnectX-7 ports, through an OpenAI-compatible API. It runs on TensorFold's Zig engine with a 1M-token window, up to 16 requests at once, image and video input, structured output and DSpark drafts from the checkpoint's own draft blocks. NVIDIA's NVFP4 release is one setting away. No switch needed: a plain cabled ring of four Sparks works.

Get the free recipe

Install with an AI agent

Install this model

Paste this into an AI coding agent that can run commands on the machine that will serve the model (the head node, for a Spark cluster), such as Claude Code or Codex. It reads the recipe, adapts it to your setup, starts the server and checks that it works.


        
DeepSeek v4.1 Flash on four DGX Sparks: a wave of white points over a dark floor. 1M context, 16M KV pool, 65 tok/s prose, up to 16 concurrent sessions

Performance

Measured, not promised.

One request65.8tok/s, prose
Eight at once165.3tok/s combined
Context1Mtokens a request, up to 16 at once
Prefill4,127tok/s, 32k prompt

Measured on 2026-10-25 on four Sparks on a switchless ring (no RoCE switch, ./start-switchless.sh), at the defaults: a 1,048,576-token window, 16 streams, DSpark drafts, CUDA graphs, side stream and L2 prefetch on. Median of three runs, from spark1. "Aggregate" is the total tok/s across every request at once, "per request" is one request's own share, and "first token" is the time to the first token. A switch removes the ring's one relayed hop between the two nodes that have no direct cable; these numbers are this fabric's, not a switch's.

Decode, prose

Non-greedy (T = 0.7), thinking on.

RequestsAggregatePer requestFirst token
165.8 tok/s65.8 tok/s186 ms
296.5 tok/s48.9 tok/s304 ms
4130.5 tok/s34.1 tok/s499 ms
8165.3 tok/s21.7 tok/s901 ms

Decode, prose at 128k

The same, with every session starting at 128k tokens of context.

RequestsAggregatePer requestFirst token
158.6 tok/s58.6 tok/s1.07 s
283.1 tok/s44.3 tok/s1.61 s
4111.3 tok/s31.0 tok/s2.61 s
8132.3 tok/s19.2 tok/s4.67 s

Decode, code

Greedy (T = 0), thinking off. Code is easier to draft, so it runs faster than prose.

RequestsAggregatePer requestFirst token
1117.4 tok/s117.4 tok/s192 ms
2158.2 tok/s80.6 tok/s262 ms
4174.4 tok/s46.2 tok/s482 ms
8183.7 tok/s25.3 tok/s833 ms

Prefill

How fast a cold prompt is read before the reply starts, one request.

PromptPrefillFirst token
4,116 tokens3,497.9 tok/s1.33 s
8,210 tokens3,851.9 tok/s2.28 s
16,400 tokens4,051.9 tok/s4.20 s
32,787 tokens4,127.2 tok/s8.10 s
65,559 tokens4,134.1 tok/s16.01 s
131,093 tokens4,058.4 tok/s32.45 s
262,161 tokens3,929.4 tok/s66.87 s

Checked, not just timed

The recipe's tools/validate.py passes: text, thinking, a tool call and its result, an image, a video, a 21,875-token prompt, eight greedy replies sent at once equal to the same replies sent one at a time, and drafted replies equal to undrafted ones. The native kernels are checked against DeepSeek's reference arithmetic on real weights.

Needle in a haystack (tools/needle_bench.py): a random code hidden at 0, 25, 50, 75 and 100 % depth, at nine context lengths from 4k up to 997,530 tokens, effectively the model's full 1,048,576-token window. All 45 of 45 cells retrieved it correctly, including the longest, deepest one (997k tokens, needle at 100 % depth, 156 s). The recipe's prompt-sharding patches don't degrade long-context retrieval at any tested depth.

Opt-in extras

Three switches, off by default, add more with the same replies: TF_DS_EXPERT_EXIT=1 and TF_DS_SAMPLE_CAND=1 together give level at one request, +1.6 % to +2.8 % at 4 and +1.9 % to +8.2 % at 8, measured with TF_DS_PREFILL_YIELD=1 on as well, which costs nothing here.

TF_DS_PREFILL_YIELD=1 keeps the other requests going while a long prompt is read: with 15 requests decoding, a 25,000-token prompt stalled them about 7.5 s, and about 1 s with it, for +35-41 % on that prompt's own time to first token. With it, patch 0031 also admits new requests between a long prompt's chunks: a short request arriving 1 s into a cold 50,939-token prompt had its first token in 0.31 s, and the long one in 13.5 s.

Speed preview

What 65.8 tok/s feels like.

Sample text played at the measured decode speed: one request at 65.8 tok/s, or four at once at 34.1 tok/s each (130.5 combined), at about four characters a token. Switch between them in the window.

TensorFold · DeepSeek-V4.1-Flash-1017 · 4× DGX Spark
65.8 tok/sSample text, played at the measured speed

How it is built

Four Sparks, one model, no switch.

The checkpoint is about 510 GB, so it needs four Sparks in tensor parallel (TP4). Rank 0, on spark1, also serves the API and runs the vision tower and the sampler. The other three Sparks read the checkpoint and their weight files from spark1 over NFS, so spark1 holds the only copy.

A ring or a switch

The recipe runs the four Sparks either way. On a switch (every Spark on one RoCE network): ./start.sh. As a ring without a switch: spark1, spark2, spark3, spark4 and back to spark1, one QSFP cable between neighbours: ./start-switchless.sh. scripts/nodes.sh works out which one you have from the addresses, and each script stops on the other kind and names the right one.

A 2 × 2 split

Each Spark is a node of a 2 × 2 grid, with a row partner and a column partner. On a ring, ORDER=auto places the nodes so every partner pair has a cable of its own: the partners' exchanges run over two-rank NCCL communicators, one per cable, and the all-gathers go round the ring.

Weights as published

DeepSeek's FP8 and MXFP4 checkpoint is read as it is, on new CUDA kernels, with no re-quantization. The native kernels are checked against DeepSeek's reference arithmetic on real weights. Each Spark takes about 80 GiB of weights.

DSpark drafts, checked

The checkpoint carries DSpark draft blocks: after each decode step they propose a block of 5 tokens, which the next step verifies in one pass. Verification is exact, so a drafted reply equals the undrafted one and drafts only change speed. On prose they give about 1.8 tokens a step. DRAFTS=0 turns them off.

The recipe adds 43 patches to TensorFold's DeepSeek-V4.1 engine: DeepSeek's FP8/MXFP4 checkpoint, the ring's node order and links, video input, tool-call arguments, structured output, NVIDIA's NVFP4, and a long list of prefill and decode speed-ups. Most are Mia's AI Lab's; 0008 is Hector's, and the others by outside authors are named below. Each one, with its flag and its measurements, is in the recipe's CHANGELOG and CREDITS.

The engine

Powered by TensorFold.

TensorFold, by Ash Hart, is an open-source engine that serves language models on Apple Silicon and NVIDIA GPUs through an OpenAI-compatible API. Each model family brings its own kernels and its own draft verification, tuned for that model instead of one generic path for all.

The DeepSeek family

The DeepSeek-V4.1-Flash family on TensorFold's Zig engine (the four-node 2D split, Engram, DSpark drafting, the vision tower, the weight-file and token-map tools) and the kernel kit are BertholomusAI's (Albert Lee) work, in their TensorFold fork.

Apple Silicon and NVIDIA

MLX on Macs, and CUDA on NVIDIA GPUs from compute capability 8.9: Ada (RTX 40), Hopper and Blackwell, including the DGX Spark's GB10 and the RTX 50 series.

Many model families

Qwen3.8 Flash Next, Qwen3.8-27B, GLM-5.3-Flash, Nemotron 3.5, Gemma 4 and DeepSeek-V4, among others, each with its own kernels.

In this recipe

TensorFold's native Zig engine (Zig 0.17.0) at BertholomusAI's deepseek-v41-zig-tp4 branch, commit 5940208, plus this recipe's 43 patches: the checkpoint as published, the ring, video input, tool-call arguments, structured output and NVIDIA's NVFP4.

What you need

Four Sparks, and a cable between neighbours.

Four DGX Sparks

Linked by their ConnectX-7 ports, on one RoCE switch or as a ring (spark1 - spark2 - spark3 - spark4 - spark1, one QSFP cable between neighbours). About 100 GB of free memory on each Spark: the weights take about 80 GiB a node.

Docker and ssh

Docker with the NVIDIA runtime on every Spark, and key-based ssh from spark1 to the other three.

Disk, on spark1

About 510 GB for the checkpoint and about 320 GB for the four weight files, under the Hugging Face cache (HF_CACHE, default ~/.cache/huggingface).

An NFS export

spark1 exports that cache, read-only, to each worker's address on its link; scripts/prepare.sh makes a Docker volume on each worker, mounts it and checks that every file a rank reads is there, at the right size. The default path is /huggingface (NFS_PATH).

Quick start

One command on spark1.

1

Clone and point it at your Sparks

git clone https://github.com/MiaAI-Lab/DeepSeek-V4.1-Flash-1017-4x-DGX-Sparks-TensorFold.git
cd DeepSeek-V4.1-Flash-1017-4x-DGX-Sparks-TensorFold
cp scripts/local.sh.example scripts/local.sh

Set WORKER, WORKER2 and WORKER3 in scripts/local.sh to spark2, spark3 and spark4 (ssh targets; on a ring, in its order), and NFS_PATH if your export puts the cache somewhere other than /huggingface.

2

Start it

./start.sh                # on a switch
./start-switchless.sh     # on a ring, no switch

The first run builds the image, downloads the checkpoint, writes the four weight files (one per node, about 80 GB each) and the workers' NFS volumes, then starts the four ranks and runs a smoke test. Later runs start in about two and a half minutes.

3

Talk to it

Any OpenAI client works with base_url = "http://<spark1-address>:8888/v1" and the model DeepSeek-V4.1-Flash-1017.

curl -s http://<spark1-address>:8888/v1/chat/completions -H 'content-type: application/json' -d '{
  "model": "DeepSeek-V4.1-Flash-1017",
  "messages": [{"role": "user", "content": "Hello!"}],
  "chat_template_kwargs": {"enable_thinking": false}
}'
4

Run it day to day

./start.sh restart              # restart with changed settings (or ./start-switchless.sh restart)
./stop.sh                       # stop all four ranks
docker logs -f dsv41-1017-tf    # a Spark's server log

To use Blackfrost-AI's DERISKED FP8 checkpoint instead, set DERISKED=1 in scripts/local.sh (or run DERISKED=1 ./start-switchless.sh restart); DERISKED=0 returns to the original. The first switch downloads and prepares separate weights. NVIDIA's NVFP4 release works the same way, with NVFP4=1.

Opt-in

NVIDIA's NVFP4 release, one setting away.

NVFP4=1 serves NVIDIA's NVFP4 release of the same model instead of DeepSeek's. The API model id stays DeepSeek-V4.1-Flash-1017. The default is still DeepSeek's release, and the numbers above are that default's.

What changes

The two checkpoints differ in two places. Everything else is DeepSeek's bytes.

DeepSeek's releaseNVFP4=1
Routed experts (40 layers)MXFP4 weights, FP8 activationsNVFP4 weights, 4-bit activations under each expert's calibrated input_scale
Engram tablesFP8, about 203 GBMXFP4, about 105 GB (lossy, per NVIDIA's card)

Patch 0037 runs them on GB10's block-scaled FP4 tensor-core instruction, which takes 64 inputs at a time and applies the scales in hardware. NVIDIA's expert weights dequantize to exactly DeepSeek's. The weight files and GPU memory stay the same size as DeepSeek's, and the DSpark drafter and the shared expert are unchanged. Replies are as exact as ever: 612 replies, the same token by token at every concurrency.

Turning it on

NVFP4=1 ./start-switchless.sh restart

Or set it in scripts/local.sh; NVFP4=0 goes back. The first start downloads about 430 GB (one copy on spark1, as ever, read by the other three over NFS), writes four weight files of about 80 GB and copies its 105 GB or so of Engram tables to each worker's disk: have about 750 GB free on spark1 and 110 GB on each worker.

ENGRAM_PACKED=1 reads FP8 tables, so it is refused with NVFP4=1. DERISKED=1 names another checkpoint, so set only one of the two. ABLIT=1 works with it, on the same attn.wo_b bytes; neither the overlay's author nor NVIDIA has validated that pairing, though tools/validate.py and a known-answer check here passed.

NVIDIA's own accuracy results are on its model card (vLLM on GB300). tools/dsv41-zig/native/check_nvfp4.py checks the kernels against fp64 on real tensors.

Decode, against FP8

Aggregate tok/s, three kinds of text, greedy and T = 1.

Requests at once124816
Mean+1.1 %+0.3 %+1.7 %+3.9 %+6.4 %
Lowest cell-0.1-4.0-0.8-0.6+3.3
Highest cell+2.9+3.6+2.8+7.1+8.2

A cold prompt, against FP8

Seconds to read it, and the prefill speed gained.

Prompt4k16k65k131k
FP81.41 s4.61 s17.71 s35.74 s
NVFP4=11.33 s4.38 s16.92 s34.27 s
Prefill speed+6.2 %+5.2 %+4.7 %+4.3 %

Measured on this cluster on 2026-10-31, a separate run from the tables above: the same benchmarks back to back, one idle server at a time, against the FP8 image served until then (patches 0001-0025), with NVFP4=1 on 0001-0037, on our own decode and prefill benchmarks, which are not in the recipe's repository. The gain is modest because the experts were already nearly at this machine's memory bandwidth: a kernel benchmark reads weights at 231 GB/s with NVFP4=1 and 197-218 GB/s without, against 242 GB/s for a plain streaming read, and the weights' bytes do not shrink.

Moving from 0025 also turns on 0031's admission under TF_DS_PREFILL_YIELD=1, which raises the first token of a burst of short prompts (16 at once: 1.3-1.7 s against 1.0-1.2 s). With the switch off it is level with FP8's (16 at once: 0.94-1.10 s against 0.98-1.12 s), but a long prompt then holds the other requests up.

Images and video

Pictures and clips, as data URLs.

User turns and tool results take image_url and video_url parts as base64 data: URLs (remote URLs are off).

  • Images go to the checkpoint's vision tower on rank 0. PNG is read natively; other formats go through Pillow.
  • Video has no tower of its own in this model, so the server samples the clip into frames and sends them as images, each after a text line Video frame at <t> s:, in time order. PyAV in the image decodes MP4, WebM, MOV and the other formats FFmpeg reads.
  • Frames: TF_VIDEO_FPS a second (default 2), at most TF_VIDEO_MAX_FRAMES (default 32; a longer clip's frames are spread evenly over it), each scaled to at most TF_VIDEO_MAX_SIDE pixels a side (default 768). Every frame costs prompt tokens like an image.

Thinking and the API

Thinking on, by default.

The model thinks first unless a request sends "chat_template_kwargs": {"enable_thinking": false}. The effort a request names is used; with none, the server uses REASONING_EFFORT (max by default; low is 50, high 75, max 100). A request's own sampling settings win over the server's defaults (temperature 1.0, top_p 1.0, top_k 20).

  • OpenAI-compatible on port 8888, model id DeepSeek-V4.1-Flash-1017.
  • Text, images, video, tool calling, structured output, and thinking on or off.
  • DSpark drafting from the checkpoint's own draft blocks, on by default.

Structured output

Every token from a grammar.

Patch 0036 brings TensorFold's structured output to this engine: every token of the reply is drawn among the tokens a grammar allows, so the reply is always valid.

  • response_format (json_schema or json_object), and vLLM's guided_json, guided_regex, guided_choice, guided_grammar (EBNF) and structured_outputs.
  • tool_choice: "required" or a named function: the reply is a calls block for one of the offered tools, with arguments that follow its schema, and comes back as tool_calls.
  • With thinking on, the grammar starts after </think>: the reasoning is free, the answer is constrained.
  • A grammar that cannot be enforced, such as a malformed regex, is refused with HTTP 400 and xgrammar's reason, before anything is decoded.

One structured stream decodes about as fast as the same reply unconstrained (25 cities as a JSON schema: 108 tok/s greedy and 121 sampled, against 104 and 109 for the plain request), since the grammar drafts the text it forces. Beside other streams a masked row is drawn on the host from its whole row, so it runs slower than they do. Requests without a grammar decode exactly as before.

Long chats and long prompts

Long chats, without starting over.

  • Pictures in the history. A kept prompt state is keyed by the request's images as well as its tokens, so a chat with a picture in its history resumes its prefill instead of re-running it on every turn, and an image wholly inside the restored part skips the vision tower. A 35-image prompt, resent, read in 1.0 s instead of 20.1 s, with equal tokens.
  • Very long conversations. The chat template writes each piece out as it is made instead of adding to one growing string. In the engine's own template module, one render of a 1,500-turn conversation peaked at 24.8 GB and now peaks at 0.4 GB. The prompts are unchanged.
  • Silent streams. A stream that is queued, or waiting on a long prompt, gets a heartbeat every 15 s: SSE comments on OpenAI Chat and Responses, ping events on Anthropic Messages. TF_SSE_KEEPALIVE_S changes the interval and 0 turns it off. A proxy may consume them, so set its own heartbeats as well.
  • Seeing the cache work. /metrics adds prompt_tokens_cached_total, plus vLLM's prefix_cache_hits_total and prefix_cache_queries_total.

Memory and settings

A million tokens, sixteen at once.

The KV pool

The pool is the number of positions all requests share. The recipe's README runs it at its true ceiling, 16,777,216 positions (PARALLEL 16 × CONTEXT 1,048,576), so all 16 streams can each hold the model's full ~1M-token context at once, with nothing wasted past that. On the Sparks it was measured on, that leaves three of the four at about 15-18 GiB free and the fourth, which also runs other workloads, at about 11 GiB.

The shipped default for POOL is 2,097,152. Set it to 16,777,216 for the full 16 × 1M, and lower it if a Spark on your own setup runs other memory-heavy work too.

The ones you might change

Settings come from the environment, then scripts/local.sh, then ./.env, then the defaults in scripts/config.sh, which documents each one.

VariableDefaultMeaning
CONTEXT1048576A request's positions at most (the model's window)
POOL2097152The positions all requests share
PARALLEL16Requests at once
THINKING1Think first unless a request sends enable_thinking: false
REASONING_EFFORTmaxThe effort when a request names none
DRAFTS1DSpark drafting; 0 turns it off
GRAPHS / SIDE / PREFETCH1 / 1 / 1CUDA graphs, the side stream, the paced L2 prefetch
NVFP401 loads NVIDIA's NVFP4 checkpoint
ABLIT01 grafts the Keys abliteration overlay (above); gated, needs HF_TOKEN
DERISKED01 loads Blackfrost-AI's DERISKED FP8 checkpoint
ENGRAM_PACKED0Engram's packed rows (opt-in, below)
RANK_LOCAL0Each worker's weight file from its own disk (below)
PORT8888Where the API listens

ABLIT (opt-in)

ABLIT=1 grafts drowzeys's Keys abliteration overlay onto the checkpoint before the rank caches are baked: a refusal-direction ablation of attn.wo_b in layers 10-35 only. Everything else stays stock: layers 0-9 and 36-39, all MTP, vision, Engram, every expert, embed and head. The overlay is gated and free: accept its terms while logged in on Hugging Face, then export HF_TOKEN=hf_... or run hf auth login with that account first.

ABLIT=1 ./start-switchless.sh restart

ABLIT=0 returns to the stock checkpoint. The first switch downloads the overlay's sidecar (about 1.1 GB) and rebuilds all four weight files from it, the usual rank-cache build (about 80 GB, a few minutes), once.

Checked on this cluster, not just by the overlay's author: the grafted wo_b tensors in the built checkpoint match the overlay's sidecar byte for byte, tools/validate.py all passed, and a needle spot check at 65k and 262k tokens (25 % and 75 % depth) passed at the same speed as the stock numbers above.

Engram's packed rows (opt-in)

Each decode round and prompt chunk reads Engram rows from two tables of about 384 million rows each (about 203 GB). ENGRAM_PACKED=1 writes packed shards once on every Spark's own disk, so a row is one read instead of two; with ENGRAM_OWNED=1 (the default with packing) each Spark keeps only its quarter of the rows, about 51 GB, and one exchange a layer fills in the rest.

The rows are the same bytes either way, so replies should not change, but this path is new and unmeasured: run tools/validate.py and compare replies with the default path before relying on it, with TF_DS_DECODE_DEC=0 while the decode kernels' known issue stands.

Either path is a random-read workload on whatever holds the tables, so a ZFS host wants its own dataset for them: on a pool's defaults, a 16k-token prompt took over 500 seconds to prefill. The recipe's ZFS page has the settings that were measured.

Running it

Faster starts, a quieter idle.

Loading the weights

Patch 0046, on by default, reads the weight file ahead of the loader with 8 threads, so the loader's reads come from the page cache: a node's load went from 83 s to 27 s from NVMe, with the weights unchanged. TF_DS_LOAD_PREFETCH=0 turns it off. Over NFS the network, not the reads, is the limit.

RANK_LOCAL=1 (opt-in) gives each worker its weight file, about 77-81 GB, on its own disk as well, so a start reads no weights over NFS. It costs about 80 GB on each worker, and a worker without a matching copy reads over NFS, with a warning. On a four-GB10 ring whose one worker mounted over 2.5 GbE, shalk3 measured the engine's load at 315 s before and 96 s after.

When a worker's load crawls, look at its path to spark1 first. These come from a four-Spark ring in #21 and were not measured here: the worker across the ring reaches spark1 through a neighbour, and on that hop NFS ran at 9 MB/s until net.ipv4.conf.all.send_redirects=0 on spark1, then 39 MB/s. A worker that reaches spark1 over a management network can be given its fabric address with FABRIC_PEER2 / FABRIC_PEER3. MASTER_ADDR passes over a Tailscale address unless the Spark has no other; set it yourself if the workers reach spark1 elsewhere.

RDMA, at idle and on a switch

Patch 0034 stops the three RDMA proxy threads busy-polling while no stream is live. On one four-GB10 ring, a container's idle CPU fell from about 300 % a node to 0.21-0.32 %. That verifies that configuration, not the full feature matrix, and no isolated watts-saved claim is made. Install the same image on all four together.

Patch 0026 takes the RDMA queue pairs' MTU from the port (capped at 4096) instead of a fixed 4096. On a switch whose Ethernet MTU is 1500 the active MTU is 1024, and every request used to fail there; now it serves.

TF_DS_RDMA_CPUS=a,b,c pins the proxy threads to one CPU each; unset, the scheduler places them. @making reports 59-67 °C with 0,10,11 against 70-81 °C unpinned, with no throughput change outside the drift from the growing context (#40). Only that one layout was tried and the recipe hasn't measured it, so the default stays unpinned.

__vm_enough_memory lines in dmesg with an HTTP 500 are the host's overcommit policy refusing one mapping, not the model's size (#36). Long conversations used to ask for such mappings while rendering the chat template, which no longer does, so update first rather than changing the host's setting.

On top of the engine

43 patches, and who wrote the new ones.

The first 25, all Mia's AI Lab's except Hector's 0008, cover the checkpoint, the ring and the speed-ups above. These came after. The numbers skip 0038 and 0044-0045, held for open work. Flags and full measurements are in the recipe's CHANGELOG.

PatchByWhat it does
0026knapcioRDMA queue pairs use the port's active MTU, so RDMA works on a switch whose Ethernet MTU is 1500
0027Thomas KempkaA kept prompt state is keyed by the request's images as well as its tokens
0028-0029Mauvis Ledford (backports)Upstream TensorFold's heartbeat for silent streams, and its golden test harness draining the test server's stdout
0030-0031Mauvis LedfordSkip vision encoding for image spans wholly covered by a verified cached prefix; admit requests between a prompt's chunks
0032Mia's AI Lab0031's admission only with TF_DS_PREFILL_YIELD=1; without it a prompt is read whole, as before
0033Manuel/metrics counts the prompt tokens restored from kept prompt states
0034Hironori UchikawaParks idle RDMA proxies with a futex once all ranks quiesce; wakes them before the next compute frame
0035Mia's AI LabRank 0 opens every worker's rendezvous port before loading its weights, so a worker that loads first waits instead of exiting with ConnectFailed
0036BobClawblaw, Ash Hart, bertholomus; ported by Mia's AI LabStructured output and required tool calls on the DeepSeek-V4.1 engine
0037Mia's AI Lab, on Ash Hart's block-scaled FP4 instruction and activation formatNVIDIA's NVFP4 checkpoint
0039SvangenStudiosA reply grammar that cannot be built at admission fails only its own request
0040SvangenStudiosDecode and drafter graph caches keep ownership of an executable whose first launch fails, so a destroyed handle is never launched or destroyed twice
0041SvangenStudiosTests only: the two opt-in grammar tests use the current HfText API, so the server tests compile again
0042SvangenStudiosA JSON answer stays content when tools are offered; it is not parsed as tool calls
0043SvangenStudiosA reply made only of orphan DSML closing tags gets tensorfold.tool_parse_warning (diagnostic only)
0046shalk3The weight loader's file is read ahead by 8 threads, so a node loads from NVMe in 27 s instead of 83 s

Licenses

Free, with a few rules.

  • The recipe's own scripts, patches and documentation are Apache-2.0; its NOTICE file lists the third-party work and its licenses.
  • The model weights are DeepSeek's, under the MIT license, and are not part of the recipe. NVIDIA's NVFP4 quantization, for NVFP4=1, is MIT too, and not part of the recipe either.
  • "DeepSeek" belongs to DeepSeek; "DGX Spark" and "GB10" belong to NVIDIA. This recipe is not affiliated with or endorsed by DeepSeek, NVIDIA, the TensorFold authors or BertholomusAI.

Credits

Built on the work of others.

  • DeepSeek: DeepSeek-V4.1-Flash-1017, its weights, its DSpark draft blocks and its reference inference code
  • NVIDIA: DeepSeek-V4.1-Flash-1017-NVFP4, the quantization NVFP4=1 serves
  • TensorFold, by Ash Hart and the TensorFold contributors: the native Zig engine and its OpenAI-compatible server; Ash Hart also wrote the block-scaled FP4 instruction and the 4-bit activation format that patch 0037 is built on
  • BertholomusAI (Albert Lee): the DeepSeek-V4.1-Flash family on TensorFold's native engine, the kernel kit and the served settings this recipe starts with
  • drowzeys: the Keys abliteration overlay behind the optional ABLIT=1
  • Hector: patch 0008 (pair-sum gathers) and the prefill measurements behind it
  • knapcio: patch 0026. Thomas Kempka: patch 0027. Mauvis Ledford: patches 0030-0031 and the backports 0028-0029, of upstream work by JJ Eaton, Ash Hart and BobClawblaw. Hironori Uchikawa: patch 0034
  • BobClawblaw, Ash Hart and bertholomus: the structured output patch 0036 ports here
  • SvangenStudios: patches 0039-0043, and the checks in start.sh and stop.sh (#24, #25, #33)
  • shalk3: patch 0046 (#20) and RANK_LOCAL (#19)
  • Manrique (@hashd1ve): the chat template's memory fix, carried over by Manuel (@manuel1618, #18), who also backported patch 0033
  • Tyler Folkman (@tfolkman): the launcher's locks, the switched mesh's NCCL bootstrap and the preparation utilities on the runtime image (#22, #23, #26)
  • Christopher A. Williamson (@cawilliamson): the ZFS page for Engram's tables (#38). Zhehao Hu (@Zhehao-Hu): the documentation of the MXFP4 Engram rows that patch 0037 reads the checkpoint by
  • The GLM 5.3 Flash TensorFold recipe's contributors, whose code the scripts keep: webzone (twin rails), Alexbob0 (workers by host name) and john (each rank's rendezvous address)
  • xgrammar, PyAV, Zig, NVIDIA's PyTorch container and huggingface_hub

The full list is in the recipe's CREDITS.md.

Run it on your Sparks.

Free and open, with every patch and every number published.