xiaohongshu
xiaohongshu
ai-llm-inference
Operational patterns for LLM inference: latency budgeting, tail-latency control, caching, batching/scheduling, quantization/compression, parallelism, and reliable serving at scale. Emphasizes production-grade performance, cost control, and observability.
Full skill instructions
Modern Best Practices (January 2026):
This skill provides production-ready operational patterns for optimizing LLM inference performance, cost, and reliability. It centralizes decision rules, optimization strategies, configuration templates, and operational checklists for inference workloads.
No theory. No narrative. Only what Codex can execute.
Codex should activate this skill whenever the user asks for:
| Task | Tool/Framework | Command/Pattern | When to Use |
|---|---|---|---|
| Latency budget | SLO + load model | TTFT/ITL + P95/P99 under load | Any production endpoint |
| Tail-latency control | Scheduling + timeouts | Admission control + queue caps + backpressure | Prevent p99 explosions |
| Throughput | Batching + KV-cache aware serving | Continuous batching + KV paging | High concurrency serving |
| Cost control | Model tiering + caching | Cache (prefix/response) + quotas | Reduce spend and overload risk |
| Long context | Prefill optimization | Chunked prefill + prompt compression | Long inputs and RAG-heavy apps |
| Parallelism | TP/PP/DP | Choose by model size and interconnect | Models that do not fit one device |
| Reliability | Resilience patterns | Timeouts + circuit breakers + idempotency | Avoid cascading failures |
Need to optimize LLM inference: [Optimization Path]
│
├─ High throughput (>10k tok/s) OR P99 variance > 3x P50?
│ └─ YES -> Disaggregated inference (prefill/decode separation)
│ See references/disaggregated-inference.md
│
├─ Primary constraint: Throughput?
│ ├─ Many concurrent users? -> batching + KV-cache aware serving + admission control
│ ├─ Chat/agents with KV reuse? -> SGLang (RadixAttention)
│ └─ Mostly batch/offline? -> batch inference jobs + large batches + spot capacity
│
├─ Primary constraint: Cost?
│ ├─ Can accept lower quality tier? -> model tiering (small/medium/large router)
│ └─ Must keep quality? -> caching + prompt/context reduction before quantization
│
├─ Primary constraint: Latency?
│ ├─ Draft model acceptable? -> speculative decoding
│ └─ Long context? -> prefill optimizations + FlashAttention-3 + context budgets
│
├─ Large model (>70B)?
│ ├─ Multiple GPUs? -> Tensor parallelism (NVLink required)
│ └─ Deep model? -> Pipeline parallelism (minimize bubbles)
│
├─ Hardware selection?
│ ├─ Memory-bound? -> more HBM, higher bandwidth
│ ├─ Latency-bound? -> faster clocks + kernel support
│ └─ Multi-node? -> prioritize interconnect (NVLink/RDMA) and topology
│
│ Notes: treat GPU/SKU advice as time-sensitive; verify with vendor docs and your own benchmarks.
│ See references/gpu-optimization-checklists.md and references/infrastructure-tuning.md
│
└─ Edge deployment?
└─ CPU + quantization -> llama.cpp/GGUF for constrained resources
Before recommending changes, collect (or infer) these inputs:
Do
max_input_tokens and max_output_tokens at the API boundary.Avoid
For comprehensive guides on specific topics, see:
Production-ready configuration templates for leading inference engines:
Model compression templates for reducing memory and cost:
High-throughput serving architectures:
Performance optimization templates:
Performance measurement and validation:
Resources
Templates
Data
IMPORTANT: When users ask recommendation questions about LLM inference, you MUST use WebSearch to check current trends before answering.
"LLM inference optimization best practices 2026""[vLLM/TensorRT-LLM/SGLang] comparison 2026""LLM quantization trends January 2026""LLM serving new releases 2026"After searching, provide:
This skill focuses on inference-time performance. For related workflows:
See data/sources.json for:
Use this skill whenever the user needs LLM inference performance, cost reduction, or serving architecture guidance.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience