Repository navigation
proxy: move model prices to a data file and warn on unpriced models - #169
Closed
abu-tahir-0 wants to merge 1 commit into
Closed
abu-tahir-0 wants to merge 1 commit into
abu-tahir-0 wants to merge 1 commit into
Conversation
Prices move to model_prices.toml, packaged with the wheel and parsed once per process. Unknown models still fall back to the default price, but each is now logged once per run, so a mis-priced model is visible instead of silent. Adding a model or changing a price is a data edit, not a code change.
Contributor
Author
|
Closing this as a duplicate of #168, which was already open for the same issue. I missed it when picking the issue up; sorry for the noise. My branch had the same shape (TOML instead of JSON, plus loader/unit coverage), but there is no reason to review two implementations of the same change. Happy to help there if any of the test or packaging bits are useful. |
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 this changes
Closes #100.
budget.pyno longer keeps prices in a dict. They live inmodel_prices.toml, packaged insidemeridian.runtime.proxyand parsed once per process (load_prices), so adding or changing a price is a data edit. The unknown-model fallback stays, butBudgetLedger.chargenow logs it once per model per run, naming the model, the default price, and the file to edit.Also adds the current Claude 4.5 ids at their list prices (
claude-opus-4-5,claude-sonnet-4-5,claude-haiku-4-5), alongside the existing entries.How it was checked
make checkpasses (ruff,mypy --strict, unit tests) — excepttests/unit/test_web_vectors.py, which fails identically on a cleanmainhere (t_quantilediffers in the last bit:3.249835541592117vs...118); unrelated to this change.make integration/make e2e, if this touchesruntime/,snapshots/,store/,gate/,manifest/or the proxy — attempted the proxy integration tests, but this checkout has nomeridian-proxy:dev/checkout:devimages (make images); CI builds them.load_prices()from an extracted copy outside the source tree;model_prices.tomlis included and resolves.Anything a reviewer should know
PriceBook.from_tomlis the seam for the tests (and for a future--pricesflag), but there is no runtime override today.