LLM Cost Optimizer

The LLM Cost Optimizer skill helps reduce LLM API costs by 40–80% through model routing, caching, prompt compression, and observability. It provides structured guidance for auditing existing spend, optimizing current systems, and designing cost-efficient architectures for new AI features.

✨ What it does

  • Classifies work into three modes: Cost Audit, Optimize Existing System, Design Cost-Efficient Architecture.
  • Provides a step-by-step cost audit process with instrumentation and spend analysis.
  • Recommends ROI-ordered optimization techniques: model routing, prompt caching, output length control, prompt compression
  • Flags common cost leaks proactively, such as missing max_tokens or oversized system prompts.
  • Includes failure mode recovery and handoff triggers to other skills.
  • Delivers artifacts like cost breakdowns, routing designs, caching strategies, and architecture scorecards.

🎯 When to use it

  • When LLM API costs are too high or spend is out of control.
  • When choosing between models or designing an AI endpoint.
  • When building a new AI feature and want to wire in cost controls before launch.
  • When there is no per-feature cost logging or all requests hit the same model.

🚀 How to use

Trigger the skill by mentioning LLM costs, token usage, model selection, or building an AI feature. The skill will classify the mode and ask for context if needed. Provide details about current models, spend, workload, and goals. Example prompts:

My AI costs are too high. Can you help me reduce them?
We're about to launch an AI feature. How should we design it to keep costs low?

📄 Output: The skill produces tailored deliverables such as cost audit reports, routing decision trees, caching strategies, prompt audits, or architecture scorecards.

📦 Add this skill to Claude Code

# 1. Get the skills repo
git clone --depth 1 https://github.com/alirezarezvani/claude-skills /tmp/claude-skills

# 2. Copy this skill into your project (or ~/.claude/skills for all projects)
mkdir -p .claude/skills
cp -r /tmp/claude-skills/engineering/llm-cost-optimizer/skills/llm-cost-optimizer .claude/skills/llm-cost-optimizer

Skill source: engineering/llm-cost-optimizer/skills/llm-cost-optimizer/SKILL.md

⚠️ Good to know

The skill is not for RAG pipeline design or improving prompt quality; it assumes you have access to provider pricing and model capabilities.

❓ FAQ

What is the first step if there is no token logging?

The first deliverable is a logging schema to instrument per-request token usage and cost; optimization cannot happen without baseline data.

How does the skill recommend reducing costs?

It recommends applying techniques in ROI order: model routing, prompt caching, output length control, prompt compression, semantic caching, and request batching.

What should I do if prompt compression degrades quality?

Restore the compressed section and flag that instruction as compression-resistant, as over-compression can cause hallucinations and retries.

🤖 Overview, features, install steps and FAQ were generated from the project's SKILL.md on Sep 4, 2026. Always check the original source before running commands.