What problem does it solve?
Unoptimized LLM API usage leads to unexpectedly high costs for applications and batch processing workflows, especially when handling tasks of varying complexity or running large volumes of requests.
Core Features & Use Cases
- Model Routing by Complexity: Automatically select cheaper models for simple tasks and reserve expensive models for complex ones to reduce spend.
- Immutable Budget Tracking: Track cumulative API costs with non-mutating state to enforce budget limits and avoid overspend.
- Narrow Retry Logic: Retry only on transient errors (network issues, rate limits) and fail fast on permanent errors to avoid wasting budget on unrecoverable requests.
- Prompt Caching: Cache long system prompts to reduce token costs and latency for repetitive requests.
- Use Case: A team building a customer support chatbot can use this skill to route simple FAQ queries to a low-cost model, stay within a monthly API budget, and cache the system prompt to cut repeated costs.
Quick Start
Use the cost-aware-llm-pipeline skill to build a batch content processing workflow that automatically selects the optimal LLM model for each task and enforces your set API spending limit.