Skip to main content

Model Expense Ranking

Every pricing model in the system is assigned a cost ranking ($, $$, $$$) so that dashboards and reports can surface relative expense at a glance. This helps tenants quickly identify high-cost models in their usage mix.

Cost Score

The cost score for a model is calculated as:

cost_score = MAX(prompt_price, completion_price)

This uses the higher of the two per-1M-token rates as the representative cost. The rationale is that the most expensive dimension (input or output) determines the model's practical cost profile.

Ranking Tiers

Models are bucketed into three tiers based on their cost score relative to the full distribution:

TierLabelMeaning
$BudgetLower third of the cost distribution
$$StandardMiddle third
$$$PremiumUpper third

Tier boundaries are recomputed whenever the pricing data changes, so they adapt as new models are added or prices shift.

Warn Flag

Models whose cost score is an outlier (significantly above the $$$ threshold) receive a warn flag. This flag triggers a visual indicator in the portal dashboard to draw attention to unusually expensive models that may be driving unexpected spend.

Recomputation

Rankings are not recomputed on every request or on a timer. They are recalculated only when prices change, during the PricingSync Azure Function run. This keeps the compute cost negligible:

  1. PricingSync pulls updated prices from Helicone
  2. If any price has changed, it recomputes cost scores for all affected models
  3. Updated rankings are written to the pricing_models table in SQL
  4. The previous rankings are archived to pricing_models_history for audit

Storage

TablePurpose
pricing_modelsCurrent model with pricing rates, cost score, tier, and warn flag
pricing_models_historyHistorical snapshots of pricing and rankings, timestamped

The portal reads from pricing_models to display tier badges and warn indicators on usage tables and dashboards.