inference-optimisation-skill README

README проекта с github.com/sybil-solutions/inference-optimisation-skill. Одним файлом markdown: README.md.

inference-optimisation

An agent skill for hill-climbing the speed of a local LLM server on any hardware and any quantization. It covers:

It works under a memory cap, and every result has to survive a full-context stability check.

It encodes how we actually got these speedups. It is not a list of flags. The workflow:

  1. Compute the theoretical ceiling.
  2. Change one thing at a time.
  3. Measure against interleaved controls.
  4. Log every result, including the failures.
  5. Gate on long-context retrieval.
  6. Qualify a clean, pinned build before publishing.

It works with Claude Code and any agent that loads SKILL.md-style skills. Any model can also follow it from PROMPT.md.

What we've been able to accomplish

Results from the hill-climbs this skill was distilled from. Every number was measured on the hardware named; see the linked sources for methods and raw data.

Hardware Model / quant / engine Before → after
Intel Arc B390 iGPU (laptop, 64 GB unified LPDDR5X, ~115 GB/s) Ornith-1.5-35B-A3B, EXL3 4 bpw, SGLang XPU + MTP Decode, 1 user: 43.6 → 53 tok/s (median)
Decode, 4 users: 84.7 → 103 tok/s
Prefill 32K: 1,037 → 1,660 tok/s
Prefill 256K: 297 → 628 tok/s (2.1×)
KV cache: 264K tokens → 4 × 256K
Startup: 113 → 43 s
Registry Lab gates: decode 28.6 → 41.0, prefill 255 → 667
Intel Arc Pro B70 Qwen3.8-27B, EXL3 4 bpw, vLLM + custom XPU kernels Decode: 91.2 tok/s at 1 user, 365 at 16 (prose, thinking on)
Same card with llama.cpp Q4_K_M: 25.0
Prefill 4K/32K/128K/254K: 1,654/1,434/928/650 → 2,421/2,259/1,415/911
Agent-session replay: 193 → 147 s
Intel Arc Pro B70 Same model, SGLang + the same kernels Decode, 1 user: 82.6 tok/s, vs vLLM 75.7 on the same card and day
RTX 3090 Qwen3.8-27B EXL3 3 bpw + MTP 96.2 tok/s prose / 141.1 code, 1 user
RTX 3090 Qwen3.6-35B-A3B EXL3 3 bpw + MTP 251.7 / 357.9 tok/s, 1 user
RTX 3090 Flash-Next EXL3, 256K context MTP: 45.5 → 65.6 tok/s
4× H200 NVL DeepSeek-V4.1-Flash, vLLM + speculative decoding Crashed under load → 229.1 tok/s decode, 17,546 tok/s prefill; all six gates pass

Sources:

Reading the B390 result

That run is the one this skill grew out of. Its ceiling calculation said:

The skill makes the agent compute this up front, so it can tell you early when a target is above the physics.

How it works

                ┌────────────────────────────────────────────────────────────────┐
  measure HW ─▶ │ THEORY.md: bytes/token ÷ bandwidth, FLOPs/token ÷ 50% peak, KV │
                └────────────────────────────────────────────────────────────────┘
                                         │
    baseline ─▶ profile ─▶ pick lever (ceiling gap × likelihood) ─▶ configs/NEW.json
                    ▲                                                     │
                    │                                    queue.sh ctl NEW ctl (serialized, AC-only,
                    │                                    memory watchdog, ≥6 samples, medians)
                    │                                                     │
   PLAN.md + ledger.jsonl ◀── accept only if it beats BOTH neighbouring controls ──┘
          │                    and regresses nothing by >3%
          ▼
  long-context needle gate ─▶ concurrent full-KV soak ─▶ plateau? ─▶ pinned clean build
                                                                      ─▶ acceptance gates ─▶ publish

The skill has three parts:

SKILL.md: the procedure.

references/: loaded only when needed.

scripts/: a small, engine-agnostic harness. It is standard-library Python plus bash.

Install

Claude Code (user-level):

git clone https://github.com/sybil-solutions/inference-optimisation-skill
mkdir -p ~/.claude/skills
cp -r inference-optimisation-skill/skills/inference-optimisation ~/.claude/skills/

Then ask, for example:

Other agents: point them at skills/inference-optimisation/SKILL.md, or paste PROMPT.md as the task prompt.

Quick start without an agent

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

Principles that carried the most weight

Contributing

PRs with new levers, gotchas or results are welcome. Each needs the hardware, model, quantization, engine version, before → after numbers, how they were measured, and a link to raw data.

License

MIT

inference-optimisation-skill (sybil-solutions/inference-optimisation-skill)

Ищем в базе…

Что это такое?Это навык для агента, который пошагово ускоряет работу локального сервера LLM: декодирование, спекулятивное декодирование, prefill, KV-кэш, запуск и время до первого токена, на любом железе и при любой квантизации. Работает с Claude Code и с любым агентом, который загружает навыки в формате SKILL.md.
Это движок для инференса или что-то другое?Ни движок, ни справочник по флагам. Это процедура (SKILL.md) с справочными документами и небольшим набором для бенчмарков, по которой агент настраивает ваш уже работающий сервер.
Как начать пользоваться?Установите его как навык пользователя в Claude Code, а затем попросите что-то вроде «ускорь декодирование и prefill для модели на :8000 при ограничении 40 GiB». Другие агенты могут прочитать SKILL.md или использовать PROMPT.md как текст задачи.
Что нужно установить на компьютер заранее?Уже запущенный локальный LLM-сервер с API, совместимым с OpenAI, а также Claude Code или другой агент, который загружает навыки в формате SKILL.md. Входящим в комплект скриптам достаточно Python и bash.
Есть ли подводные камни, о которых стоит знать заранее?Результаты одного запуска часто оказываются шумом в ±5–10%, поэтому навык требует чередовать контрольные запуски и брать медианы. Опубликованные результаты получены на конкретных конфигурациях Intel Arc и NVIDIA, так что ваш выигрыш может отличаться.
На каком железе это тестировали?Результаты измерены на GPU Intel Arc B390 и B70, RTX 3090 и 4x H200 NVL. Скрипт mem.sh также учитывает резидентную память драйвера на GPU с унифицированной памятью, которую cgroups не видят.
Зачем его сделали, а не составили список флагов?В нём зафиксирован реальный путь, которым находили ускорения, включая неудачи. Поэтому агент сначала вычисляет теоретические пределы и не гонится за целями, которые железо не может выдать.
Насколько большими были ускорения, из которых его вывели?На ноутбуке Intel Arc B390 с моделью на 35B декодирование для одного пользователя выросло с 43,6 до 53 tok/s, а prefill на 256K с 297 до 628 tok/s при пределе примерно 670 tok/s.
Можно ли доверять цифрам скорости?Количество токенов берётся из статистики использования сервера, а не из потоковых фрагментов. Каждый запуск записывается в ledger.jsonl, а результат засчитывается как лучший только после проверки извлечения информации по всему контексту.
Автор
sybil-solutions
Размер
<0.1 MB
Звёзды
916
Обновлён
КоммитNov 16
Возраст
2 д
Коммиты · 90 дней