# Inkling-2-Small on 4× DGX Spark with a 4-bit KV cache (experimental)

Status: experimental. Measured: 2026-11-23 (page updated 2026-11-23). Web page: https://aidenle.com/recipes/inkling-2-small-nvfp4-kv-sglang-4x-dgx-spark/
Image: `aidendle94/sparkrun-sglang-inkling2-gb10:experimental-1.6`

The Inkling-2-Small recipe with its KV cache stored in 4 bits: the same memory holds 1.8 times the tokens, quality unchanged, and decode behind long contexts is faster. One script sets up all four nodes.

**Time:** One script; about 17 min to the first answer once the weights are on the nodes

**Result:** Inkling-2-Small with a KV cache of 1.41M tokens: 56.9 tok/s for one stream at temperature 1.0, 52.2 behind 500K tokens of context, 2,840 tok/s on a new 120K-token prompt

## What you need

- Four DGX Spark nodes with nothing else on their GPUs, linked by a RoCE network
- ssh without a password from one node to the other three, and Docker usable without sudo
- About 130 GB free in the home directory of every node

## Overview

> **Warning: Experimental.**
>
> - The same development image and hooks as [Inkling-2-Small on SGLang](https://aidenle.com/recipes/inkling-2-small-sglang-4x-dgx-spark.md), with the same open problems.
> - Served on one four-node fleet since 2026-11-23.
> - For long-session parallel tool calling and system-prompt adherence, use [the tool-call fix recipe](https://aidenle.com/recipes/inkling-2-small-tool-fix-sglang-4x-dgx-spark.md).

This recipe serves [Inkling-2-Small](https://huggingface.co/thinkingmachines/Inkling-2-Small) on four DGX Spark nodes with its KV cache, the model's memory of the conversation, stored in 4 bits (NVFP4) instead of 8. The same memory holds 1,409,000 tokens instead of 793,000.

Quality is unchanged on held-out text, and one request writes its answer at 56.9 tok/s at temperature 1.0. Behind 500K tokens of context it writes 52.2 tok/s, against 47.6 with the 8-bit cache.

> **Code.**
>
> Code (MIT): [github.com/aidendle94/sparkrun-recipes](https://github.com/aidendle94/sparkrun-recipes/tree/main/recipes/inkling-2-small/sglang-nvfp4-kv). Weights, about 93 GB a node: [aidendle94/Inkling-2-Small-DGX-Spark](https://huggingface.co/aidendle94/Inkling-2-Small-DGX-Spark). Image: `aidendle94/sparkrun-sglang-inkling2-gb10:experimental-1.6`. The image and weights have their own licences.

## Build

### Run it

1. **Find each node's fabric address.** It is the address on the 200G port: `ip -br addr` lists it next to an interface named like `enp1s0f0np0`.
2. **Let the first node log in to the others.** On the first node, run `ssh-copy-id <address>` once for each of the other three.
3. **Let your user run Docker on every node.** Run `sudo usermod -aG docker $USER`, then log out and in again.
4. **Run the script on the first node.** It checks every node, pulls the image, downloads each node’s 93 GB of weights, starts the fleet and sends a first request. If a step fails, it says what to fix; run the same command again.

setup · the first node:

```bash
git clone https://github.com/aidendle94/sparkrun-recipes
cd sparkrun-recipes/recipes/inkling-2-small/sglang-nvfp4-kv
./quickstart.sh 192.0.2.11 192.0.2.12 192.0.2.13 192.0.2.14   # your four fabric addresses, this node first

# Only the checks, nothing changed:
./quickstart.sh --check

# First request (port 8210 on the first node).
curl -s http://<first-node>:8210/v1/chat/completions -H 'content-type: application/json' \
  -d '{"model":"inkling-2-small","messages":[{"role":"user","content":"Is 91 prime?"}],"max_tokens":400}'
```

day to day:

```bash
./quickstart.sh --status          # serving? which KV cache on each node?
./quickstart.sh --stop            # stop the fleet and its watchdog
launch/relaunch.sh                # start or restart
KV_NVFP4= launch/relaunch.sh      # the same stack with the 8-bit (FP8) KV cache
```

## Performance

| Measured 2026-11-23, one boot each | 8-bit (FP8) KV cache | 4-bit (NVFP4) KV cache |
|---|---|---|
| KV cache, same memory | 793,000 tokens | 1,409,000 tokens |
| Held-out text, average loss (lower is better) | 1.4437 | 1.4437 |
| Lookups in a 130K-token context, 40 questions | 36 right | 35 right |
| One stream, short prompts | 54.0 tok/s | 56.9 tok/s |
| One stream, behind 130K tokens | 54.1 tok/s | 55.7 tok/s |
| One stream, behind 500K tokens | 47.6 tok/s | 52.2 tok/s |
| Cold prefill of 120K tokens, the same settings | 2,615 tok/s | 2,615 tok/s |
| Cold prefill of 120K tokens, this recipe’s larger prefill chunks | not measured | 2,840 tok/s |

The same stack and fleet on the same day, decode at temperature 1.0.

| Measured 2026-11-24, timed at the client | Greedy | Temperature 1.0 |
|---|---|---|
| One stream, 21 short prompts | 64.3 tok/s | 57.2 tok/s |
| Two streams at once, total | 85.4 tok/s | 85.8 tok/s |
| Eight streams at once, total | 164.1 tok/s | 148.4 tok/s |
| One stream behind 130K tokens | 49.0 tok/s | 49.2 tok/s |
| One stream behind 500K tokens | 47.2 tok/s | 42.2 tok/s |

Chat requests through the OpenAI-style endpoint, decode timed from the first to the last output. A cold 129K-token prompt took 46 s and a cold 498K-token prompt 276 s.

Measured: 2026-11-23, one boot each, against the 8-bit cache on the same day

Experimental: the Inkling-2-Small recipe with its KV cache in 4 bits (NVFP4), at temperature 1.0.

| Measurement | Value | Note |
|---|---|---|
| Prefill · cold, 30K / 120K tokens | 3,248 / 2,840 tok/s | Prompts the server has not seen, with the recipe's larger prefill chunks |
| Decode · one stream, temperature 1.0 | 56.9 tok/s | 16 coding questions with 400-token answers |
| Context | 524K tokens | Per request |
| KV pool | 1.41M tokens | The memory of 793K tokens of the 8-bit cache |
| Decode behind 500K tokens | 52.2 tok/s | One stream, against 47.6 with the 8-bit cache |
| Held-out text | 1.4437 loss | The same as with the 8-bit cache |

**Decode with the 8-bit and the 4-bit KV cache** (tok/s, one stream, temperature 1.0 · higher is better)

|  | 8-bit (FP8) cache | 4-bit (NVFP4) cache |
|---|---|---|
| Short prompts | 54 | 56.9 |
| Behind 130K tokens | 54.1 | 55.7 |
| Behind 500K tokens | 47.6 | 52.2 |

The same stack and fleet on the same day.

**Cold prefill with prefill chunks of 4,096 and 8,192 tokens** (tok/s on new prompts · higher is better)

|  | 4,096-token chunks | 8,192-token chunks (the default here) |
|---|---|---|
| 30K tokens | 2821 | 3248 |
| 60K tokens | 2820 | 3113 |
| 120K tokens | 2615 | 2840 |

Lower of two prompts per length on an idle fleet. The 8-bit cache prefills the same.

## Notes

#### If the script stops

- **Cannot log in without a password:** run `ssh-copy-id <user>@<address>` from the first node.
- **Docker does not answer:** add the user to the `docker` group on that node and log in again.
- **No RDMA device:** the 200G port of that node is not set up for RoCE.
- **Not enough disk:** free about 130 GB in that node’s home directory.
- **Not an address of this node:** run the script on the node you list first.

#### Known problems

- **The open problems of the 8-bit recipe apply here too:** see [Inkling-2-Small on SGLang](https://aidenle.com/recipes/inkling-2-small-sglang-4x-dgx-spark.md).
- **About one long lookup in ten ends without an answer** on either cache, because the model re-reads the context until it runs out of tokens.
