model-serving-inference
Skill1 starsChanged 17 days agoMITView on GitHub
Design efficient and reliable LLM inference or model-serving systems, including batching, streaming, quantization, caching, capacity planning, and failure handling.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 16
Preserve quality: Run task-level and safety evaluations after changing precision, model version, tokenizer, sampling, or serving …
- Distinctive: line 18
Handle failures: Use bounded retries with jitter for transient failures, idempotency for retried actions, and carefully evaluated fallbacks.
- Distinctive: line 19
Roll out gradually: Use canary traffic, shadow comparisons where safe, health checks, rollback criteria, and pinned model/runtime versions.
- Distinctive: line 36
Document workload assumptions, benchmark methodology, runtime/model versions, capacity limits, rollout/rollback plan, quality impact, and …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Model Serving and Inference
Goal
Serve models against explicit quality, throughput, latency, availability, privacy, and cost requirements. Optimize measured bottlenecks rather than assuming one serving stack fits every model.
Workflow
- Specify workload. Estimate request rates, prompt/output token distributions, concurrency, context lengths, streaming needs, SLA, model size, and hardware constraints.
- Establish baseline. Measure time to first token, inter-token latency, end-to-end p50/p95/p99, throughput, GPU/CPU/memory utilization, error rate, and cost per successful request.
- Select deployment mode. Compare hosted APIs, dedicated endpoints, self-hosted runtimes, and edge/local inference based on control, scale, data residency, and operational capacity.
- Tune safely. Evaluate batching, continuous batching, KV-cache behavior, quantization, speculative decoding, prefix caching, and request limits against representative prompts and outputs.
- Preserve quality. Run task-level and safety evaluations after changing precision, model version, tokenizer, sampling, or serving configuration.
- Protect capacity. Set concurrency limits, queue bounds, timeouts, cancellation, backpressure, and rate limits. Return useful overload errors instead of unbounded queuing.
- Handle failures. Use bounded retries with jitter for transient failures, idempotency for retried actions, and carefully evaluated fallbacks. Do not retry permanent invalid requests indefinitely.
- Roll out gradually. Use canary traffic, shadow comparisons where safe, health checks, rollback criteria, and pinned model/runtime versions.
- Monitor drift and cost. Watch latency, throughput, token distribution, quality, hardware saturation, and provider changes.
Performance dimensions
- Time to first token (TTFT) and inter-token latency for streaming.
- End-to-end latency and successful tasks per second.
- Tokens per second and cost per successful task.
- Memory headroom, queue time, cache hit rate, and failure/retry rates.
Avoid
- Reporting throughput without concurrency and workload details.
- Comparing systems with different prompt/output lengths or quality targets.
- Enabling cache reuse across users or tenants when context isolation cannot be guaranteed.
- Using quantization or caching without regression tests and security review.
- Treating a healthy process as proof the model endpoint is serving correct results.
Deliverable
Document workload assumptions, benchmark methodology, runtime/model versions, capacity limits, rollout/rollback plan, quality impact, and operating metrics.
References
- vLLM documentation: https://docs.vllm.ai/
- Hugging Face Text Generation Inference: https://huggingface.co/docs/text-generation-inference/index
- NVIDIA TensorRT-LLM: https://nvidia.github.io/TensorRT-LLM/
In this repository28 other files it gives its agents.
- agent-architecture-designSkill
- agent-evaluationSkill
- agent-harness-engineeringSkill
- agentic-workflow-testingSkill
- agent-memory-designSkill
- browser-computer-useSkill
- durable-agent-workflowsSkill
- human-in-the-loopSkill
- mcp-developmentSkill
- mcp-server-developmentSkill
- multi-agent-orchestrationSkill
- tool-calling-designSkill
- advanced-retrieval-rerankingSkill
- context-engineeringSkill
- embedding-model-engineeringSkill
- llm-evaluationSkill
- llm-observabilitySkill
- multimodal-ai-pipelinesSkill
- prompt-engineeringSkill
- rag-engineeringSkill
- rag-pipeline-engineeringSkill
- structured-outputsSkill
- agentic-securitySkill
- security-reviewSkill
- code-reviewSkill
- debuggingSkill
- test-engineeringSkill
- example-skillSkill
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
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.

