llm-cost-optimizer

Analyze LLM API usage logs and suggest cost optimizations. Use when you need to reduce LLM spending, compare model costs, find downgrade opportunities, detect caching wins, or compress verbose outputs. Supports OpenAI, Anthropic, Google, DeepSeek, and Meta models.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "llm-cost-optimizer" with this command: npx skills add evezart/llm-cost-optimizer

LLM Cost Optimizer

Analyze LLM API usage patterns and suggest optimizations to reduce costs by 50%+.

Quick Start

Run the analysis script against a usage log JSON file:

python3 scripts/analyze.py --input usage_logs/

Input Format

Usage logs are JSON arrays of objects with:

  • timestamp (ISO 8601)
  • model (e.g. "gpt-4o", "claude-sonnet-4-20250514")
  • input_tokens (int)
  • output_tokens (int)
  • task_type (optional: "general", "coding", "classification", "extraction", "summary", "creative", "analysis")
  • session_id (optional)
  • cached (optional bool)

Optimization Strategies

  1. Downgrade: Find simple calls (low output, basic task types) on premium models and suggest cheaper alternatives
  2. Cache: Detect repeated prompt patterns and recommend prompt caching
  3. Compress: Find verbose outputs and suggest prompt tuning for conciseness

Supported Models & Pricing

All pricing is per 1M tokens (input/output). Rates are in the PRICING dict in scripts/analyze.py.

Model Tiers

  • Premium: gpt-4o, claude-sonnet-4, gemini-2.5-pro
  • Mid: gpt-4.1-mini, claude-haiku-3-5, gemini-2.5-flash, deepseek-v3
  • Budget: gpt-4.1-nano, deepseek-r1, llama-4-maverick

Downgrade suggestions map premium → mid → budget for simple tasks.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ling Mem

Durable memory across sessions — a model of who the user is, not a log of what was done. Markdown core plus a RAG store via the `ling-mem` daemon. Same seman...

Registry SourceRecently Updated
General

Ai Bug Report Snapshot Card

Creates a tester-ready bug report snapshot with repro steps, environment, evidence inventory, impact, redaction notes, and open questions while keeping scree...

Registry SourceRecently Updated
General

Document Signature Packet Builder

Organizes document signing instructions into a clear checklist detailing signatures, dates, witnesses, attachments, logistics, and confirmation items for smo...

Registry SourceRecently Updated
General

MEV Engine

MEV Engine v6.5 — Minimal-enforcement task execution framework. 1 preflight command + 9 gates with trust-but-verify validation.

Registry SourceRecently Updated