cost-optimize-new

Reduces agent inference cost through prompt refinement, model cascades, and CI-overlap verification.

1|9|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/agenticgogol/Edureka_Coding_Agent_Enabled_Demo_11Jul --skill cost-optimize-new-agenticgogol
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cost-optimize-new
Source: https://github.com/agenticgogol/Edureka_Coding_Agent_Enabled_Demo_11Jul/tree/main/.claude/skills/cost-optimize-new
Command: npx skills add https://github.com/agenticgogol/Edureka_Coding_Agent_Enabled_Demo_11Jul --skill cost-optimize-new-agenticgogol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? LLM agent inference costs grow quickly in production, but cutting prompts or switching to cheaper models risks silently regressing quality. This Skill provides a gated, measurement-driven workflow for reducing cost per query without moving the needle on known failure modes. ## Core Features & Use Cases - Backlog gate: Refuses to optimize while any failure mode in evals/backlog.md lacks a validated metrics record, so cost changes are never confounded with pre-existing regressions. - Five ordered techniques: Prompt refinement, few-shot calibration, task decomposition, KV-cache-friendly prompt ordering, and model cascades tuned by scripts/cascade_threshold.py against labeled confidence triples. - CI-overlap verification: Accepts an optimization only when the new run's bootstrap confidence interval overlaps the baseline CI for every touched failure mode, rejecting point-estimate comparisons. - Use Case: An agent serving 100k queries/day is too expensive. Run this Skill to trim redundant prompt content, reorder static content first for prefix caching, and tune a cheap-to-expensive model cascade threshold within a user-specified accuracy-loss tolerance. ## Quick Start Ask the agent to run the cost optimization pass on the current agent, starting by checking that the evals backlog has no open failure modes.

Frequently Asked Questions about cost-optimize-new

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

FAQPage Schema
How do I reduce LLM agent inference cost without hurting accuracy?▼

Apply cost techniques incrementally against a recorded baseline: trim unused prompt content, calibrate few-shot examples, decompose large prompts, order static content first for KV-cache reuse, and tune a model cascade threshold. Verify each change with confidence-interval overlap, not point estimates.

How do I tune a model cascade confidence threshold?▼

Run both the cheap and expensive models against a labeled set to build (confidence, cheap_correct, expensive_correct) triples, then call tune_threshold in scripts/cascade_threshold.py with a max_accuracy_loss tolerance. It returns the threshold minimizing escalation rate within that tolerance.

Why does the skill refuse to optimize cost sometimes?▼

It refuses when evals/backlog.md contains failure modes without a validated metrics record or passing code eval. Optimizing while a failure mode is open makes it impossible to attribute later regressions to the cost change versus the pre-existing issue.

Why is a point-estimate accuracy comparison not acceptable?▼

A higher point estimate can be pure sampling noise when confidence intervals overlap heavily. The accept criterion requires the new run's bootstrap CI to overlap the baseline CI for every touched failure mode, otherwise the technique is reverted.

What happens if no cascade threshold meets the accuracy tolerance?▼

tune_threshold raises a ValueError reporting that the cheap model is not a viable cascade stage at that tolerance. The correct response is to report this rather than forcing a threshold that violates the accuracy-loss constraint.