feat(weave): extract cache token pricing from LiteLLM#6485
Draft
andrewtruong wants to merge 1 commit intoandrew/l3-cache-price-columnsfrom
Draft
feat(weave): extract cache token pricing from LiteLLM#6485andrewtruong wants to merge 1 commit intoandrew/l3-cache-price-columnsfrom
andrewtruong wants to merge 1 commit intoandrew/l3-cache-price-columnsfrom
Conversation
Extract cache_read_input_token_cost and cache_creation_input_token_cost from LiteLLM's model_prices JSON and populate them into the llm_token_prices table. This fills the new columns added in the L3 pricing migration with actual data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
cache_read_input_token_costandcache_creation_input_token_costfrom LiteLLM'smodel_prices_and_context_window.jsoncache_creation_input_token_cost→cache_write_input_token_cost(our column name)update_costs.py(fetching) andinsert_costs.py(DB insertion) to handle the new fieldsDepends on
Test plan
python update_costs.pyand verifycost_checkpoint.jsoncontainscache_read_inputandcache_write_inputfieldscache_read_input_token_cost: 3e-07)🤖 Generated with Claude Code