llm-cost-optimizer

Reduce LLM API costs through model routing, prompt caching, and token optimization.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/Rohithdgrr/REEK-uninstaller --skill llm-cost-optimizer-rohithdgrr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-cost-optimizer
Source: https://github.com/Rohithdgrr/REEK-uninstaller/tree/main/.opencode/skills/llm-cost-optimizer
Command: npx skills add https://github.com/Rohithdgrr/REEK-uninstaller --skill llm-cost-optimizer-rohithdgrr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM API spend grows silently as AI features ship, and most teams lack visibility into which endpoints, models, or prompts drive the bill. This Skill audits per-request costs, identifies the 20% of traffic causing 80% of spend, and applies proven techniques to cut costs by 40-80% without degrading output quality. ## Core Features & Use Cases - Cost Audit & Instrumentation: Designs per-request logging schemas (model, tokens, latency, cost per feature) so you can see exactly where money goes before optimizing. - Model Routing & Tiering: Classifies requests by complexity and routes simple tasks to cheaper models, mid-tier tasks to mid models, and only complex reasoning to frontier models. - Caching & Compression: Implements prompt caching for static system prompts, semantic caching for repeated queries, and prompt compression to strip token-wasting filler. - Use Case: Your AI chatbot feature costs $8,000/month and every request hits the largest model with a 3,000-token system prompt. This Skill flags the caching opportunity, designs a routing layer, and projects savings per fix. ## Quick Start Ask the assistant to audit your LLM API costs and identify which endpoints and models are driving the most spend.

Frequently Asked Questions about llm-cost-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce LLM API costs without hurting quality?▼

Reduce LLM API costs by routing requests to the cheapest adequate model tier, caching static system prompts, capping max_tokens per endpoint, and compressing prompt filler. Measure per-feature spend first, then apply fixes in ROI order while monitoring output quality.

What is model routing and how much does it save?▼

Model routing classifies each request by complexity and sends simple tasks like classification or extraction to small models, reserving large models for complex reasoning. Routing even 20% of traffic to cheaper models typically yields 60-80% cost reduction on that routed traffic.

How does prompt caching work with Anthropic or OpenAI?▼

Prompt caching stores static content like system prompts and few-shot examples so repeated requests skip reprocessing those tokens. Anthropic uses cache_control markers, OpenAI applies it automatically on some models, and Google offers context caching, cutting cached traffic costs by 40-90%.

Why is my LLM bill so high even with low traffic?▼

High bills with low traffic usually come from oversized system prompts sent on every request, missing max_tokens caps causing over-generation, or all requests hitting the most expensive model. Instrument per-request token logging to find the exact driver.

When should I not compress a prompt?▼

Avoid compressing task-critical instructions, output format specifications, or domain constraints, since over-compression causes hallucination and low-quality outputs that trigger costly retries. Compress only filler phrases and redundant context already present elsewhere.