cost-optimizer

Track cumulative LLM costs across DAG executions and enforce budget thresholds.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/CenredJun/openclaw-claudecode-setup-kit --skill cost-optimizer-cenredjun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-optimizer
Source: https://github.com/CenredJun/openclaw-claudecode-setup-kit/tree/main/skills/cost-optimizer
Command: npx skills add https://github.com/CenredJun/openclaw-claudecode-setup-kit --skill cost-optimizer-cenredjun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill monitors and enforces cost budgets for multi-node LLM DAG executions by tracking cumulative spend and making real-time decisions to prevent budget overruns.

Core Features & Use Cases

  • Real-time Budget Enforcement: Continuously compare spent plus estimated node cost against a defined budget and act when thresholds are crossed.
  • Adaptive Model Tiering: Downgrade planned model tiers (e.g., Opus → Sonnet → Haiku) for remaining nodes to reduce spend.
  • Execution Controls: Skip optional nodes, invoke human gates, or stop execution early when necessary to preserve budget.
  • Post-Execution Reporting: Produce detailed cost breakdowns, counts of skipped/downgraded nodes, and savings recommendations for future runs.
  • Use Case: Run this Skill during a customer-research pipeline to avoid expensive model calls and return partial results if the budget is exhausted.

Quick Start

Run the cost-optimizer for dag-123 with a 0.50 USD budget to enforce spending limits during execution.

Frequently Asked Questions about cost-optimizer

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

FAQPage Schema
How do I enforce LLM cost budgets during multi-node DAG pipeline executions?

To control LLM spending during pipeline runs, this process tracks cumulative costs across DAG nodes and triggers real-time actions like model downgrades or node skipping when thresholds are crossed.

What's the best way to automatically downgrade LLM model tiers when a pipeline budget is reached?

The best way to downgrade LLM model tiers automatically is by applying adaptive model tiering, which shifts planned models like Opus to Sonnet or Haiku for remaining nodes to reduce spend.

Can I skip optional nodes in an LLM DAG workflow to preserve my remaining execution budget?

Yes, you can skip optional nodes in an LLM DAG workflow to preserve your budget, alongside invoking human gates or halting execution early when necessary to control spend.

What do I need to set up real-time cost monitoring for LLM batch processing workflows?

You need per-node cost estimates, historical token-usage averages, model-tier cost profiles, and integration hooks to downgrade models or halt execution to set up real-time cost monitoring for batch processing.

Does cost optimization for LLM pipelines work with interactive workflows or only batch processing?

Cost optimization for LLM pipelines works with both batch processing and interactive workflows, allowing execution pausing or model tiering to control spend across various multi-node DAG run contexts.

Why do I need historical token-usage averages to monitor LLM DAG execution costs?

You need historical token-usage averages to accurately estimate per-node costs before execution, enabling the system to compare spent plus estimated costs against a defined budget and prevent overruns.