talira

inference-optimisation

Agent skill for hill-climbing local LLM serving speed on any hardware and quantization

open sourceMITself-hostablefree

inference-optimisation is an agent skill that has a coding agent tune a local LLM server for speed: single-user and concurrent decode, speculative decoding, prefill, KV cache size, startup time and time to first token, under a memory cap. The agent first computes the theoretical ceilings for the model on the hardware, then changes one thing at a time, measures each candidate between interleaved control runs, logs every result in a ledger and accepts a change only when it beats both neighbouring controls without regressing anything. Every result must pass a long-context needle check and a concurrent full-KV soak before a pinned clean build is published. It ships a standard-library Python and bash harness (bench.py for any OpenAI-compatible server, ceiling.py, a serialized run queue and a memory reporter) and reference notes on levers and known traps in vLLM, SGLang, llama.cpp and ExLlama on Intel, NVIDIA, Apple and AMD hardware. It works with Claude Code and any agent that loads SKILL.md skills, and PROMPT.md lets any model follow it.

Problems it solves

  • my local LLM decodes far slower than the GPU's memory bandwidth says it should
  • I don't know what tokens per second is even possible for this model on my machine
  • speculative decoding made my local model slower instead of faster
  • every flag tweak gives a different benchmark number and I can't tell real wins from noise
  • tune vLLM or SGLang settings for my GPU without spending a week on it
  • prefill on 128K-token prompts takes forever on my local server
  • fit a bigger KV cache for long context into my GPU's memory cap
  • my model server takes two minutes to start and the first token is slow
  • a config that benchmarked fastest crashed under concurrent long-context load
  • let my coding agent benchmark and tune my inference server overnight
  • measure tokens per second correctly instead of counting stream chunks

Features

  • theoretical decode, prefill, TTFT, startup and KV ceilings (ceiling.py)
  • benchmark harness for any OpenAI-compatible server (bench.py)
  • interleaved control/candidate runs with medians of at least six samples
  • ledger of every result, including failures
  • long-context needle retrieval gate and concurrent full-KV soak
  • memory cap watchdog, including unified-memory GPU residency
  • serialized, detachable run queue (queue.sh)
  • reference notes on levers and gotchas for vLLM, SGLang, llama.cpp and ExLlama
  • publishing checklist with six acceptance gates and pinned clean builds
  • PROMPT.md for agents that don't load skills