L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Données et recherche · SKILL.md

model-cost-review

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".

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: model-cost-review description: > 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". argument-hint: "[model or feature name]" user-invocable: true

Model Cost Review

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.

Process

Step 1: Usage Profile

Document current model usage:

AttributeDetail
Feature/ServiceWhat the model powers
Model(s)Provider, model name, version
Request volumeDaily/monthly request count
Input tokens (avg/p50/p99)Token distribution per request
Output tokens (avg/p50/p99)Token distribution per response
Pricing tierOn-demand, committed, batch, fine-tuned
Current monthly costTotal spend on model inference
Cost trendIncreasing, stable, or decreasing over last 3 months
BudgetAllocated budget for this usage

Step 2: Cost Breakdown

Decompose costs by dimension:

DimensionMetricCost% of Total
Input tokensTotal tokens/month$......%
Output tokensTotal tokens/month$......%
Fine-tuning (if applicable)Training tokens$......%
EmbeddingsEmbedding requests/month$......%
Image/audio (if applicable)Requests/month$......%
Total$...100%

Break down further by:

  • Feature or endpoint
  • User segment (free vs. paid, internal vs. external)
  • Time of day / peak vs. off-peak
  • Success vs. wasted calls (errors, retries, timeouts)

Step 3: Optimization Analysis

Evaluate each optimization lever:

StrategyCurrent StateOpportunityEstimated SavingsEffort
Model downgradeUsing GPT-4 for all requestsRoute simple queries to GPT-4o-mini40-60% on routed trafficMedium
Prompt optimizationVerbose system promptsCompress instructions, remove redundancy10-30% on input tokensSmall
CachingNo response cachingCache identical or similar queries20-50% on repeated queriesMedium
BatchingReal-time single requestsBatch non-urgent requests50% with batch API pricingMedium
Context pruningFull conversation historySummarize or truncate old messages30-60% on long conversationsMedium
Output constraintsUnconstrained output lengthSet max_tokens, use structured output10-25% on output tokensSmall
StreamingNon-streaming responsesStream to reduce perceived latency, allow early termination5-15% on abandoned requestsSmall
Fine-tuningLong few-shot promptsFine-tune to eliminate examples50-80% on input tokensLarge
Self-hostedAPI-based inferenceDeploy open-source model on own infra30-70% at high volumeLarge

Step 4: Model Selection Analysis

Compare model options for the workload:

ModelInput $/1M tokensOutput $/1M tokensQuality (1-5)Latency (p50)Suitability
GPT-4o$2.50$10.005800msComplex reasoning
GPT-4o-mini$0.15$0.603.5300msSimple tasks
Claude Sonnet$3.00$15.004.5600msLong-form, analysis
Claude Haiku$0.25$1.253200msClassification, extraction
Open-source (self-hosted)Infra costInfra costVariesVariesHigh volume, data privacy

Update pricing to current rates at time of review.

Step 5: ROI Analysis

For each recommended optimization:

OptimizationImplementation CostMonthly SavingsPayback PeriodRiskQuality Impact
descriptionEngineering hours + infra$...... monthsLow/Med/HighNone / Minimal / Moderate

Output Format

1. Cost Summary

MetricValue
Current monthly cost$...
Monthly budget$...
Budget utilization...%
Cost per request (avg)$...
Cost per successful outcome$...
Month-over-month trend+/-...%

2. Cost Breakdown

Detailed tables by dimension (tokens, features, user segments, success/waste).

3. Waste Identification

Waste TypeVolumeCost ImpactRoot Cause
Retries due to errors... requests/day$.../monthTimeout config, rate limits
Unused/ignored responses... requests/day$.../monthUI abandonment, cache miss
Overly verbose prompts... extra tokens/request$.../monthUnoptimized system prompt
Wrong model for task... requests/day$.../monthNo model routing logic

4. Optimization Recommendations

Prioritized list with effort, savings, and implementation guidance.

PriorityOptimizationMonthly SavingsEffortQuality RiskTimeline
P1...$...SmallNoneThis week
P2...$...MediumMinimalThis sprint
P3...$...LargeModerateNext quarter

5. Model Selection Recommendation

Recommended model(s) per use case with cost comparison.

6. Projected Cost After Optimization

ScenarioMonthly CostSavings vs. CurrentNotes
Current$...-Baseline
Quick wins (P1)$...-...%No quality impact
Full optimization (P1+P2)$...-...%Minimal quality impact
Aggressive (P1+P2+P3)$...-...%Some quality tradeoffs

7. Monitoring Dashboard Spec

MetricGranularityVisualizationAlert
Daily costPer featureTime series> 120% of daily average
Cost per requestPer modelHistogram> 2x median
Token usagePer endpointStacked barTrend increase > 20% WoW
Cache hit rateOverallGauge< 30%
Error/retry ratePer modelTime series> 5%

Quality Checklist

  • Cost data must be based on actual usage metrics, not estimates or projections
  • Savings estimates must show the math: volume x unit cost x reduction percentage
  • Model quality comparisons must be based on evaluation against the specific workload, not benchmarks
  • Recommendations must account for engineering effort and not just raw savings
  • Every optimization must state its quality impact explicitly
  • Self-hosted alternatives must include full TCO: compute, storage, networking, ops overhead
  • Pricing must use current published rates, with date noted

Edge Cases

  • Multi-model architectures: Track costs per model and optimize routing logic between them
  • Fine-tuned models: Include training costs amortized over expected usage lifetime
  • Embedding-heavy workloads: Optimize vector dimensions, batch embedding calls, cache embeddings
  • Streaming use cases: Account for token consumption on abandoned/interrupted streams
  • Multi-tenant platforms: Allocate costs per tenant and identify cost outliers
  • Rapidly growing usage: Project costs at 3x and 10x current volume to catch scaling cliffs
  • Regulated environments: Some optimizations (caching, model downgrade) may conflict with compliance requirements
  • Seasonal traffic: Use peak-period costing, not averages, for capacity and budget planning
Skills enregistrées