中
◀ Back to feed
GitHub

sybil-solutions/inference-optimisation-skill:给智能体用的本地推理调速技能

Published 2026-11-16 Collected 2026-11-20 20:00 AI news #ai
Full text

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

  • single-user and concurrent decode
  • speculative decoding
  • prefill
  • KV cache size
  • startup time and time to first token

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.

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:

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

  • Decode: 100 tok/s for one user was only reachable with two useful speculative drafts. This model's draft head accepts ~14% at depth 2, so the practical target was ~88–97 tok/s. We reached ~55% of it; the rest is GEMV kernel efficiency.
  • Prefill at 256K: we reached 628 tok/s against a ~670–684 tok/s ceiling.

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

                ┌────────────────────────────────────────────────────────────────┐
  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.

  • Inventory, ceilings, ground rules, the loop and lever order.
  • When to stop, how to qualify and publish, and how to report.

references/: loaded only when needed.

  • ceilings.md: how to compute decode, prefill, TTFT, startup and KV maxima, with a worked example.
  • methodology.md: measurement traps. Chunk-counted tokens, mis-sized prompts, acceptance counters, drift, unified-memory accounting.
  • levers.md: every lever with measured evidence. It is tagged general vs stack-specific.
  • gotchas.md: known traps in vLLM, SGLang, llama.cpp and ExLlama, and on Intel, NVIDIA, Apple and AMD hardware.
  • publishing.md: pinning, clean builds, the six acceptance gates, proving the build matches the best, results cards.

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

  • bench.py benchmarks any OpenAI-compatible server. It measures:
    • startup and short-prompt TTFT;
    • c1 decode (median of N) and cN aggregate decode;
    • cold prefill at several lengths;
    • long-context needle retrieval;
    • peak memory, with a cap watchdog. It flags looping output, failed requests and runs on battery. Token counts come from server usage stats, never from streamed chunks, and everything lands in ledger.jsonl.
  • ceiling.py computes the theoretical ceilings from a JSON of measured bandwidth and FLOPs plus component sizes.
  • queue.sh is a serialized, detachable run queue, for interleaving control/candidate/control runs.
  • mem.sh reports a container's real footprint. That includes driver residency on unified-memory GPUs, which cgroups don't see.

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:

  • "hill-climb decode and prefill for the model on :8000 under a 40 GiB cap"
  • "what's the theoretical max tok/s for this model on this machine?"

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

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
  • Ceilings first. If you don't know the maximum, you can't tell whether 53 tok/s is great or bad, or whether "100 tok/s" is possible.
  • Noise is ±5–10%. Most single-run "wins" are drift. Interleave controls and use medians.
  • Measure what matters:
    • real tokens, not stream chunks;
    • real prompt lengths, from the tokenizer;
    • real memory, including GPU residency on unified memory.
  • Speculative decoding is about per-step cost, not acceptance.
    • Prune the draft head's vocabulary.
    • Sweep draft length per concurrency and context.
    • Keep sampling on the GPU.
  • Prove full-context stability with exact-match needles and a concurrent full-KV soak before calling anything "best".
  • Write down failures. Most of the value in PLAN.md is the list of things that did not work and why.

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.

MIT

Source
Title
sybil-solutions/inference-optimisation-skill:给智能体用的本地推理调速技能
Author
—
Site
GitHub
Published
2026-11-16
Collected
2026-11-20 20:00 · 2026-11-20-20-ai.json
Link
https://github.com/sybil-solutions/inference-optimisation-skill
Open original ↗

Reposted. Will be removed on request. All rights belong to the original author.

More from this batch

20:00batch · 2026-11-2012 items
>

Anthropic IPO live updates: ANT stock price and Nasdaq debut

这是上次推送之后最重要的进展:股票于 11 月 19 日开盘 111.50 美元,收盘 97.17 美元,较 83 美元发行价上涨约 17%。Yahoo Finance 记录当日最高 115.10、最低 92.72 美元,成交约 8.53 亿股。CNBC 称本次发行筹资 813 …

CNBC
>

Has DeepSeek's 100-billion-yuan round landed? 31 investors come into view

第一财经 11 月 19 日 16:23 报道(上一期 20:07 推送前已刊出,本期补录),企查查显示杭州深度求索注册资本由约 1645 万元增至 1991.87 万元,新增股东杭州程砚;该平台同期新增 31 家合伙人,腾讯与宁德时代体系出资比例并列前列,另有中国移动、中信证券…

第一财经
>

The Information:英伟达接近以逾 5 亿美元收购扩散模型公司 Inception(报道,尚未宣布)

多家媒体转述 The Information 的报道称,英伟达正与 Inception(Mercury 扩散语言模型团队)进行后期洽谈,对价至少约 5 亿美元,还可能包含业绩对赌;交易尚未签署或官宣,报道称创始团队将加入英伟达。这仍是独家报道,不是双方声明。

The Information
>

苹果被曝在招人,要做能操控 Mac 的自有 AI 智能体(11 月 19 日)

TechCrunch 和 The Verge 根据招聘信息报道,苹果可能在开发一款可在 Mac 上运行、帮用户完成电脑操作的自有智能体。这还不是产品发布,只是招聘与报道层面的线索,细节以苹果之后的正式说明为准。

TechCrunch
>

谷歌开始把 AI 对话直接放上搜索首页(11 月 19 日)

The Verge 报道,谷歌正在把 AI 聊天入口放到搜索首页,而不只是藏在搜索结果里的 AI 模式中。具体覆盖范围和是否可关闭,请以谷歌产品说明和原文为准。

The Verge
>

薯片袋触发校园枪支警报后,两名学生起诉学校和警方(11 月 19 日)

Ars Technica 报道,美国一起校园 AI 武器检测误报导致两名青少年被警察制服,两人已提起诉讼。这是公共场所视觉识别落地时误报代价的一个具体案例,细节以诉状和报道为准。

Ars Technica
>

Introducing Tool Retrieval in the Gemini API

谷歌官方介绍,当应用挂了大量工具时,模型不必每次都看完整工具列表,而是先检索可能相关的工具再决定调用。这对工具很多的企业 Agent 有直接意义:可以降低提示开销,也减少无关工具干扰。能力边界和配额以官方文档为准。

Google
>

Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth

上一期未收入。苹果机器学习研究放出 Depth Pro 2,可从照片、视频或实时画面估计以米为单位的深度,并强调物体边缘更锐、帧间更稳定。仓库提供 S/B/L/H+ 等多档模型及 Core ML 包,权重为研究用途。论文编号 arXiv:2611.26603。

arXiv
>

NVIDIA 介绍用 Dynamo 缓解强化学习 rollout 瓶颈(11 月 19 日)

官方技术博客讨论在强化学习训练里,生成轨迹(rollout)常常卡住吞吐。文章介绍如何用 NVIDIA Dynamo 把这部分流水线理顺,让训练不必长时间等采样。适合正在做 RL 后训练或智能体强化学习的团队对照自己的栈。

NVIDIA
>

NVIDIA:用 GPU 原生数据采集,让科学仪器能跑实时 AI(11 月 19 日)

官方博客介绍把科学仪器的数据采集直接放到 GPU 上处理,减少数据搬运,从而在实验现场做实时推理。这对同步辐射、显微镜或探测器一类场景有参考价值,不是面向普通聊天应用的更新。

NVIDIA
>

Science 观察 Agent AlphaXiv:35 个实验室放出 936 个智能体,12 周写出 936 篇预印本(11 月 19 日)

《Science》11 月 19 日下午的特稿记录了一场为期 12 周的实验:35 个人类实验室部署的智能体在专属预印本服务器上互相交流、写代码、做实验并发布 936 篇研究,还自建了同行评议期刊。文章提醒这些是预印本而非传统期刊论文,质量参差,但提供了一个观察「智能体科研社区」…

Science
>

Claude solves two open problems in the physics of black holes

官方文章署期 11 月 17 日,上一期未收入;本期 Hacker News 讨论升温。Anthropic 称 Claude Fable 5.2 完成了两项与量子引力和黑洞有关的计算:其一补完了 2003 年提出但一直未做完的相变计算,显示黑洞形成对应的突变在时空不再有明确形状时…

Anthropic