agentleFS
saint0xsaint0x/my-skills/inference-engineering/SKILL.md

inference-engineering

Skill1 starsChanged 3 months agoMITView on GitHub

Use when building, tuning, serving, or benchmarking inference engines and model runtime paths. Especially useful for streaming tokens/sec, aggregate throughput, KV/cache pressure, allocator headroom, saturation, queueing, latency percentiles, checkpoint export, serving profiles, and rollback-safe deployment.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the goal is to make inference faster, larger, more reliable, or more useful to a real user.

    line 8
  2. Distinctive:

    Do not collapse inference into one tokens/sec number.

    line 12
  3. Distinctive:

    Run a tiny streaming smoke before the large test.

    line 48
  4. Distinctive:

    Keep goal-specific profiles instead of pretending one profile wins every workload.

    line 52
  5. Distinctive:

    Treat speculative decoding as workload-dependent, not automatically faster.

    line 74
  6. Distinctive:

    Do not claim a memory feature improves decode speed unless measured directly.

    line 76
  7. Distinctive:

    Keep rollback profiles available before replacing a safe serving path.

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Inference Engineering

Use this skill when the goal is to make inference faster, larger, more reliable, or more useful to a real user.

Principle

Do not collapse inference into one tokens/sec number. Separate user-visible speed, aggregate throughput, memory capacity, latency, queueing, and serving reliability.

Measurement Surfaces

Single-user streaming:

  • streaming only
  • first-token latency
  • output tokens/sec after first token
  • generated tokens, not prompt tokens
  • stable sampling settings
  • multiple repeated prompts

Aggregate serving:

  • completed tokens/sec
  • successful requests
  • failed requests and error types
  • concurrency sweep
  • p50/p90/p99 latency
  • queue delay
  • tokens/sec/GiB or tokens/sec/watt when relevant

Memory pressure:

  • admitted context frontier
  • live successful requests near the frontier
  • allocator budget and observed allocation
  • OOM/rejection behavior
  • throughput tradeoff at the new frontier

Engine Tuning Workflow

  1. Define the goal: chat speed, aggregate throughput, capacity, latency, or stability.
  2. Record the exact launch profile: engine, dtype, cache budget, context, batching, scheduling, speculative settings, and environment variables.
  3. Warm up the server.
  4. Run a tiny streaming smoke before the large test.
  5. Change one meaningful variable at a time.
  6. Benchmark the regime the user cares about.
  7. Inspect server logs for queueing, fallback paths, memory pressure, and kernel/runtime warnings.
  8. Keep goal-specific profiles instead of pretending one profile wins every workload.

Serving And Export

For production model handoff, record:

  • base model
  • adapter/checkpoint path
  • manifest hash or lineage metadata
  • tokenizer sidecars
  • dependency stack and vendor torch/runtime path
  • serving bundle path
  • registered model/profile name
  • launch command
  • smoke prompts
  • rollback path

Smoke through the path the user will actually use. If the product uses a harness, test through the harness. If chat must stream, do not accept a non-streaming smoke.

Optimization Rules

  • Optimize single-user streaming and batch saturation differently.
  • Treat speculative decoding as workload-dependent, not automatically faster.
  • Measure prefill-bound and decode-bound regimes separately.
  • Do not claim a memory feature improves decode speed unless measured directly.
  • Include errors in the denominator.
  • Re-run after warmup and after server restart when comparing profiles.
  • Keep rollback profiles available before replacing a safe serving path.

Reporting

Report:

  • question answered
  • launch profile
  • workload
  • concurrency/context/cache budget
  • first-token latency
  • output tokens/sec
  • completed tokens/sec
  • errors/timeouts
  • memory use
  • tradeoff
  • decision

State whether the win helps the person chatting, the saturated batch workload, or the allocator frontier.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.