agentsclimarketplace

Ai inference perf

Skill ggrace519/claude-code-dev-studio/skills/ai-inference-perf

Inference performance and cost specialist. Auto-invoked when inference latency, throughput, token cost, batching, quantization, KV caching, or GPU scheduling is being tuned.From its SKILL.md

Install
npx -y skills add ggrace519/claude-code-dev-studio --skill ai-inference-perf

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.5 KB, as published. Nobody here has run it

AI Inference Perf

Serving-layer changes compound across every request — this is where the cost and latency wins live. Every perf change is also a potential quality regression in disguise, so measurement and quality gates travel together.

When to reach for this

  • TTFT, TPOT, or token cost needs to come down for an existing workload
  • Choosing or tuning a serving stack (vLLM, TGI, TensorRT-LLM, llama.cpp, hosted APIs)
  • Adding quantization, batching, KV/prefix caching, or speculative decoding
  • Setting up perf regression guards alongside the quality gates

Principles

  1. Measure before changing. Baseline TTFT, TPOT (time per output token), throughput (tok/s), and cost per 1K tokens — at realistic concurrency, p50 and p95, never averages alone.
  2. Quality-gate every perf change. Run the golden set before and after; quantization that drops task quality is a regression no matter what it saves.
  3. Cache before compute. Prompt/prefix caching, then semantic caching, then response caching — in that order. On hosted APIs, structure prompts static-prefix-first so cached tokens hit the provider's discounted rate.
  4. Batch when latency allows. Continuous batching (the vLLM/TGI default) multiplies throughput at a modest TPOT cost — tune max batch size against the p95 latency budget, not peak throughput.
  5. Long prompts dominate. Chat-history and RAG workloads spend most compute on prefill; prefix caching and prompt trimming win disproportionately there.
  6. Track cost per successful interaction. Per-token cost is a proxy; a cheaper model with a higher retry/failure rate costs more per useful outcome.

Optimization order

LeverTypical winQuality riskReach for it when
Prompt/prefix cachinglarge on shared-prefix workloadsnonealways first
Trim prompt / cap output lengthlinear in tokens cutlow — still eval itbloated system prompts, stale few-shots
Streaming + TTFT focusperceived latencynoneany interactive surface
Continuous batching2–10× throughputnone (TPOT rises slightly)self-hosted, concurrency > 1
Quantization (INT8, AWQ/GPTQ 4-bit)2–4× memory, faster decodereal — task eval requiredGPU memory-bound
Speculative decoding1.5–3× decode speedupnone (output distribution preserved)latency-bound, draft model available
Smaller / distilled modelstep change in costhigh — full evalquality bar has headroom

Pitfalls

  • Benchmarking at concurrency 1, deploying at 100 — batching changes every number
  • Quantizing on "perplexity looks fine" — perplexity is not a task eval
  • Streaming disabled, so users feel full generation time instead of TTFT
  • Cache hit rate unmonitored — a prompt edit that shifts the static prefix silently doubles cost with no functional symptom
  • Comparing serving stacks with different sampling params or max-token limits
  • Optimizing per-token cost while retries and truncated outputs erase the savings

Related: ai-eval (quality gates on perf changes), ai-rag (retrieval inside the latency budget), ai-finetune (serving adapters) · domain agent: ai-architect (model selection, serving topology, cost/latency budgets) · output/ADR format: playbook-conventions

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.