Serve Inkling 2 on NVIDIA or AMD
Serve Inkling 2 Small or Inkling 2 Mini with the bundled DSpark draft on a validated four-GPU configuration.
Prerequisites
Before you start, make sure that you have:
- A TokenSpeed installation with Inkling 2 support and the
ts servecommand. - The
curlcommand for the readiness check. - Access to the original Thinking Machines checkpoint for your model:
- Inkling 2 Small:
thinkingmachines/Inkling-2-Small. - Inkling 2 Mini:
thinkingmachines/Inkling-2-Mini.
- Inkling 2 Small:
- One of the validated hardware configurations:
- Inkling 2 Small on NVIDIA: four B300 GPUs.
- Inkling 2 Small on AMD: four MI350X GPUs.
- Inkling 2 Mini on AMD: four MI350X GPUs.
The first start on a machine autotunes kernel tactics, which takes about 10 minutes on four B300 GPUs. The results are saved under ~/.cache/tokenspeed/flashinfer-autotune, so later starts with the same layout come up in about 80 seconds.
Serve Inkling 2 Small
Inkling 2 Small uses the original Thinking Machines checkpoint on both vendors: NVFP4 experts in layers 0-39, MXFP8 experts in layers 40-47, and BF16 for everything else. The DSpark draft (mtp.safetensors) ships in the same directory, so --speculative-algorithm DSPARK needs no draft path. The checkpoint sets the draft width to seven proposals per round. ts serve selects the inkling2 reasoning and tool-call parsers.
Optional: To serve JSON requests that use
response_format, add--grammar-backend xgrammarto your launch command. Requests without a schema decode as fast as they do without a grammar backend.On the serving host, start Inkling 2 Small with the command that matches your hardware. The commands contain complete checkpoint IDs and parameter values, so you don't need to replace any placeholders.
NVIDIA: four B300 GPUs
bashTRITON_USE_SLP_VECTORIZER=1 ts serve thinkingmachines/Inkling-2-Small \ --tp 4 --ep-size 4 --mm-encoder-tp-mode data \ --max-model-len 1048552 --sampling-backend triton \ --kv-cache-dtype mxfp8 --speculative-algorithm DSPARKAMD: four MI350X GPUs
bashts serve thinkingmachines/Inkling-2-Small \ --tp 4 --ep-size 4 --mm-encoder-tp-mode data \ --max-model-len 1048552 --sampling-backend triton \ --attention-backend triton --drafter-attention-backend triton \ --mm-attention-backend triton_attn \ --speculative-algorithm DSPARKAfter
ts servereports ready, verify server readiness.
Small configuration and performance
The launch commands set only what Inkling 2 Small needs:
--tp 4 --ep-size 4: attention and dense layers use 4-way tensor parallelism, and experts use 4-way expert parallelism. This is the layout that Inkling 2 is validated on.--mm-encoder-tp-mode data: the vision encoder runs only at TP1. Data mode places a copy on every rank and spreads the images over the ranks.--max-model-len 1048552: the draft covers the checkpoint's 1,048,576 positions minus its 24-token speculative pad. To serve all 1,048,576 tokens without the draft, remove--max-model-lenand--speculative-algorithm.--sampling-backend triton: on B300, the Triton sampler decodes about 3% faster than the default sampler at nonzero temperature.--kv-cache-dtype mxfp8on NVIDIA: the target's KV cache stores FP8 E4M3 values with one power-of-two scale per 32 values. The DSpark draft's KV cache stays BF16. A token takes 0.70 of its BF16 cache bytes, so four B300 GPUs hold 15.8M tokens instead of 10.9M. With 64 concurrent agentic sessions and--kvstore-size 32, this configuration provides 33% more throughput because more prefixes stay cached. From one to 32 sessions, per-user decode matches the BF16 cache within about 2%, and the median first token comes 6-12 ms later. Prefills over a cached prefix dequantize the pages they read into a BF16 scratch of--max-model-lentokens, which uses 1 GiB per GPU. Accuracy matches the BF16 cache in TokenSpeed evaluations.
The NVIDIA command exports TRITON_USE_SLP_VECTORIZER=1. With tokenspeed-triton post20261028, the default NVPTX vectorizer makes decode 3-4% slower. On AMD, the attention, draft attention, and vision backends stay on Triton.
Serve Inkling 2 Mini on AMD
Inkling 2 Mini, thinkingmachines/Inkling-2-Mini, is a looped Inkling 2 with 24 layers of width 2304. It uses NVFP4 experts in layers 0-19, MXFP8 experts in layers 20-23, and BF16 for everything else. Its core, layers 6-17, runs three times per token. The checkpoint declares the Inkling2LoopForConditionalGeneration architecture.
As with Inkling 2 Small, the DSpark draft ships in the same directory, and ts serve selects the inkling2 reasoning parser. The checkpoint sets no draft width, so DSpark proposes three tokens per round.
On a host with four MI350X GPUs, start Inkling 2 Mini. The command contains the complete checkpoint ID and parameter values, so you don't need to replace any placeholders:
bashts serve thinkingmachines/Inkling-2-Mini \ --tp 4 --ep-size 4 --mm-encoder-tp-mode data \ --max-model-len 262120 --sampling-backend triton \ --attention-backend triton --drafter-attention-backend triton \ --mm-attention-backend triton_attn \ --speculative-algorithm DSPARK --decode-monokernel \ --cudagraph-capture-sizes 1 2 4 8 16 32 64After
ts servereports ready, verify server readiness.
Mini configuration
The AMD command for Inkling 2 Mini changes three settings from the Inkling 2 Small command:
--decode-monokernel: decode steps of 1, 2, 4, or 8 requests run each layer in persistent gfx950 kernels, with the same output as without the flag.--max-model-len 262120: this is the context length that Inkling 2 Mini is validated at. The checkpoint covers 1,048,576 positions, or 24 fewer with the draft.--cudagraph-capture-sizes 1 2 4 8 16 32 64: decode graphs cover up to 64 requests. Graph capture at the default sizes, up to 80, does not finish on Inkling 2 Mini.
Loop controls and cache behavior
Each pass of the core keeps its own KV and convolution caches. Two options change the loop:
--inkling2-loop-num-passes N: run the core N times instead of three. With a DSpark draft, only the checkpoint's count is accepted. With--decode-monokernel, the count can be at most 4.--inkling2-loop-share-cache: the passes of a core layer share its KV cache, so the cache does not grow with the pass count. Each pass keeps its own convolution state.
Looped checkpoints do not support layerwise PD cache transfer or sequence-parallel prefill. A PD prefill server must pass --disaggregation-layerwise-interval 0.
Verify server readiness
After startup, ts serve prints a ts serve ready message with the gateway URL. To confirm that the engine has registered with the gateway, request the readiness endpoint. If you set --host or --port, replace the loopback address and port with values that reach your gateway:
curl --silent --show-error \
--output /dev/null \
--write-out '%{http_code}\n' \
http://127.0.0.1:8000/readinessWhen the server is ready, the command prints 200:
200