Agent Model Cost Stack Optimizer — v1.0
Category: finance
Price: $4.99
Released: 2026-08-06
What it does
Agent Model Cost Stack Optimizer turns operator-provided automation notes into a model-routing and token-cost risk report. It identifies budget cap gaps, task-tier mismatches, missing fallback rules, and escalation blind spots — returning a deterministic PASS / REVIEW / BLOCKED JSON report with scored evidence and recommendations. Reads local notes only; no API calls, no live services, no config mutations.
Use cases
- Audit agent pipeline notes before deployment to catch missing budget caps and token-cost overruns before they hit production billing.
- Score model-routing decisions in automation runbooks, flagging task-tier mismatches where expensive models are used for cheap tasks without justification.
- Validate that fallback rules and escalation points are documented before any multi-model agent stack goes live.
Requirements
- Python 3.8+
- Standard library only (
argparse,json,re,pathlib) — no pip dependencies, no network access, no external services.
Example usage
# Analyze from a notes file
python3 scripts/model_cost_stack_optimizer.py --notes /path/to/automation-notes.md --json
# Analyze inline text
python3 scripts/model_cost_stack_optimizer.py --text "GPT-4 used for all tasks; no budget cap; no fallback defined" --json
# Run built-in self-test
python3 scripts/model_cost_stack_optimizer.py --self-test --json
Expected output:
{
"status": "REVIEW",
"score": 58,
"evidence": ["budget_cap: missing", "task_tier: undifferentiated", "fallback_rule: absent"],
"recommendations": ["Set per-task token budget caps", "Route low-complexity tasks to cheaper models", "Define fallback model for API failures"],
"mutated_files": []
}
Self-test returns ok: true, clean fixture PASS, risky fixture BLOCKED, and mutated_files: [].