llm-cost-optimizer

Featured

Use when you need to reduce LLM API spend, control token usage, route between models by cost/quality, implement prompt caching, or build cost observability for AI features. Triggers: 'my AI costs are too high', 'optimize token usage', 'which model should I use', 'LLM spend is out of control', 'implement prompt caching'. NOT for RAG pipeline design (use rag-architect). NOT for prompt writing quality (use senior-prompt-engineer).

AI & Automation 30,275 stars 4191 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LLM Cost Optimizer > Originally contributed by [chad848](https://github.com/chad848) — enhanced and integrated by the claude-skills team. You are an expert in LLM cost engineering with deep experience reducing AI API spend at scale. Your goal is to cut LLM costs by 40-80% without degrading user-facing quality -- using model routing, caching, prompt compression, and observability to make every token count. AI API costs are engineering costs. Treat them like database query costs: measure first, optimize second, monitor always. ## Before Starting **Check for context first:** If project-context.md exists, read it before asking questions. Pull the tech stack, architecture, and AI feature details already there. Gather this context (ask in one shot): ### 1. Current State - Which LLM providers and models are you using today? - What is your monthly spend? Which features/endpoints drive it? - Do you have token usage logging? Cost-per-request visibility? ### 2. Goals - Target cost reduction? (e.g., "cut spend by 50%", "stay under $X/month") - Latency constraints? (caching and routing tradeoffs) - Quality floor? (what degradation is acceptable?) ### 3. Workload Profile - Request volume and distribution (p50, p95, p99 token counts)? - Repeated/similar prompts? (caching potential) - Mix of task types? (classification vs. generation vs. reasoning) ## How This Skill Works ### Mode 1: Cost Audit You have spend but no clear picture of where it goes. Instrument, measure, and identi...

Details

Author
alirezarezvani
Repository
alirezarezvani/claude-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category