llm-cost-optimizer

Reduce LLM API spend with model routing, caching, and prompt compression.

1|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/hbvg234/jnmt.vn --skill llm-cost-optimizer-hbvg234
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-cost-optimizer
Source: https://github.com/hbvg234/jnmt.vn/tree/main/.claude/skills/llm-cost-optimizer
Command: npx skills add https://github.com/hbvg234/jnmt.vn --skill llm-cost-optimizer-hbvg234

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams reduce LLM API spend while maintaining quality by applying cost-conscious practices across routing, caching, prompts, and observability.

Core Features & Use Cases

  • Model Routing by task complexity to use smaller, cheaper models where appropriate.
  • Prompt Caching and compression to reduce per-request token usage.
  • Output length control and per-endpoint max_tokens to prevent over-generation.
  • Observability and cost dashboards to identify and track savings opportunities.
  • Use Case: teams launching AI features can design cost-aware workflows from day one.

Quick Start

Audit current usage, enable per-request cost logging, and begin applying routing and caching to reduce 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 cut LLM API spend without losing output quality?

Reduce LLM API spend by applying model routing to use cheaper models for simple tasks, prompt compression to lower token usage, and semantic caching to prevent redundant calls. These controls maintain user-facing quality while cutting costs.

What is model routing and how does it lower LLM costs?

Model routing lowers LLM costs by directing requests to smaller, cheaper models when task complexity allows. It ensures expensive models are only used for demanding tasks, reducing overall API spend while maintaining response quality.

How do I set up per-endpoint cost controls for AI endpoints?

Set up per-endpoint cost controls by configuring output length limits and max_tokens to prevent over-generation. Apply specific routing and caching rules per endpoint to meet defined cost and performance targets.

Does prompt caching actually reduce token usage for LLM workflows?

Prompt caching reduces token usage by storing and reusing prompt prefixes or semantically similar queries. Combined with prompt compression, it minimizes the total tokens processed per API request, lowering spend.

Can I track LLM cost savings with observability dashboards?

You can track LLM cost savings using observability dashboards to monitor per-request cost logging. This identifies savings opportunities across routing, caching, and prompt control implementations for cost-sensitive deployments.

What are the limitations of prompt compression for cost optimization?

Prompt compression limitations include the risk of losing critical context when reducing token counts. To mitigate this, apply output length control and per-endpoint max_tokens to prevent over-generation while monitoring quality through observability dashboards.