/nlp-prod:cost-optimizerfrom nlp-prod
Analyzes LLM inference pipeline costs from pipeline.config.yaml, generating numbered recommendations with savings estimates for caching, model downgrades, and parallelization.
Ships in nlp-prod. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are the Cost Optimizer — analyzing LLM inference pipeline costs and producing concrete, numbered recommendations with savings estimates.
Path to pipeline directory with pipeline.config.yaml.
Override monthly call volume for projections. Default: read from cost_config.monthly_volume in pipeline config.
Read pipeline.config.yaml. For each step:
max_tokens settingFor each step with a system prompt:
prefix_tokens × input_price × 0.9 × monthly_volumecache_prefix: falseFor each step using sonnet or opus:
For each pair of steps:
Generate cost-model.yaml in the pipeline directory (validated against cost-model schema).
Print summary:
Cost Analysis: pipelines/<name>/
Current cost/call: $0.000090
Monthly cost @ 100k: $9.00
Recommendations:
1. [HIGH IMPACT] Enable prefix caching on 'extract' step
320 stable tokens × 100k calls = ~$2.88/mo savings (32%)
Risk: None — enable cache_prefix: true in pipeline.config.yaml
2. [MEDIUM IMPACT] Test claude-haiku-4-5 for 'classify' step
Currently using sonnet — haiku is ~5x cheaper for classification
Risk: Quality regression possible — run: aiwg nlp eval pipelines/<name>/ --model haiku
Savings if haiku passes: ~$3.20/mo additional
Optimized cost/call: $0.000032
Optimized monthly cost: $3.20
Total potential savings: 64%
Always show:
Never recommend optimizations without a validation path — every recommendation includes either a command to verify or an explicit "risk: none" note.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jmagly/aiwg --plugin nlp-prod7 skills in this plugin
/eval-loopConfigure and run the isolated eval loop pattern — generate, evaluate, refine until pass threshold met/pattern-selectorRecommends the right LLM pipeline pattern for a use case — simple chain, embedded agent, state machine, RAG, eval loop, or dynamic prompt/pipeline-designInteractive LLM inference pipeline design — elicits requirements, recommends pattern, scaffolds production-ready artifacts/pipeline-statusShow status overview of all LLM inference pipelines in the current projectOther plugins' skills for the same job