llm-cost-optimizer

Solid

Audits an AI application for unnecessary token spend and recommends prompt caching, model routing, and token reduction techniques to cut costs.

AI & Automation 9 stars 1 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 85/100

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

Skill Content

# LLM Cost Optimizer ## What this skill does This skill audits an LLM application's prompts, call patterns, and model selection to identify cost reduction opportunities. It covers prompt caching, model routing (right-sizing), token reduction, batching, and output length control — the techniques that typically cut LLM costs by 40–80% without sacrificing quality. ## How to use ### Claude Code / Cline Copy this file to `.agents/skills/llm-cost-optimizer/SKILL.md` in your project root. Then ask: - *"Use the LLM Cost Optimizer to audit our AI application."* - *"How can I reduce our OpenAI API costs? Here are our prompts..."* Provide: - Your system prompt(s) - Approximate daily call volume - Which model(s) you're using - Typical input/output token counts if known - Whether calls are real-time (low latency required) or batch (latency tolerant) ### Cursor / Codex Paste your prompts, call patterns, and current monthly spend alongside these instructions. ## The Prompt / Instructions for the Agent When asked to optimize LLM costs, audit the following areas in order of typical savings impact: ### Audit 1 — Prompt Caching (savings: 50–90% on repeated prefixes) **Check:** Does the system prompt stay the same across calls? If yes, enable prompt caching. The system prompt is sent once and cached — subsequent calls only pay for the new user tokens. ```python # Anthropic Claude — cache_control on system prompt response = client.messages.create( model="claude-opus-4-6", s...

Details

Author
Notysoty
Repository
Notysoty/openagentskills
Created
5 months ago
Last Updated
6 days ago
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category