What problem does it solve? LLM API costs grow quickly when every request uses the most expensive model, retries fire on permanent errors, and long system prompts are resent on every call. This Skill provides composable patterns for controlling spend while preserving output quality on complex tasks. ## Core Features & Use Cases - Model Routing by Complexity: Automatically select cheaper models (e.g., Haiku) for simple tasks and reserve expensive models (e.g., Sonnet) for large inputs, using configurable text-length and item-count thresholds. - Immutable Budget Tracking: Track cumulative spend with frozen dataclasses and enforce hard budget limits that fail early before overspending. - Narrow Retry Logic: Retry only transient failures (rate limits, connection errors, server errors) with exponential backoff, failing fast on authentication or validation errors. - Prompt Caching: Cache long system prompts with ephemeral cache control to cut both cost and latency. - Use Case: When processing a batch of 500 documents through the Claude API, route small documents to Haiku, enforce a $1.00 budget cap, and cache the shared system prompt to reduce total spend by a large margin. ## Quick Start Use the cost-aware-llm-pipeline skill to add model routing, budget limits, retry handling, and prompt caching to my Claude API batch processing script.