chore(weave): add manual cost overrides and update costs 5/19#6889
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=fd637308e206d7cc47808a14c5f53ed6e9d40497 |
gtarpenning
approved these changes
May 21, 2026
Member
gtarpenning
left a comment
There was a problem hiding this comment.
what happens if both litellm reports and we manually enter? who wins? probably should be litellm?
Contributor
Author
|
It was the manual costs, but makes sense to me to default to litellm |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Introduces a
manual_costs.jsonfile and a correspondingfetch_manual_costs()function to allow manually curated cost overrides for models that litellm andmodelsBegin.jsondo not cover or cover incorrectly. Manual costs take precedence over both litellm and modelsBegin sources when merging inmain().New manual costs
gemini-3.1-flash-lite(via Gemini, Vertex AI, and OpenRouter)The
fetch_manual_costs()function gracefully handles missing or malformed files by returning an empty dict and printing a warning, so the pipeline continues running from litellm and modelsBegin sources.Ran make update_costs and make update_model_providers after adding the manual costs file
Testing
Unit tests were added for
fetch_manual_costs()covering:main()pipelineExisting
test_maintests were updated to mockfetch_manual_coststo maintain test isolation.