sybil-solutions/inference-optimisation-skill
Agent skill for hill-climbing local LLM serving speed (decode, speculative decoding, prefill, KV, startup, TTFT) on any hardware and quantization
What it solves
Speeding up a local LLM server is usually guesswork: people flip random flags and hope for the best. This project replaces that with a disciplined, repeatable process for "hill-climbing" performance — making a server faster step by step on any hardware and any quantization. It covers single-user and concurrent decoding, speculative decoding, prefill speed, KV cache size, startup time, and time to first token, all under a memory cap. Crucially, it is a procedure, not a list of flags: every claimed speedup must survive a full-context stability check before it counts.
How it works
The skill encodes a six-step workflow: (1) compute the theoretical speed ceiling from hardware bandwidth and FLOPs, (2) change one thing at a time, (3) measure against interleaved control runs, (4) log every result including failures, (5) gate on long-context retrieval, and (6) qualify a clean, pinned build before publishing. It has three parts:
- SKILL.md — the procedure itself: inventory, ceilings, ground rules, the loop, lever order, when to stop, and how to publish.
- references/ — deep-dive docs loaded only when needed: how to compute ceilings, measurement traps, every lever with evidence, known gotchas per engine and hardware, and publishing rules.
- scripts/ — a small engine-agnostic harness in standard-library Python and bash:
bench.pybenchmarks any OpenAI-compatible server (startup, time-to-first-token, decode, prefill, long-context needle retrieval, peak memory with a watchdog);ceiling.pycomputes theoretical limits;queue.shserializes interleaved control/candidate runs;mem.shreports real memory including GPU driver residency that cgroups miss.
A change is accepted only if it beats both neighbouring control runs and regresses nothing by more than 3%. The README includes measured results: for example, on an Intel Arc B390, decode went from 43.6 to 53 tok/s, 256K prefill from 297 to 628 tok/s, and startup from 113 to 43 seconds; on 4× H200, decode reached 229.1 tok/s and prefill 17,546 tok/s.
Who it's for
People running local LLM servers who want to make them faster in a rigorous, evidence-based way. It works with Claude Code and any agent that loads SKILL.md-style skills, and any model can follow the same procedure from PROMPT.md. You can also use the scripts directly without an agent.
Highlights
- Encodes a proven methodology distilled from real speedups, not a list of flags
- Computes theoretical ceilings up front, so you can tell early when a target is physically impossible
- Fights measurement noise (±5–10%) with interleaved controls and medians
- Measures real tokens, real prompt lengths, and real memory including GPU residency
- Requires exact-match long-context needles and a concurrent full-KV soak before anything is called "best"
- Treats the log of failed attempts as part of the value
- MIT licensed, with contributions welcome for new levers, gotchas, and results
Related
- Project
- Project
- Project
- Project