inference-optimisation-skill

An agent skill that walks an AI agent through speeding up a local LLM server one measured change at a time, starting from a calculated theoretical ceiling and finishing with a long-context stability check before anything is published.

  • 1.3k GitHub stars
  • ⚖️ MIT

Last verified: write-up checked

git clone https://github.com/sybil-solutions/inference-optimisation-skill
inference-optimisation-skill — skill preview

What it is

Inference Optimisation is a skill for an agent that is asked to make a local LLM server faster. It covers single-user and concurrent decode speed, speculative decoding, prefill, KV cache size, startup time and time to first token, always under a memory cap. The README says it encodes how the authors actually got their speedups and that it is not a list of flags. The procedure is explicit. The agent first computes the theoretical ceiling for the model and the machine, then changes one thing at a time, measures against interleaved controls, logs every result including the failures, and only accepts a change that beats both neighbouring controls without regressing anything by more than 3 percent. Before a result counts it has to pass a long-context retrieval check and a concurrent full-KV soak test, and a clean pinned build is qualified before anything is published. The repository has a SKILL.md with the procedure, reference notes that are loaded only when needed (including how to compute decode, prefill, time-to-first-token, startup and KV maxima, with a worked example) and Python and shell scripts for ceilings, benchmarks and a serialized queue. The README also lists measured before-and-after numbers on named hardware, such as an Intel Arc B390 laptop and an RTX 3090; those are the authors' figures. We read the README and did not run the skill.

Who it's for

  • People who run a local LLM server and want more tokens per second without breaking long-context quality
  • Engineers tuning speculative decoding, prefill or KV cache size under a memory cap

Requirements

Requirements

  • A running local LLM server, for example one reachable on a local port
  • Python 3 for the bundled scripts
  • Claude Code or another agent that loads SKILL.md skills, or any model given PROMPT.md

Setup

  1. Step 1

    bash
    git clone https://github.com/sybil-solutions/inference-optimisation-skill
  2. Step 2

    bash
    mkdir -p ~/.claude/skills
  3. Step 3

    bash
    cp -r inference-optimisation-skill/skills/inference-optimisation ~/.claude/skills/

مهارة وكيل ذكي تقود الوكيل لتسريع خادم نموذج لغوي محلي بتغيير واحد مقيس في كل مرة، بدءا بحساب السقف النظري وانتهاء بفحص ثبات على سياق طويل قبل نشر أي نتيجة.

Examples

Hill-climb a server under a memory cap

Prompt
prompt
hill-climb decode and prefill for the model on :8000 under a 40 GiB cap

Expected output: An example request from the README after installing the skill.

Ask for the theoretical maximum

Prompt
prompt
what's the theoretical max tok/s for this model on this machine?

Expected output: The skill makes the agent compute the ceiling first, so it can say early when a target is above the physics.

Run the scripts without an agent

bash
bash
S=skills/inference-optimisation
python3 $S/scripts/ceiling.py $S/examples/ceiling-ornith-b390.json        # ceilings
mkdir -p configs && cp $S/examples/config-existing-server.json configs/base.json   # edit base_url/model
python3 $S/scripts/bench.py run configs/base.json --long 131072            # one run
bash $S/scripts/queue.sh base cand base                                     # interleaved A/B
python3 $S/scripts/bench.py show                                            # ledger table

What it does: The README's quick start for using the scripts directly.

Pros & cons

Pros

  • Pro:Starts from a calculated ceiling, so it can tell you early when a target is above what the hardware allows
  • Pro:One change at a time, accepted only if it beats both neighbouring controls and regresses nothing by more than 3 percent
  • Pro:Every result is logged, including failures, and a long-context needle check gates acceptance
  • Pro:Works with any agent that reads SKILL.md, or as a pasted prompt

Cons

  • Con:Needs hardware, a model and time: the hill-climb is a long measuring job, not a quick tweak
  • Con:The published speedups are the authors' own measurements on specific hardware and will not transfer one to one
  • Con:Most worked examples are Intel Arc, RTX 3090 and H200 setups with EXL3, SGLang or vLLM, so other stacks need adaptation