The AI Gazette

Local modelsCoding agents

Hugging Face let a coding agent tune Inkling 2 Mini on one GPU

Hugging Face gave a coding agent its inference-optimisation skill, the hf command line tool and Hugging Face Jobs, then let it tune Inkling 2 Mini on one RTX PRO 6000. Across 46 valid runs, single-user decoding rose from 136 to 190.6 tokens per second with lossless speculative decoding in a vLLM nightly build.

Inkling 2 Mini, from Thinking Machines, has about 26 billion parameters, of which 3 billion are active for each token, a context window of a million tokens and image input. Its design is unusual: a looped mixture-of-experts model with 24 physical layers whose middle 12 run three times, so every token passes through 48 layers. It ships with a small drafter model for speculative decoding. Both vLLM and SGLang support it in nightly builds, but their published recipes target Nvidia's B200 and GB300 data-center chips, leaving out workstation cards such as the RTX PRO 6000 with 96 GB of memory.

Niels Rogge at Hugging Face handed the job to a coding agent. The inference-optimisation skill gives it a fixed protocol: measure the hardware and estimate its theoretical limits first, change one variable at a time, and bracket every candidate between two control runs, keeping a change only if it beats both without hurting other measures. Every run, dead ends included, goes into a plan file, and a winner must pass long-context, concurrency and output-equivalence checks. The agent ran its experiments as Hugging Face Jobs on the same GPU type as the company's inference endpoints, at $2.75 an hour, testing SGLang and vLLM in parallel.

When a setting was undocumented, the agent started a cheap CPU job to search the installed engine's source inside its container, which is how it found hidden SGLang environment variables and vLLM's speculative decoding options. The baseline, SGLang without speculation, decoded about 136 tokens per second for one user. Switching to vLLM nightly alone gave 157. Turning on the bundled drafter with seven draft tokens and probabilistic draft sampling raised it to 190.6, steady across four runs, and aggregate throughput for eight users rose from about 570 to 716 tokens per second.

Getting there took two memory settings. vLLM with the drafter twice died at startup with a generic error while the real cause sat 200 lines up the log. The default million-token cache needed more memory than was free next to the drafter, so the agent capped context at 262,144 tokens. A newer vLLM default then let the cache claim all remaining memory and starve the drafter, until memory use was capped at 85%. The team's driver script now prints every error line from the server log instead of only the last few.

The agent also worked out why the speed stops near 190. It measured the card's copy bandwidth at 1,469 GB per second and read the model's tensor sizes from its files. With 48 layer passes per token, plain decoding rereads several gigabytes of weights for every token, which sets a ceiling of about 256 tokens per second for one user. Speculative decoding checks several drafted tokens at once, which wakes far more experts in each layer, so the ceiling falls to about 201. At 190.6, the setup already uses about 95% of the hardware's bandwidth.

Most candidate settings were unsupported, noisy or slower. Shorter draft lengths were rejected at startup because both engines enforce the checkpoint's fixed block size, and greedy draft sampling cut vLLM's speed by 11% at the model's default temperature. One SGLang option looked like a 4% gain on its first run but failed to repeat against fresh controls; SGLang's results swung by about 4.5% between identical runs, against 0.4% for vLLM. The team skipped options that change the output distribution, since it wanted a strictly lossless speedup.

Before deploying, the team pinned the exact vLLM nightly image and ran its acceptance checks inside a job. Needle retrieval passed three of three at about half and at 95% of a 262,144-token context, four parallel requests of about 58,000 tokens all succeeded, and greedy outputs were byte-identical with and without speculation on all six test prompts. One command then deployed the endpoint, pinned to the image digest and model revision and set to scale to zero after an idle hour. Against the live endpoint, single-user decoding measured 194.9 tokens per second.

All logs, scripts, plans and raw measurements are in a public repository, NielsRogge/inkling-2-mini-hillclimb. To reuse the loop on another model, the post says to put candidate and control server commands into a plan file and submit it to the Jobs GPU type that matches the target endpoint. Going past 190 tokens per second, the team notes, would need a drafter that guesses right more often at the default temperature, or a verification step that touches fewer experts in each layer.

From other editions

Say hi.