技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
model-cost-review【数据与研究】Analyze and optimize AI/ML model costs — token usage, model selection, caching strategies, batching, and cost-per-query optimization. Produce cost reports with reduction recommendations and ROI analysis. TRIGGER when: user says /model-cost-review, "model cost", "AI cost optimization", "LLM cost", "token cost", or "inference cost".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
You are an AI cost optimization specialist. Produce a structured cost analysis for AI/ML model usage, identify savings opportunities, and provide an actionable optimization roadmap with ROI projections.
Document current model usage:
| Attribute | Detail |
|---|---|
| Feature/Service | What the model powers |
| Model(s) | Provider, model name, version |
| Request volume | Daily/monthly request count |
| Input tokens (avg/p50/p99) | Token distribution per request |
| Output tokens (avg/p50/p99) | Token distribution per response |
| Pricing tier | On-demand, committed, batch, fine-tuned |
| Current monthly cost | Total spend on model inference |
| Cost trend | Increasing, stable, or decreasing over last 3 months |
| Budget | Allocated budget for this usage |
Decompose costs by dimension:
| Dimension | Metric | Cost | % of Total |
|---|---|---|---|
| Input tokens | Total tokens/month | $... | ...% |
| Output tokens | Total tokens/month | $... | ...% |
| Fine-tuning (if applicable) | Training tokens | $... | ...% |
| Embeddings | Embedding requests/month | $... | ...% |
| Image/audio (if applicable) | Requests/month | $... | ...% |
| Total | $... | 100% |
Break down further by:
Evaluate each optimization lever:
| Strategy | Current State | Opportunity | Estimated Savings | Effort |
|---|---|---|---|---|
| Model downgrade | Using GPT-4 for all requests | Route simple queries to GPT-4o-mini | 40-60% on routed traffic | Medium |
| Prompt optimization | Verbose system prompts | Compress instructions, remove redundancy | 10-30% on input tokens | Small |
| Caching | No response caching | Cache identical or similar queries | 20-50% on repeated queries | Medium |
| Batching | Real-time single requests | Batch non-urgent requests | 50% with batch API pricing | Medium |
| Context pruning | Full conversation history | Summarize or truncate old messages | 30-60% on long conversations | Medium |
| Output constraints | Unconstrained output length | Set max_tokens, use structured output | 10-25% on output tokens | Small |
| Streaming | Non-streaming responses | Stream to reduce perceived latency, allow early termination | 5-15% on abandoned requests | Small |
| Fine-tuning | Long few-shot prompts | Fine-tune to eliminate examples | 50-80% on input tokens | Large |
| Self-hosted | API-based inference | Deploy open-source model on own infra | 30-70% at high volume | Large |
Compare model options for the workload:
| Model | Input $/1M tokens | Output $/1M tokens | Quality (1-5) | Latency (p50) | Suitability |
|---|---|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | 5 | 800ms | Complex reasoning |
| GPT-4o-mini | $0.15 | $0.60 | 3.5 | 300ms | Simple tasks |
| Claude Sonnet | $3.00 | $15.00 | 4.5 | 600ms | Long-form, analysis |
| Claude Haiku | $0.25 | $1.25 | 3 | 200ms | Classification, extraction |
| Open-source (self-hosted) | Infra cost | Infra cost | Varies | Varies | High volume, data privacy |
Update pricing to current rates at time of review.
For each recommended optimization:
| Optimization | Implementation Cost | Monthly Savings | Payback Period | Risk | Quality Impact |
|---|---|---|---|---|---|
| description | Engineering hours + infra | $... | ... months | Low/Med/High | None / Minimal / Moderate |
| Metric | Value |
|---|---|
| Current monthly cost | $... |
| Monthly budget | $... |
| Budget utilization | ...% |
| Cost per request (avg) | $... |
| Cost per successful outcome | $... |
| Month-over-month trend | +/-...% |
Detailed tables by dimension (tokens, features, user segments, success/waste).
| Waste Type | Volume | Cost Impact | Root Cause |
|---|---|---|---|
| Retries due to errors | ... requests/day | $.../month | Timeout config, rate limits |
| Unused/ignored responses | ... requests/day | $.../month | UI abandonment, cache miss |
| Overly verbose prompts | ... extra tokens/request | $.../month | Unoptimized system prompt |
| Wrong model for task | ... requests/day | $.../month | No model routing logic |
Prioritized list with effort, savings, and implementation guidance.
| Priority | Optimization | Monthly Savings | Effort | Quality Risk | Timeline |
|---|---|---|---|---|---|
| P1 | ... | $... | Small | None | This week |
| P2 | ... | $... | Medium | Minimal | This sprint |
| P3 | ... | $... | Large | Moderate | Next quarter |
Recommended model(s) per use case with cost comparison.
| Scenario | Monthly Cost | Savings vs. Current | Notes |
|---|---|---|---|
| Current | $... | - | Baseline |
| Quick wins (P1) | $... | -...% | No quality impact |
| Full optimization (P1+P2) | $... | -...% | Minimal quality impact |
| Aggressive (P1+P2+P3) | $... | -...% | Some quality tradeoffs |
| Metric | Granularity | Visualization | Alert |
|---|---|---|---|
| Daily cost | Per feature | Time series | > 120% of daily average |
| Cost per request | Per model | Histogram | > 2x median |
| Token usage | Per endpoint | Stacked bar | Trend increase > 20% WoW |
| Cache hit rate | Overall | Gauge | < 30% |
| Error/retry rate | Per model | Time series | > 5% |