Repository navigation
Pricing: re-pricing tool (re-cost routers at the current price table, no re-grading) - #261
Merged
Merged
Conversation
…hout re-grading
scripts/pricing/reprice.py re-costs every row the evaluator costed, from the
token counts already in the prediction file, with the evaluator's own
compute_row_cost (answer plus router calls, served model when priced), then
recomputes the metrics with the evaluator's own router_metrics. No answer is
graded and no submitted code runs.
reprice.py ROUTER [ROUTER ...] report only (e.g. a new submission)
reprice.py --all every router in the manifest
reprice.py --all --write rewrite costs (file formatting kept) and
README rows, re-ranking the table
run.py: the metric computation moves out of compute_router_metrics into
router_metrics(), which returns the metrics.json dict; compute_router_metrics
keeps logging and writing metrics.json as before.
Co-Authored-By: Claude Opus 5.5 <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.
A tool to re-price routers at the current price table without re-grading. Use it after a price sync, to keep the leaderboard at current prices, or on a new submission whose file was graded with an older table. Builds on #218, #250 and #251 (merged).
What it does
scripts/pricing/reprice.pyre-costs every row the evaluator costed, from the token counts already in the prediction file:compute_row_cost, which covers the answer plus the router's own model calls, billed at the model that actually answered when it has a price.router_metrics.With
--write:run.py: the metric computation moves out ofcompute_router_metricsintorouter_metrics(), which returns themetrics.jsondict.compute_router_metricslogs and writesmetrics.jsonas before.Testing
tests/test_reprice.py(14): current prices, uncosted rows, served model, router calls, file formatting, README update and re-rank,router_metricsvsmetrics.json--writeNote: re-pricing also moves the optimality columns. Opt.Sel and Opt.Cost compare a router's pick with the cheapest correct candidate, so new prices can change which candidate that is. With the synced prices, Hybrid Router's Opt.Sel goes from 89.87 to 16.67 (qwen3-235b is no longer the cheapest) and Cross-Router's from 17.24 to 45.73. Opt.Acc doesn't depend on price.
🤖 Generated with Claude Code