Add cost and latency to the model leaderboard#81
Merged
Conversation
analysis.model_cost_latency() joins per-model cost (USD total and per-household) and median per-household latency into the modelStats that build_dashboard_payload emits. Cost reuses usage_summary_by_model; latency is the median of each household's summed request-time, which is robust to the occasional rate-limit retry that inflates the mean. config.PRICE_OVERRIDES_PER_1M fills cost for provider preview models litellm cannot yet price (grok-build-0.1 at $1/$2 per 1M, https://x.ai/api). The leaderboard renders new "Cost / hh" and "Latency" columns (desktop grid + mobile line). Verified by regenerating the June run: the new fields populate for all 13 models (grok-build-0.1 at ~$4.49) with zero change to any accuracy number. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Leaderboard: per-household cost now formats to a consistent 3 decimals (was 2 significant figures, which varied 2-4 decimals and rounded the cheapest models to $0.00). - Paper: new "Cost and latency" Results section with a per-model table (cost/household + median latency next to exact match) and a templated summary. Computed from the frozen run's predictions.csv.gz via the same model_cost_latency helper, so no snapshot regeneration or re-freeze. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the switch to minutes above 60s; every model's median latency now reads in seconds (e.g. 135s, not 2.2 min) for a single consistent unit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Cost / household and Latency columns to the model leaderboard.
Pipeline
analysis.model_cost_latency(predictions, price_overrides)computes per model:costUsd(run total) andcostPerHousehold(÷ distinct households), reusingusage_summary_by_modelso totals match the existing usage CSV.latencySeconds— the median of each household's summed request-time. Median rather than mean/sum because the per-call timer wraps litellm's retry/backoff, so a few rate-limited calls inflate the mean; the median reflects a typical household.config.PRICE_OVERRIDES_PER_1Mfills cost for provider preview models litellm's price map doesn't cover yet — currentlygrok-build-0.1at $1/$2 per 1M (https://x.ai/api), which otherwise showed blank cost.build_dashboard_payload, so everymodelStatsentry carries them.UI
ModelStatgainscostUsd/costPerHousehold/latencySeconds/totalTokens(all optional).ModelLeaderboardadds the two columns (desktop 12-col grid + a mobile line) with tooltips. Cost is shown to 2 significant figures (range ~$0.002–$0.29); latency as66s/1.1m.Verification
export_country: zero change to any accuracy number (max drift 0.00000) — only the new fields are added. All 13 models populate;grok-build-0.1≈ $4.49.tests/test_cost_latency.py);test_analysis.pystill green (79 passed).eslint --max-warnings=0clean; rendered locally — GPT-5.5 $0.12 / 1.1m, Gemini 3.1 Pro $0.085 / 45s, Opus 4.7 $0.29 / 53s.Data
The columns render empty against the current published artifact (it predates these fields). They populate on the next
export/publish-dashboard— the pipeline change makes future regenerations include them automatically.🤖 Generated with Claude Code