LLMOps – Inference & Optimization – Production Skill Hub
Modern Best Practices: vLLM optimizations (24x throughput), FP8/FP4 quantization (30-50% cost reduction), FlashInfer integration, PagedAttention, continuous batching, and production serving patterns.
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, datasets → ai-llm
- RAG pipeline construction → ai-rag
- Deployment, APIs, monitoring → ai-mlops
- Safety, governance → ai-mlops
Quick Reference
| Task |
Tool/Framework |
Command/Pattern |
When to Use |
| Max throughput |
vLLM |
Continuous batching + PagedAttention |
API serving, 24x throughput gain |
| Cost optimization |
FP8/FP4 quantization |
LLM Compressor, TensorRT Model Optimizer |
30-50% cost reduction, 99% accuracy |
| GPU inference |
TensorRT-LLM |
Custom kernels, FlashInfer |
Kernel-level optimization needed |
| CPU inference |
llama.cpp, GGUF |
Q4_K_M, Q8_0 formats |
Edge devices, no GPU available |
| Multi-GPU |
vLLM, DeepSpeed |
Tensor parallelism, pipeline parallelism |
Large models, distributed serving |
| Latency optimization |
Speculative decoding |
Draft model + target model |
2-5x speedup with quality |
| Long context |
PagedAttention + FlashAttention-2 |
KV cache optimization |
>8k token contexts |
| Memory optimization |
KV cache quantization |
FP8 KV cache |
Fit larger batches/longer contexts |
Decision Tree: Inference Optimization Strategy
Need to optimize LLM inference: [Optimization Path]
├─ Primary constraint: Throughput?
│ ├─ GPU available? → vLLM (24x gain, continuous batching)
│ └─ CPU only? → llama.cpp + GGUF (Q4_K_M format)
│
├─ Primary constraint: Cost?
│ ├─ GPU serving? → FP8/FP4 quantization (30-50% reduction)
│ └─ Needs quality? → FP8 + calibration (99% accuracy retention)
│
├─ Primary constraint: Latency?
│ ├─ Can use draft model? → Speculative decoding (2-5x speedup)
│ └─ Long context? → FlashAttention-2 + PagedAttention
│
├─ Large model (>70B)?
│ ├─ Multiple GPUs? → Tensor parallelism (NVLink required)
│ └─ Deep model? → Pipeline parallelism (minimize bubbles)
│
└─ Edge deployment?
└─ CPU + quantization (GGUF Q4_K_M) → Optimized for constrained resources
Modern Best Practices (Current Standards)
vLLM Optimizations
- 24x higher throughput vs HuggingFace Transformers
- Continuous batching with PagedAttention
- FlashInfer library integration (NVIDIA collaboration)
- FP8 attention kernels and FP4 GEMMs
- Advanced kernel fusions (AllReduce + RMSNorm + quantization)
Quantization Performance
- FP8/FP4: 30-50% cost reduction, ~99% accuracy retention
- FP4 on large models: 40-50% performance boost (Qwen3-32B)
- GPTQ optimization: 2-3x faster throughput vs default vLLM config
- BF16 → FP8/INT8: ~30% improvement in cost-per-token
Key Tools
- LLM Compressor (vLLM project) - optimized model serving
- NVIDIA TensorRT Model Optimizer - PTQ framework with HuggingFace export
- vLLM + NVIDIA collaboration - FlashInfer kernels, FP8/FP4 support
Resources (Detailed Operational Guides)
For comprehensive guides on specific topics, see:
Infrastructure & Serving
- Infrastructure Tuning - OS, container, Kubernetes optimization for GPU workloads
- Serving Architectures - Production serving stack patterns
- Resilience & HA Patterns - Multi-region, failover, traffic management
Performance Optimization
- Quantization Patterns - FP8/FP4/INT8/INT4 decision trees and validation
- KV Cache Optimization - PagedAttention, FlashAttention, prefix caching
- Parallelism Patterns - Tensor/pipeline/expert parallelism strategies
- Optimization Strategies - Throughput, cost, memory optimization
- Batching & Scheduling - Continuous batching and throughput patterns
Deployment & Operations
- Edge & CPU Optimization - llama.cpp, GGUF, mobile/browser deployment
- GPU Optimization Checklists - Hardware-specific tuning
- Speculative Decoding Guide - Advanced generation acceleration
- Profiling & Capacity Planning - Benchmarking, SLOs, replica sizing
Templates
Inference Configs
Production-ready configuration templates for leading inference engines:
- vLLM Configuration - Continuous batching, PagedAttention setup
- TensorRT-LLM Configuration - NVIDIA kernel optimizations
- DeepSpeed Inference - PyTorch-friendly inference
Quantization & Compression
Model compression templates for reducing memory and cost:
- GPTQ Quantization - GPU post-training quantization
- AWQ Quantization - Activation-aware weight quantization
- GGUF Format - CPU/edge optimized formats
Serving Pipelines
High-throughput serving architectures:
- LLM API Server - FastAPI + vLLM production setup
- High-Throughput Setup - Multi-replica scaling patterns
Caching & Batching
Performance optimization templates:
- Prefix Caching - KV cache reuse strategies
- Batching Configuration - Continuous batching tuning
Benchmarking
Performance measurement and validation:
- Latency & Throughput Testing - Load testing framework
Navigation
Resources
- resources/serving-architectures.md
- resources/profiling-and-capacity-planning.md
- resources/gpu-optimization-checklists.md
- resources/speculative-decoding-guide.md
- resources/resilience-ha-patterns.md
- resources/optimization-strategies.md
- resources/kv-cache-optimization.md
- resources/batching-and-scheduling.md
- resources/quantization-patterns.md
- resources/parallelism-patterns.md
- resources/edge-cpu-optimization.md
- resources/infrastructure-tuning.md
Templates
- templates/serving/template-llm-api.md
- templates/serving/template-high-throughput-setup.md
- templates/inference/template-vllm-config.md
- templates/inference/template-tensorrtllm-config.md
- templates/inference/template-deepspeed-inference.md
- templates/quantization/template-awq.md
- templates/quantization/template-gptq.md
- templates/quantization/template-gguf.md
- templates/batching/template-batching-config.md
- templates/caching/template-prefix-caching.md
- templates/benchmarking/template-latency-throughput-test.md
Data
- data/sources.json — Curated external references
Related Skills
This skill focuses on inference-time performance. For related workflows:
- ai-llm - Prompting, fine-tuning, datasets
- ai-llm - LLM application architecture, RAG pipelines
- ai-rag - RAG pipeline construction and optimization
- ai-mlops - Deployment, APIs, monitoring
- ai-mlops - Safety, governance, security
- 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.
1---2name: ai-llm-inference3description: Operational patterns for LLM inference (recent advances): vLLM with 24x throughput gains, FP8/FP4 quantization (30-50% cost reduction), FlashInfer kernels, advanced fusions, PagedAttention, continuous batching, model compression, speculative decoding, and GPU/CPU scheduling. Emphasizes production-ready performance and cost optimization.4---5
6# LLMOps – Inference & Optimization – Production Skill Hub
7
8**Modern Best Practices**: vLLM optimizations (24x throughput), FP8/FP4 quantization (30-50% cost reduction), FlashInfer integration, PagedAttention, continuous batching, and production serving patterns.
9
10This 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.
11
12No theory. No narrative. Only what Claude can execute.
13
14---
15
16## When to Use This Skill
17
18Claude should activate this skill whenever the user asks for:
19
20- Optimizing LLM inference latency or throughput
21- Choosing quantization strategies (FP8/FP4/INT8/INT4)
22- Configuring vLLM, TensorRT-LLM, or DeepSpeed inference
23- Scaling LLM inference across GPUs (tensor/pipeline parallelism)
24- Building high-throughput LLM APIs
25- Improving context window performance (KV cache optimization)
26- Using speculative decoding for faster generation
27- Reducing cost per token
28- Profiling and benchmarking inference workloads
29- Planning infrastructure capacity
30- CPU/edge deployment patterns
31- High availability and resilience patterns
32
33## Scope Boundaries (Use These Skills for Depth)
34
35- **Prompting, tuning, datasets** → [ai-llm](../ai-llm/SKILL.md)
36- **RAG pipeline construction** → [ai-rag](../ai-rag/SKILL.md)
37- **Deployment, APIs, monitoring** → [ai-mlops](../ai-mlops/SKILL.md)
38- **Safety, governance** → [ai-mlops](../ai-mlops/SKILL.md)
39
40---
41
42## Quick Reference
43
44| Task | Tool/Framework | Command/Pattern | When to Use |
45|------|----------------|-----------------|-------------|
46| Max throughput | vLLM | Continuous batching + PagedAttention | API serving, 24x throughput gain |
47| Cost optimization | FP8/FP4 quantization | LLM Compressor, TensorRT Model Optimizer | 30-50% cost reduction, 99% accuracy |
48| GPU inference | TensorRT-LLM | Custom kernels, FlashInfer | Kernel-level optimization needed |
49| CPU inference | llama.cpp, GGUF | Q4_K_M, Q8_0 formats | Edge devices, no GPU available |
50| Multi-GPU | vLLM, DeepSpeed | Tensor parallelism, pipeline parallelism | Large models, distributed serving |
51| Latency optimization | Speculative decoding | Draft model + target model | 2-5x speedup with quality |
52| Long context | PagedAttention + FlashAttention-2 | KV cache optimization | >8k token contexts |
53| Memory optimization | KV cache quantization | FP8 KV cache | Fit larger batches/longer contexts |
54
55---
56
57## Decision Tree: Inference Optimization Strategy
58
59```text
60Need to optimize LLM inference: [Optimization Path]
61 ├─ Primary constraint: Throughput?
62 │ ├─ GPU available? → vLLM (24x gain, continuous batching)
63 │ └─ CPU only? → llama.cpp + GGUF (Q4_K_M format)
64 │
65 ├─ Primary constraint: Cost?
66 │ ├─ GPU serving? → FP8/FP4 quantization (30-50% reduction)
67 │ └─ Needs quality? → FP8 + calibration (99% accuracy retention)
68 │
69 ├─ Primary constraint: Latency?
70 │ ├─ Can use draft model? → Speculative decoding (2-5x speedup)
71 │ └─ Long context? → FlashAttention-2 + PagedAttention
72 │
73 ├─ Large model (>70B)?
74 │ ├─ Multiple GPUs? → Tensor parallelism (NVLink required)
75 │ └─ Deep model? → Pipeline parallelism (minimize bubbles)
76 │
77 └─ Edge deployment?
78 └─ CPU + quantization (GGUF Q4_K_M) → Optimized for constrained resources
79```
80
81---
82
83## Modern Best Practices (Current Standards)
84
85### vLLM Optimizations
86
87- **24x higher throughput** vs HuggingFace Transformers
88- Continuous batching with PagedAttention
89- FlashInfer library integration (NVIDIA collaboration)
90- FP8 attention kernels and FP4 GEMMs
91- Advanced kernel fusions (AllReduce + RMSNorm + quantization)
92
93### Quantization Performance
94
95- **FP8/FP4**: 30-50% cost reduction, ~99% accuracy retention
96- **FP4 on large models**: 40-50% performance boost (Qwen3-32B)
97- **GPTQ optimization**: 2-3x faster throughput vs default vLLM config
98- **BF16 → FP8/INT8**: ~30% improvement in cost-per-token
99
100### Key Tools
101
102- **LLM Compressor** (vLLM project) - optimized model serving
103- **NVIDIA TensorRT Model Optimizer** - PTQ framework with HuggingFace export
104- **vLLM + NVIDIA collaboration** - FlashInfer kernels, FP8/FP4 support
105
106---
107
108## Resources (Detailed Operational Guides)
109
110For comprehensive guides on specific topics, see:
111
112### Infrastructure & Serving
113
114- [Infrastructure Tuning](resources/infrastructure-tuning.md) - OS, container, Kubernetes optimization for GPU workloads
115- [Serving Architectures](resources/serving-architectures.md) - Production serving stack patterns
116- [Resilience & HA Patterns](resources/resilience-ha-patterns.md) - Multi-region, failover, traffic management
117
118### Performance Optimization
119
120- [Quantization Patterns](resources/quantization-patterns.md) - FP8/FP4/INT8/INT4 decision trees and validation
121- [KV Cache Optimization](resources/kv-cache-optimization.md) - PagedAttention, FlashAttention, prefix caching
122- [Parallelism Patterns](resources/parallelism-patterns.md) - Tensor/pipeline/expert parallelism strategies
123- [Optimization Strategies](resources/optimization-strategies.md) - Throughput, cost, memory optimization
124- [Batching & Scheduling](resources/batching-and-scheduling.md) - Continuous batching and throughput patterns
125
126### Deployment & Operations
127
128- [Edge & CPU Optimization](resources/edge-cpu-optimization.md) - llama.cpp, GGUF, mobile/browser deployment
129- [GPU Optimization Checklists](resources/gpu-optimization-checklists.md) - Hardware-specific tuning
130- [Speculative Decoding Guide](resources/speculative-decoding-guide.md) - Advanced generation acceleration
131- [Profiling & Capacity Planning](resources/profiling-and-capacity-planning.md) - Benchmarking, SLOs, replica sizing
132
133---
134
135## Templates
136
137### Inference Configs
138
139Production-ready configuration templates for leading inference engines:
140
141- [vLLM Configuration](templates/inference/template-vllm-config.md) - Continuous batching, PagedAttention setup
142- [TensorRT-LLM Configuration](templates/inference/template-tensorrtllm-config.md) - NVIDIA kernel optimizations
143- [DeepSpeed Inference](templates/inference/template-deepspeed-inference.md) - PyTorch-friendly inference
144
145### Quantization & Compression
146
147Model compression templates for reducing memory and cost:
148
149- [GPTQ Quantization](templates/quantization/template-gptq.md) - GPU post-training quantization
150- [AWQ Quantization](templates/quantization/template-awq.md) - Activation-aware weight quantization
151- [GGUF Format](templates/quantization/template-gguf.md) - CPU/edge optimized formats
152
153### Serving Pipelines
154
155High-throughput serving architectures:
156
157- [LLM API Server](templates/serving/template-llm-api.md) - FastAPI + vLLM production setup
158- [High-Throughput Setup](templates/serving/template-high-throughput-setup.md) - Multi-replica scaling patterns
159
160### Caching & Batching
161
162Performance optimization templates:
163
164- [Prefix Caching](templates/caching/template-prefix-caching.md) - KV cache reuse strategies
165- [Batching Configuration](templates/batching/template-batching-config.md) - Continuous batching tuning
166
167### Benchmarking
168
169Performance measurement and validation:
170
171- [Latency & Throughput Testing](templates/benchmarking/template-latency-throughput-test.md) - Load testing framework
172
173## Navigation
174
175**Resources**
176- [resources/serving-architectures.md](resources/serving-architectures.md)
177- [resources/profiling-and-capacity-planning.md](resources/profiling-and-capacity-planning.md)
178- [resources/gpu-optimization-checklists.md](resources/gpu-optimization-checklists.md)
179- [resources/speculative-decoding-guide.md](resources/speculative-decoding-guide.md)
180- [resources/resilience-ha-patterns.md](resources/resilience-ha-patterns.md)
181- [resources/optimization-strategies.md](resources/optimization-strategies.md)
182- [resources/kv-cache-optimization.md](resources/kv-cache-optimization.md)
183- [resources/batching-and-scheduling.md](resources/batching-and-scheduling.md)
184- [resources/quantization-patterns.md](resources/quantization-patterns.md)
185- [resources/parallelism-patterns.md](resources/parallelism-patterns.md)
186- [resources/edge-cpu-optimization.md](resources/edge-cpu-optimization.md)
187- [resources/infrastructure-tuning.md](resources/infrastructure-tuning.md)
188
189**Templates**
190- [templates/serving/template-llm-api.md](templates/serving/template-llm-api.md)
191- [templates/serving/template-high-throughput-setup.md](templates/serving/template-high-throughput-setup.md)
192- [templates/inference/template-vllm-config.md](templates/inference/template-vllm-config.md)
193- [templates/inference/template-tensorrtllm-config.md](templates/inference/template-tensorrtllm-config.md)
194- [templates/inference/template-deepspeed-inference.md](templates/inference/template-deepspeed-inference.md)
195- [templates/quantization/template-awq.md](templates/quantization/template-awq.md)
196- [templates/quantization/template-gptq.md](templates/quantization/template-gptq.md)
197- [templates/quantization/template-gguf.md](templates/quantization/template-gguf.md)
198- [templates/batching/template-batching-config.md](templates/batching/template-batching-config.md)
199- [templates/caching/template-prefix-caching.md](templates/caching/template-prefix-caching.md)
200- [templates/benchmarking/template-latency-throughput-test.md](templates/benchmarking/template-latency-throughput-test.md)
201
202**Data**
203- [data/sources.json](data/sources.json) — Curated external references
204
205---
206
207## Related Skills
208
209This skill focuses on **inference-time performance**. For related workflows:
210
211- **[ai-llm](../ai-llm/SKILL.md)** - Prompting, fine-tuning, datasets
212- **[ai-llm](../ai-llm/SKILL.md)** - LLM application architecture, RAG pipelines
213- **[ai-rag](../ai-rag/SKILL.md)** - RAG pipeline construction and optimization
214- **[ai-mlops](../ai-mlops/SKILL.md)** - Deployment, APIs, monitoring
215- **[ai-mlops](../ai-mlops/SKILL.md)** - Safety, governance, security
216- **[qa-observability](../qa-observability/SKILL.md)** - Performance monitoring and optimization
217- **[ops-devops-platform](../ops-devops-platform/SKILL.md)** - Infrastructure and platform operations
218
219---
220
221## External Resources
222
223See [data/sources.json](data/sources.json) for:
224
225- Serving frameworks (vLLM, TensorRT-LLM, DeepSpeed-MII)
226- Quantization libraries (GPTQ, AWQ, bitsandbytes, LLM Compressor)
227- FlashAttention, FlashInfer, xFormers
228- GPU hardware guides and optimization docs
229- Benchmarking frameworks and tools
230
231---
232
233Use this skill whenever the user needs **LLM inference performance, cost reduction, or serving architecture** guidance.