Repository navigation
fix(ci): make the weekly Vercel AI Gateway and Friendli price sync open its PR - #33275
mateo-berri wants to merge 33 commits into
Conversation
|
Generated by Claude Code |
[Medium impact] The PR affects shared model price data used in LiteLLM cost calculations. Clear removed Vercel price fields before merging so future syncs cannot keep billing obsolete rates FindingsSummaryRepairs the weekly Vercel AI Gateway and Friendli price sync and adds a manual trigger
Reviews (15) · Last reviewed commit: "fix(ci): carry tiered and service-tier p..." · Reviewed by Greptile |
Merging this PR will not alter performance
|
|
Generated by Claude Code |
…itellm_fix_pricing_auto_update_action
|
Generated by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Resume branch drops pricing entries
- Added a
git merge --no-edit origin/${BASE_BRANCH}step after checking out an existing dated branch so any pricing entries added to the default branch since the dated branch was cut are included before the Python script rewrites the JSON.
- Added a
Or push these changes by commenting:
@cursor push bd5f928cab
Preview (bd5f928cab)
diff --git a/.github/workflows/auto_update_price_and_context_window.yml b/.github/workflows/auto_update_price_and_context_window.yml
--- a/.github/workflows/auto_update_price_and_context_window.yml
+++ b/.github/workflows/auto_update_price_and_context_window.yml
@@ -33,6 +33,7 @@
git fetch origin "${BASE_BRANCH}" "${BRANCH_NAME}" || true
if git show-ref --verify --quiet "refs/remotes/origin/${BRANCH_NAME}"; then
git checkout -B "${BRANCH_NAME}" "origin/${BRANCH_NAME}"
+ git merge --no-edit "origin/${BASE_BRANCH}"
else
git checkout -b "${BRANCH_NAME}" "origin/${BASE_BRANCH}"
fiYou can send follow-ups to the cloud agent here.
|
@litellm-stampbot |
litellm-stampbot: risk highNot approved at Rules (
Judge: skipped, the rules alone decided. Pushes do not re-run this check. Comment |
…uto_update_action # Conflicts: # .github/scripts/auto_update_price_and_context_window_file.py # .github/workflows/auto_update_price_and_context_window.yml # tests/unit/test_auto_update_price_and_context_window_file.py
|
@litereview code-review |
|
|
bugbot run |
|
@litereview guide |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 99eb06c. Configure here.
|
|
@litellm-stampbot |
| exit 0 | ||
| fi | ||
| today="$(date +'%Y-%m-%d')" | ||
| branch="litellm_price_map_auto_update_$today" |
|
@litereview code-review |
…l the run on a failed catalog fetch
|
@litereview code-review |
| all_remote_data: Final = {**transform_vercel_ai_gateway_data(vercel_rows), **friendli_data} | ||
| sync_local_data_with_remote(local_data, all_remote_data, replace_keys=frozenset(friendli_data)) |
There was a problem hiding this comment.
When Vercel removes or moves a price tier, this sync keeps the old price fields because only Friendli entries are replaced. Billing still reads those fields, so later syncs can keep recording obsolete prices. Clear previously synced price fields before merging current rates
Knowledge Base Used: Provider adapters and capabilities
| def _threshold_label(lower_bound: int) -> str: | ||
| thousands: Final = round(lower_bound / 1000) | ||
| return f"{thousands}k" if abs(lower_bound - thousands * 1000) <= 1 else str(lower_bound - 1) |
|
Closing, since #48473 removed this workflow from main. Vercel AI Gateway and Friendli prices still need a source in the provider pricing sync |

The weekly job that syncs Vercel AI Gateway and Friendli prices into the cost map has failed every Sunday since July, so newer models like
vercel_ai_gateway/anthropic/claude-haiku-5.5never got a price. This fixes the sync script and the PR step, and adds a manual triggerIt also keeps Vercel's long-context and service-tier prices, so those requests bill at their real rates. OpenRouter is dropped, since its rows left the cost map in #45665 to #45669. Each sync still lands as a PR someone has to review and merge
/stupid
Original
TLDR
Problem this solves:
How it solves it:
_above_<N>k_tokenskeys and priority, flex, and ultrafast prices as_<tier>keys_above_271999_tokenskey fails the schema and splits one threshold across two namesUser Flow
Before: every Sunday the sync goes red and no price update PR shows up
mainAuthor identity unknownand the run is redGET https://github.com/BerriAI/litellm/pullsshows no price update PRGET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.jsonstill has novercel_ai_gateway/anthropic/claude-haiku-5.5gh workflow run auto_update_price_and_context_window.ymlanswers HTTP 422After: the sync goes green and opens a PR against
mainfor someone to reviewmainchore(models): sync vercel_ai_gateway and friendliai prices <date>fromlitellm_price_map_auto_update_<date>_<run id>GET https://github.com/BerriAI/litellm/pullsshows that PR, touching onlyvercel_ai_gateway/andfriendliai/entriesvercel_ai_gateway/anthropic/claude-haiku-5.5with its per-token pricesgh workflow run auto_update_price_and_context_window.ymlstarts a run, which skips while a sync PR is openRelevant issues
Supersedes #33073 by @oskarkocol, which found the Vercel crash first
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
GitHub Actions is the client. The fixed workflow only runs on BerriAI/litellm after merge, so the After leg runs 6109156's copy on real GitHub Actions in a private snapshot repo that keeps only this workflow and swaps the repo guard
Before (e333cca)
Sync run
Every recent run, and the cost map today
Manual trigger
HTTP 422
After (6109156)
Sync run
The run's log
The PR's title, branch, and author
The schedule event
A temporary five-minute schedule on the snapshot fired no run in an hour, so the dispatch above stands in for it. The schedule leg differs only in how
github.event.repository.default_branchresolves, and the Together sync, which uses the same expression, runs green on schedule every day and opens its PRs againstmain(https://github.com/BerriAI/litellm/actions/runs/39383201571, #46856)Synced files
Root and backup match, only the two providers change, and the merged map passes the schema
A diff of PR 2's two files against the snapshot's checked-in ones, and the synced map run through the schema of
test_aaamodel_prices_and_context_window_json_is_validOnce PR 2 merged, the snapshot's cost map carries the model
Tiered prices
Long-context and service-tier prices land as their own keys
Sync PR already open
A second dispatch while PR 2 was still open
https://github.com/mateo-berri/litellm-price-sync-qa/actions/runs/39543914013
Manual trigger
Run starts
Both runs above are
workflow_dispatchevents started withgh workflow runType
🐛 Bug Fix
🚄 Infrastructure
Caveats (if any)
Low
Final Attestation
Bugbot summary