/inferencekit:optimizing-inferencefrom inferencekit
Optimizes ML model inference for speed, memory, and cost across text, image, audio, and video modalities. Runs reproducible experiments with quality and budget constraints.
Ships in inferencekit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Deliver reproducible code and evidence against the strongest tuned, supported baseline under the agreed quality policy. Record time, tokens/API cost and device cost. Unsupported checks are NOT RUN; missing proof is UNPROVEN.
inferencekit intake budget runs/<run-id> before long steps. Preserve existing spending authorization; never expand it silently. Keep secrets, access details and provider names out of artifacts.--no-cache-salt. Reuse needs a separate realistic workload. Speculation needs its own exactness proof when called lossless.Use starting questions. Reuse answers in the conversation and intake; ask only missing decisions in short batches. Do not require technical metrics, YAML or a plan from the person.
Quality has three choices: Exactly the same, Same quality, small differences, Prioritize speed. Separately establish permission to change the model itself, the main objective, spending, deadline and desired check-ins. A speed preference does not authorize architecture changes or unchecked quality loss.
No plan or plan approval is required by default. Show or create one only when requested; plan.md covers that optional path and legacy runs. Start once required choices and resource authorization are established. Record their source in state; do not ask again within that scope. For unattended runs use non-interactive.md.
Existing run: first call inferencekit intake resume runs/<run-id>; inspect files for reported issues or required details (state.md).
Fresh run:
inferencekit intake template > intake.yaml # only when no intake was supplied
inferencekit intake validate intake.yaml --allow-placeholders
inferencekit intake validate intake.yaml --run-dir runs/<run-id>
export INFERENCEKIT_RUNS_DIR="$PWD/runs/<run-id>/evidence"
inferencekit intake budget runs/<run-id>
Use the derived run id; --run-dir pins the intake and starts the clock. SSH runtime and client share the device host.
Validate intake; pin revision, component precisions, processing, dataset, shapes and output work. Derive workload details from examples/logs (workload.md); record assumptions.
Choose response latency, sustained throughput, peak memory or affordable hardware under a latency/quality limit (affordability.md). Apply a requested compute resource policy. Token metrics and GSM8K belong to text workloads. Speech needs content, completion and speaker checks; images need semantic/visual checks; video needs temporal checks. Other architectures need a registered task-specific adapter and protocol; unsupported CLI modalities remain UNPROVEN rather than being relabelled as text.
Use researching-optimizations now, from the pinned model, shapes, hardware and runtime. It returns a short experiment queue, including existing engine paths to try before custom code.
Run inferencekit doctor. Check competing work, memory, swap, thermals and profiler permissions before occupying the device. Stop only the run's own jobs; do not kill unrelated services to obtain a clean measurement.
On NVIDIA, measured ceiling bw and roofline inform supported text models. Elsewhere use the hardware route and vendor measurements; a PyTorch CUDA namespace does not establish NVIDIA-tool support. For phones, capture the SoC, OS, runtime placement and thermal state on-device and use its supported timers. For non-token workloads derive bytes/FLOPs per request or step with assumptions. Unsupported ceilings stay NOT RUN.
Estimate critical-path share, attainable efficiency, exact byte savings and permitted algorithmic savings (ceilings.md, stop-point.md). Recompute after changing precision or work. An inferred ceiling orders experiments; it cannot establish a speedup.
For build routes, text uses the engine skeleton. Other models use their native pipeline and custom-engine contract.
For phone speech concurrency use the on-device speech capacity protocol. Use harness-commands.md for text, affordability.md for image/audio and video.md for video. Screen representative cases before full rounds. Text screens include short and long lengths. Promote secondary wins the user values without hiding the lead metric.
Final comparisons use balanced fresh-process rounds, excluded warmup, registered stopping and confidence intervals. Include complete output work and transfers/synchronization/decoding. Capacity needs its own tuning and measured concurrency.
Load proving-correctness and the selected policy. Exact-output claims need equality on the declared deterministic/seeded contract; a lossless label alone does not prove it. Lossy tracks need agreed task/perceptual bounds, not accidental bitwise rejection. Preserve structural validity, finite outputs and completion in every track.
For text, run applicable gates, reference trajectory/score, full task evaluation and sampling checks. Image/audio/video use registered semantic, structural and perceptual checks instead of token gates or GSM8K. Missing human listening/viewing remains UNPROVEN. Approval frequency changes when to ask, never whether quality has been established.
Rank experiments by headroom, cost and confidence. Refresh research after two stalled attempts or changed bottleneck/toolchain. optimizing-kernels routes compiler inspection and conditional techniques.
At a met target follow goals.after_target. Otherwise continue within the approved scope and stop rule. With no target, honor the agreed check-in preference; do not repeatedly request approval for an already authorized search.
Default stage time boxes and reporting reserve come from intake. Explicit budget.stage_timeboxes: false or report_reserve_h: 0 override them. A finite deadline still binds. "Unreachable" and "no headroom" are verdicts, never stops under a stated deadline; pursue another useful lever while resources remain. Unavailable devices, evidence or permission are recorded honestly.
Use compiler inspection: source → graph → dispatch → executed kernel. Check fusion/fallbacks/conversions, form one hypothesis, change one cause, screen quality and measure the complete inference path. Inspect IR/assembly when useful.
Run independent implementation experiments in parallel under parallel.md. Integrate one candidate at a time; serialize device measurements and avoid host contention. Reuse previous numeric-only rejects when policy broadens, with new evaluation and preserved history (fidelity.md).
Keep a commit and screen evidence per retained change. Milestone/final checks follow state.md: text uses existing light/full jobs; other modalities use registered checks. Final proof applies to the commit you hand over. No full evaluation after every small edit; no published claim from a screen alone.
At freeze, one claims-skeptic reviews draft, diff, intake and evidence while final proof runs. Answer refutations with evidence. With zero reserve, keep validation and packaging current through the deadline.
Use the shared report format and final reply: Result, Run it, Files and outputs, then Details. The plain-English summary requirements are in stop-point.md, "Summary". Separate end-to-end from kernel gains, exact from cross-precision tracks, and screened from verified results. Keep material limits visible in Result; retain unsuccessful attempts and time/cost accounting in Details.
Keep the manifest, reproduce commands, ledger and report consistent with the final commit. Run inferencekit review build runs/<run-id> and inferencekit manifest validate runs/<run-id>/manifest.json --strict. No freeze (no stage 7): one claims-skeptic on the draft before the host is released. Push only within explicit authorization. Record final spend and release resources as authorized.
After the final report, check the result for an optional engine contribution. Prepare a qualifying contribution locally, then open its PR when the user authorizes publication; reuse an explicit opt-in already recorded for this run. A declined contribution stays local. Missing proof or publication access does not restart optimization or hold rented hardware open.
Shipped read-only agents: engine-scout, quant-scout, profile-analyst, claims-skeptic, log-reader. Implementation workers may write kernels concurrently in isolated files/branches. One coordinator integrates; one owner per device serializes measurements. See parallel.md.
references/affordability.md (opens in a new tab)references/candidates.md (opens in a new tab)references/capacity.md (opens in a new tab)references/ceilings.md (opens in a new tab)references/engine-contribution.md (opens in a new tab)references/fidelity.md (opens in a new tab)references/harness-commands.md (opens in a new tab)references/intake.md (opens in a new tab)references/ledger.md (opens in a new tab)references/manifest.md (opens in a new tab)references/non-interactive.md (opens in a new tab)references/parallel.md (opens in a new tab)references/parallelism.md (opens in a new tab)references/plan.md (opens in a new tab)references/remote-host.md (opens in a new tab)references/resource-policy.md (opens in a new tab)references/speculative.md (opens in a new tab)references/starting-questions.md (opens in a new tab)references/state.md (opens in a new tab)references/stop-point.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kittenml/inferencekit --plugin inferencekit9 skills in this plugin
/benchmarkingMeasure end-to-end inference latency, throughput, memory and cost against tuned baselines with balanced rounds and quality evidence. Use for engine/config comparisons and performance claims. Route text, image, audio and video to their own client timers and protocols; isolate device measurements./evaluating-quantizationChoose a compressed model format by measuring memory, complete-request speed and task/perceptual quality on the exact target hardware. Use for quantization, lower precision or fitting a model on cheaper hardware. Respect the chosen quality policy and separate model-change permissions./inference-triageRoute inference performance questions for text, image, audio, video and other models to the cheapest useful evidence: latency, throughput, memory, hardware cost or quality. Use when unsure where to start; select tools for NVIDIA, AMD, Apple Silicon or CPU and preserve resource authorization.Other plugins' skills for the same job