Recipe · two or four DGX Sparks · Zig engine
Inkling 2 Small on two or four DGX Sparks, with TensorFold's Zig engine.
Serve Thinking Machines' Inkling 2 Small from two DGX Sparks, or four, through an OpenAI-compatible API, on my own EXL3 2.55-bit quant: 4 requests at once with a 524,288-token window each, sharing a 1M-token KV pool, with image input and DSpark drafts. It runs TensorFold's Zig engine, at ajensenwaud's Inkling 2 Small engine, with 85 patches on top. On two Sparks: 40.7 tok/s for one request, 83.4 tok/s for four at once, and 2,471.9 tok/s prefill on a 32K prompt. An optional Cyber lane serves my quant of Blackfrost Research's Inkling-2-Small-Derisked instead. One command builds the engine, downloads the weights, ships the image to the workers and starts the server.
Performance
Measured, not promised.
Measured with sparkDash on two DGX Sparks (GB10, sm_121) at tensor-parallel 2, with the default checkpoint Inkling-2-Small-EXL3-2.55bpw-g28 and the recipe's defaults: int4 KV, DSpark drafts, vision on, a 524,288-token window, 4 streams and a 1,048,576-token shared KV pool. The four-Spark mode (TP=4) has no published numbers yet.
Prefill
How fast a prompt is read, by prompt size, and the time to first token.
| Prompt | tok/s | First token |
|---|---|---|
| 4K | 2,398.5 | 2.01 s |
| 8K | 2,516.3 | 3.56 s |
| 16K | 2,502.3 | 6.85 s |
| 32K | 2,471.9 | 13.56 s |
| 64K | 2,386.4 | 27.77 s |
| 128K | 2,245.9 | 58.67 s |
| 256K | 1,987.0 | 132.24 s |
Decode, prose
Temperature 0.7, thinking on, top-k 20, DSpark drafts: all requests together, per request, and the time to first token.
| Requests | Total tok/s | Per request | First token |
|---|---|---|---|
| 1 | 40.7 | 40.7 | 163 ms |
| 2 | 64.2 | 33.6 | 706 ms |
| 4 | 83.4 | 21.2 | 697 ms |
Speed preview
What 40.7 tok/s feels like.
Sample text played at the measured speed, at about four characters a token: one request at 40.7 tok/s, or four at once at 21.2 tok/s each (83.4 combined). Switch between them in the window.
The model
Two checkpoints, one recipe.
Both checkpoints are my EXL3 quants of Inkling 2 Small: the routed experts at 2.55 bits a weight on average (2, 3 or 4 bits a projection, by layer, with the mcg codebook), and everything else copied byte for byte. Each is about 188 GiB, with the same bit plan and tensor layout, so they share the engine, patches, launchers and settings. The DERISKED flag picks one.
DERISKED=0 (default) | DERISKED=1 (Cyber lane) | |
|---|---|---|
| Checkpoint | Mia-AiLab/Inkling-2-Small-EXL3-2.55bpw | Mia-AiLab/Inkling-2-Small-DERISKED-Cyber-2.55bpw (gated: request access on Hugging Face and run hf auth login before the first start) |
| Quantized from | Stock thinkingmachines/Inkling-2-Small | Blackfrost-Research/Inkling-2-Small-Derisked |
| Model id | Inkling-2-Small | Inkling-2-Small-DERISKED |
| License | Apache 2.0 | The Derisked release's own terms (see its model card) |
What Derisked is
Blackfrost Research's Derisked release is a behaviourally modified Inkling 2 Small. Its stated goal is to remove false refusals and moral-hedging tails on ordinary requests while keeping the model's capability, for controlled research and internal evaluation. The change is small: only 18 BF16 attention-writer tensors (attn.wo_ud, layers 20-37) differ from upstream. The routed experts, router, embedding, head, vision tower and MTP head are byte-identical to stock Inkling 2 Small.
The Cyber quant
The same quant recipe as the default checkpoint, with a calibration set that adds defensive-security (39K tokens) and offensive-security (38K tokens) material to the code, tool calls, math and chat, so the experts are calibrated on security prompts too. Against Inkling-2-Small-Derisked itself, so it shows quantization error only: KL 0.0088 nats a token on the model's own text, 97.0% top-1 agreement and perplexity +0.4%. The full tables are on the model card.
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. This recipe runs its Zig engine, tensorfold-native, at ajensenwaud's Inkling 2 Small engine (PR #4841, branch ink-small-tp2, commit 29b5f938), built in NVIDIA's PyTorch container for the Spark's sm_121.
One copy of the weights
The checkpoint, about 188 GiB, lives on the first Spark only. The workers mount it read-only over NFSv4.2 on the ConnectX-7 link, and the ranks talk over RoCE v2 and NCCL.
A shared KV pool
A Hadamard-rotated int4 KV cache, paged in 1,024-token pages: the 4 streams share one pool of 1,048,576 tokens instead of each reserving a full window (patches 0009 and 0065, adapted from gr8).
DSpark drafts
The checkpoint's own DSpark head drafts on the first Spark and every rank verifies the window. On by default on two Sparks; off by default on four.
Blackwell tensor cores
Q8 tensor-core decode, MXFP8 prefill for the dense weights and the EXL3 experts, and FP8 prompt attention over the int4 cache, on the GB10's sm_121.
On top of TensorFold
What the 85 patches do.
| Patches | What they do |
|---|---|
| 0001-0007 | Inkling 2 Small at TP=2 and TP=4, ModelOpt NVFP4/MXFP8 loading, an FP8 KV cache, exact prefill, multi-rank communication, bandwidth-optimized kernels and DSpark speculative decoding |
| 0008, 0010-0050 | EXL3 mcg-codebook routed experts beside BF16 dense weights; decode and prefill kernel fusions; the RoCE v2 all-gather; 4,096-row, 128-member prompt tiling; PDL and L2 staging; the DSpark drafter split over TP=2; Q8 and EXL3 decode speedups; fixed-shape kernels |
| 0009, 0065 | A Hadamard-rotated int4 KV cache, and a pooled, paged global int4 KV cache shared by every stream (adapted from gr8) |
| 0051-0064, 0066-0081 | Blackwell (sm_121) tensor cores: Q8 tensor-core decode, a RoCE BF16 all-reduce, FlashAttention-2 sliding prompt attention, dense and EXL3 MXFP8 prefill, DSpark Q4 tensor cores and an INT4 vocabulary pick, an FP8 paged DSpark KV, FP8 global prompt attention over the int4 cache, CUDA graphs for DSpark's walk and encode batches, a TP-sharded sampled winner reduction, seed-coupled keyed Gumbel-max sampling, EXL3 K-loop interleaving and a direct BF16 down projection into RoCE |
| 0082-0085 | Server reliability, prompt caching and tool calls: the reply grammar freed when a stream fails to open, TF_EXTRA_EOS custom stop tokens, logs for rejected tool calls, message-boundary prompt caching with shared-prefix forking, and a rescue for stray tool calls (0082, 0083 and 0085 ported from my GLM 5.3 Cyber and Inkling 2 Mini recipes) |
What you need
Two Sparks, one cable.
Two or four DGX Sparks
Two NVIDIA DGX Sparks (GB10, 128 GB each) for ./start.sh, or four for ./start-tp4.sh. At TP=2 each one holds about 97 GiB of weights, so keep nothing else large in memory.
The ConnectX-7 link
The Sparks linked on their ConnectX-7 ports with RoCE v2, the first one (rank 0, the API) at 10.80.0.1 on that link, and key-based ssh from it to the workers.
Docker and NFS
Docker with the NVIDIA Container Toolkit on every Spark, and an NFS server on the first one, which exports the checkpoint read-only to the others.
Disk
About 188 GiB on the first Spark for the checkpoint, and about 40 GB under Docker's root for the image, which the first Spark builds and ships to the workers.
Quick start
One export, one command.
Export the checkpoint folder (once)
On spark1, add the folder to /etc/exports, then run sudo exportfs -ra. Each lane needs its own export.
/home/<user>/models/hf/Inkling-2-Small-EXL3-2.55bpw-g28 10.0.0.0/16(ro,no_subtree_check,fsid=4110) 10.80.0.0/16(ro,no_subtree_check,fsid=4110)
# Cyber lane:
/home/<user>/models/hf/Inkling-2-Small-Derisked-EXL3-2.55bpw-s28 10.0.0.0/16(ro,no_subtree_check,fsid=4109) 10.80.0.0/16(ro,no_subtree_check,fsid=4109)
Clone and start
git clone https://github.com/MiaAI-Lab/Inkling-2-Small-DGX-Sparks.git
cd Inkling-2-Small-DGX-Sparks
./start.sh # two Sparks (spark1 + spark2)
DERISKED=1 ./start.sh # two Sparks, Cyber lane
./start-tp4.sh # four Sparks (spark1..spark4)
The first run builds the Docker image with every patch, the CUDA fatbins and xgrammar, downloads the checkpoint from Hugging Face if it is missing, ships the image to the workers and starts the API on port 8888, then runs a smoke test. DRY_RUN=1 ./start.sh prints every command and changes nothing.
Talk to it
Any OpenAI client works with base_url = "http://<spark1>:8888/v1". Thinking is on by default, so give replies enough max_tokens.
curl -s http://<spark1>:8888/v1/chat/completions -H 'Content-Type: application/json' -d '{
"model": "Inkling-2-Small",
"messages": [{"role": "user", "content": "Write a Python fibonacci function."}],
"max_tokens": 2000
}'
./start.sh restart # restart (TP=2)
./stop.sh # stop every rank on spark1..spark4
./stop.sh && DERISKED=1 ./start.sh # switch to the Cyber lane
docker logs -f inkling2-small-tf # logs
Images, JSON and tools
It can see, and follow a schema.
- Images: the model's own vision tower is on by default (
VISION=1), with native JPEG and WebP decoding.VISION_URLS=1also lets requests fetch http(s) image URLs;VISION=0serves text only. - Structured output: grammar-guided decoding with XGrammar.
- Tool calling: with logs for rejected tool calls, and a rescue for tool calls the model writes on a request without tools.
Two or four
What changes with four Sparks.
| Two (TP=2) | Four (TP=4) | |
|---|---|---|
| Start with | ./start.sh | ./start-tp4.sh |
| DSpark drafts | On | Off by default |
| Between ranks | The engine's own RoCE v2 all-gather, plus NCCL | NCCL |
| Memory kept free | 6 GiB a Spark | 9 GiB a Spark |
| Published numbers | Yes, above | Not yet |
A two-Spark start never touches spark3 or spark4; ./stop.sh cleans all four, whichever mode ran last.
Settings
The ones you might change.
Set these in the environment (CONTEXT=131072 ./start.sh restart) or in .env next to start.sh; the environment wins. Every default is in the recipe's scripts/config.sh.
| Setting | Default | Meaning |
|---|---|---|
DERISKED | 0 | 1 serves the Cyber lane |
AUTO_DOWNLOAD | 1 | Download the checkpoint into MODEL_DIR if it is missing or incomplete |
MODEL_DIR | ~/models/hf/Inkling-2-Small-EXL3-2.55bpw-g28 | The checkpoint on spark1 (…-Derisked-EXL3-2.55bpw-s28 with DERISKED=1) |
WORKER1..WORKER3 | spark2, spark3, spark4 | The workers' ssh hosts |
WORKER_WEIGHTS | nfs | check uses a local copy on each worker instead of the NFS mount |
CONTEXT | 524288 | Window per stream, up to 1,048,576 |
PARALLEL | 4 | Streams sharing the paged KV pool |
KV_DTYPE | int4 | KV cache format: int4, fp8 or bf16 |
TF_INKLING2_GLOBAL_POOL_TOKENS | 1048576 | KV tokens pooled across all streams, in 1,024-token pages |
DRAFTS / VISION | 1 / 1 | DSpark drafts (off by default on four Sparks) and the vision tower |
PORT / HOST | 8888 / 0.0.0.0 | Where the API listens on spark1; keep it on your local network |
Licenses
Free, with a few rules.
- The recipe (scripts, patches 0001-0085, tools and documentation) is Apache-2.0.
- The weights are not part of it: each comes under its own model card's license. The default checkpoint is Apache 2.0, like Inkling 2 Small; the Cyber lane follows the Derisked release's own terms.
- The image the recipe builds is based on NVIDIA's PyTorch container and carries TensorFold, gr8, XGrammar, DLPack, Zig, libjpeg-turbo and libwebp, each under its own license; copies are kept in
/opt/tensorfold/share/doc/tensorfold/inside the image.
Credits
Built on the work of others.
- Mine: all 85 patches, the cluster scripts, the benchmark and check tools in
tools/, and both EXL3 2.55-bit quants. Patch 0011 ports decode fusions from my Inkling 2 Mini recipe, and 0082, 0083 and 0085 come from it and my GLM 5.3 Cyber recipe. Measured with sparkDash - Inkling 2 Small by Thinking Machines Lab (Apache 2.0): the base model; Inkling-2-Small-Derisked by Blackfrost Research, the source of the Cyber lane quant
- TensorFold and
tensorfold-nativeby Ash Hart (@ashhart) and the TensorFold contributors: the engine, its RoCE v2 transport, the prompt-cache framework and the HTTP server - @ajensenwaud: Inkling 2 Small served on two GB10s from an EXL3 pack (PR #4841, their fork's
ink-small-tp2), the engine this recipe builds on - gr8 (MIT): the Hadamard-rotated
int4KV cache by Matt Mastracci (gr8 #42) and the pooled, paged globalint4KV cache by Chuck / adapt-ai-systems (gr8 #682), adapted in patches 0009 and 0065 - ExLlamaV3 by turboderp and its contributors: the EXL3 format and the
mcgcodebook the quants use - FlashAttention-2 by Tri Dao and its contributors: the tiled online-softmax algorithm under the sliding and global prompt attention kernels
- @SvangenStudios: the reply-grammar fix behind patch 0082, which comes from my Inkling 2 Mini recipe's patch 0017 (their PR #28)
- XGrammar by MLC AI and DLPack, libjpeg-turbo, libwebp, and Zig by the Zig Software Foundation and its contributors
- NVIDIA: the DGX Spark, CUDA and Blackwell tensor cores, NCCL, ConnectX-7 RoCE v2, Model Optimizer and the PyTorch container the image is based on; Hugging Face for model hosting and the
hfCLI
The full list is in the recipe's README.
Run it on your DGX Sparks.
Free and open, with every patch published.