スキル一覧に戻る
vasilyu1983

ai-llm-inference

by vasilyu1983

25🍴 6📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: ai-llm-inference description: "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."

LLMOps – Inference & Optimization – Production Skill Hub

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 Claude can execute.


When to Use This Skill

Claude should activate this skill whenever the user asks for:

  • Optimizing LLM inference latency or throughput
  • Choosing quantization strategies (FP8/FP4/INT8/INT4)
  • Configuring vLLM, TensorRT-LLM, or DeepSpeed inference
  • Scaling LLM inference across GPUs (tensor/pipeline parallelism)
  • Building high-throughput LLM APIs
  • Improving context window performance (KV cache optimization)
  • Using speculative decoding for faster generation
  • Reducing cost per token
  • Profiling and benchmarking inference workloads
  • Planning infrastructure capacity
  • CPU/edge deployment patterns
  • High availability and resilience patterns

Scope Boundaries (Use These Skills for Depth)

  • Prompting, tuning, datasetsai-llm
  • RAG pipeline constructionai-rag
  • Deployment, APIs, monitoringai-mlops
  • Safety, governanceai-mlops

Quick Reference

TaskTool/FrameworkCommand/PatternWhen to Use
Latency budgetSLO + load modelTTFT/ITL + P95/P99 under loadAny production endpoint
Tail-latency controlScheduling + timeoutsAdmission control + queue caps + backpressurePrevent p99 explosions
ThroughputBatching + KV-cache aware servingContinuous batching + KV pagingHigh concurrency serving
Cost controlModel tiering + cachingCache (prefix/response) + quotasReduce spend and overload risk
Long contextPrefill optimizationChunked prefill + prompt compressionLong inputs and RAG-heavy apps
ParallelismTP/PP/DPChoose by model size and interconnectModels that do not fit one device
ReliabilityResilience patternsTimeouts + circuit breakers + idempotencyAvoid cascading failures

Decision Tree: Inference Optimization Strategy

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)
    │
    ├─ GPU Selection?
    │   ├─ Data center scale? → GB200 NVL72 + NVIDIA Dynamo
    │   ├─ Maximum performance? → B200 (FP8 required, no INT8)
    │   └─ Production standard? → H200 (mature ecosystem)
    │
    └─ Edge deployment?
        └─ CPU + quantization → llama.cpp/GGUF for constrained resources

Core Concepts & Practices

Core Concepts (Vendor-Agnostic)

  • Latency components: queueing + prefill + decode; optimize the largest contributor first.
  • Tail latency: p99 is dominated by queuing and long prompts; fix with admission control and context budgets.
  • Retries: retries can multiply load; bound retries and use hedged requests only with strict budgets.
  • Caching: prefix caching helps repeated system/tool scaffolds; response caching helps repeated questions (requires invalidation).
  • Security & privacy: prompts/outputs can contain sensitive data; scrub logs, enforce auth/tenancy, and rate-limit abuse (OWASP LLM Top 10: https://owasp.org/www-project-top-10-for-large-language-model-applications/).

Implementation Practices (Tooling Examples)

  • Measure under load: benchmark TTFT/ITL and p95/p99 with realistic concurrency and prompt lengths.
  • Separate environments: dev/stage/prod model configs; promote only after passing the inference review checklist.
  • Export telemetry: request-level tokens, TTFT/ITL, queue depth, GPU memory headroom, and error classes (OpenTelemetry GenAI semantic conventions: https://opentelemetry.io/docs/specs/semconv/gen-ai/).

Do / Avoid

Do

  • Do enforce max_input_tokens and max_output_tokens at the API boundary.
  • Do cap concurrency and queue depth; return overload errors quickly.
  • Do validate quality after any quantization or kernel change.

Avoid

  • Avoid unbounded retries (amplifies outages).
  • Avoid unbounded context windows (OOM + latency spikes).
  • Avoid benchmarking on single requests; always test with realistic concurrency.

Resources (Detailed Operational Guides)

For comprehensive guides on specific topics, see:

Infrastructure & Serving

Performance Optimization

Deployment & Operations


Templates

Inference Configs

Production-ready configuration templates for leading inference engines:

Quantization & Compression

Model compression templates for reducing memory and cost:

Serving Pipelines

High-throughput serving architectures:

Caching & Batching

Performance optimization templates:

Benchmarking

Performance measurement and validation:

Checklists

Resources

Templates

Data


Trend Awareness Protocol

IMPORTANT: When users ask recommendation questions about LLM inference, you MUST use WebSearch to check current trends before answering.

Trigger Conditions

  • "What's the best inference engine for [use case]?"
  • "What should I use for [serving/quantization/batching]?"
  • "What's the latest in LLM inference optimization?"
  • "Current best practices for [vLLM/TensorRT/quantization]?"
  • "Is [inference tool] still relevant in 2026?"
  • "[vLLM] vs [TensorRT-LLM] vs [SGLang]?"
  • "Best quantization method for [model size]?"
  • "What GPU should I use for inference?"

Required Searches

  1. Search: "LLM inference optimization best practices 2026"
  2. Search: "[vLLM/TensorRT-LLM/SGLang] comparison 2026"
  3. Search: "LLM quantization trends January 2026"
  4. Search: "LLM serving new releases 2026"

What to Report

After searching, provide:

  • Current landscape: What serving engines are popular NOW (not 6 months ago)
  • Emerging trends: New inference optimizations gaining traction
  • Deprecated/declining: Techniques or tools losing relevance
  • Recommendation: Based on fresh data, not just static knowledge
  • Inference engines (vLLM 0.7+, TensorRT-LLM, SGLang, llama.cpp)
  • Quantization methods (FP8, AWQ, GPTQ, GGUF, bitsandbytes)
  • Attention kernels (FlashAttention-3, FlashInfer, xFormers)
  • Speculative decoding advances
  • KV cache optimization techniques
  • New GPU architectures (H200, Blackwell) and their optimizations

This skill focuses on inference-time performance. For related workflows:

  • ai-llm - Prompting, fine-tuning, application architecture
  • ai-rag - RAG pipeline construction and optimization
  • ai-mlops - Deployment, monitoring, safety, and governance
  • qa-observability - Performance monitoring and optimization
  • ops-devops-platform - Infrastructure and platform operations

External Resources

See data/sources.json for:

  • Serving frameworks (vLLM, TensorRT-LLM, DeepSpeed-MII)
  • Quantization libraries (GPTQ, AWQ, bitsandbytes, LLM Compressor)
  • FlashAttention, FlashInfer, xFormers
  • GPU hardware guides and optimization docs
  • Benchmarking frameworks and tools

Use this skill whenever the user needs LLM inference performance, cost reduction, or serving architecture guidance.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です