What problem does it solve?
This Skill helps developers control and reduce LLM API costs by routing requests to cheaper models when possible, enforcing budget limits, handling retries safely, and caching prompts to avoid repeated charges.
Core Features & Use Cases
- Model Routing by Task Complexity: Selects a lower-cost model for simple tasks and upgrades to a higher-cost model only when text length or item count indicates complexity.
- Immutable Cost Tracking: Maintains an auditable, never-mutation cost ledger using frozen records and a cumulative total with an over-budget check.
- Narrow Retry Logic: Retries only on transient failures (e.g., rate limits, connection issues, server errors) while failing fast on authentication or bad-request errors.
- Prompt Caching: Uses cache control on stable prompt content to reduce repeated prompt transmission costs and latency.
Quick Start
Ask the assistant to design a production-ready pipeline function that routes models by complexity, tracks immutable spend against a budget, retries only transient errors, and enables prompt caching for the system prompt.