llm-cost-optimizer
Skill1 starsChanged 3 months agoMITView on GitHub
Analyze and reduce LLM API costs through model routing, caching, and prompt optimization. TRIGGER when: user asks about LLM costs, API spend reduction, token optimization, model routing, or prompt caching. DO NOT TRIGGER when: user asks about model quality comparison, fine-tuning, or general prompt engineering.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
- vellum-ai/vellum-assistanttheir own version, first seen Jul 8, 2026
- mahiunfiltered/claude-code-skillstheir own version, first seen Jul 8, 2026
- Hussain-Elfalah/Agentic-Skillstheir own version, first seen Jun 4, 2026
- csiddhant796-blip/claude-skills-collectiontheir own version, first seen May 10, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- vellum-ai/vellum-assistant★ 1.4ksame name
- Hassaan146/claude-skills★ 18same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- mahiunfiltered/claude-code-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository61 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-reviewerSkill
- agent-designerSkill
- architectSkill
- autoresearchSkill
- blockscoutSkill
- ci-cd-pipeline-builderSkill
- claude-apiSkill
- codebase-onboardingSkill
- code-reviewSkill
- coingeckoSkill
- database-designerSkill
- dependency-auditorSkill
- design-uxSkill
- digestSkill
- droo-stackSkill
- env-secrets-managerSkill
- ethskillsSkill
- ffmpeg-asmSkill
- focused-fixSkill
- frontend-slop-auditSkill
- git-guardrailsSkill
- git-worktree-managerSkill
- humanizerSkill
- interface-designerSkill
- local-browser-inspectorSkill
- mcp-server-builderSkill
- native-codeSkill
- nixSkill
- noirSkill
- observability-designerSkill
- patchbotSkill
- performance-profilerSkill
- playwrightSkill
- polymathSkill
- prd-to-planSkill
- prepperSkill
- property-testingSkill
- qaSkill
- rag-architectSkill
- raxol-paymentsSkill
- raxolSkill
- raxol-symphonySkill
- recallSkill
- refactoring-strategySkill
- regenSkill
- releaseSkill
- security-auditorSkill
- self-improving-agentSkill
- sentinelSkill
- signozSkill
- skill-creatorSkill
- solidity-auditorSkill
- tddSkill
- tech-debt-trackerSkill
- ubiquitous-languageSkill
- watchdogSkill
- web-asset-generatorSkill
- writing-voiceSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
Never optimize before measuring -- instrument first
- Distinctive: line 66
Never sacrifice quality silently -- A/B test every change
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LLM Cost Optimizer
Reduce LLM API costs systematically without sacrificing output quality.
Three Modes
1. Cost Audit
Assess current spend and find the 80/20 opportunities.
- Instrument -- Add token counting and cost tracking per request. Log model, input tokens, output tokens, latency, and use case.
- Find 80/20 -- Identify which 20% of use cases drive 80% of cost. Sort by total spend, not per-request cost.
- Classify -- Tag each use case by complexity: simple (classification, extraction), medium (summarization, Q&A), complex (reasoning, code generation, multi-step).
2. Optimize Existing
Apply techniques to reduce cost on current workloads.
- Routing -- Route simple tasks to cheaper/smaller models. See optimization-techniques.md.
- Caching -- Cache repeated or similar queries. Prompt caching for system prompts.
- Compression -- Reduce prompt size without losing quality. Trim examples, remove redundancy.
3. Design Cost-Efficient
Build new systems with cost awareness from day one.
- Budget envelopes -- Set per-feature monthly cost budgets. Alert at 80%.
- Routing layer -- Default to cheapest model that meets quality bar. Escalate on failure.
- Observability -- Track cost per user, per feature, per model. Dashboard with trends.
Optimization Order
Apply techniques in this order (highest impact first):
- Model routing (60-80% reduction potential)
- Prompt caching (40-90% on cached portions)
- Output length control (20-40%)
- Prompt compression (15-30%)
- Semantic caching (30-60% hit rate)
- Request batching (10-25%)
See optimization-techniques.md for detailed guidance on each technique.
What You Get
- A cost audit identifying which use cases drive the majority of LLM spend, with per-request and total cost breakdowns.
- Prioritized optimization recommendations (model routing, caching, compression) ranked by reduction potential.
- Concrete implementation steps with expected cost savings percentages for each technique.
Rules
- Never optimize before measuring -- instrument first
- Never sacrifice quality silently -- A/B test every change
- Cost per request is misleading -- optimize total spend per outcome
- The cheapest token is the one you never send
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

