Repository navigation
fix(actions): pricing auto update action - #33073
oskarkocol wants to merge 16 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR fixes a silently-failing weekly workflow that auto-updates
Confidence Score: 5/5Safe to merge — the change is confined to a scheduled maintenance workflow and its helper script, with no impact on the production request path. Both changed files are part of an offline maintenance workflow. The Python fix is minimal and targeted: it converts hard field accesses into guarded lookups, directly matching the crash shown in the error trace. The workflow restructuring follows standard GitHub Actions patterns, restores the repository guard that was removed for testing, and correctly gates PR creation behind a successful push. No production code, SDK surface, or database logic is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| .github/workflows/auto_update_price_and_context_window_file.py | Core bug fix: made pricing and context_window fields optional in transform_vercel_ai_gateway_data to handle embedding/video models that lack output pricing; whitespace-only cleanup elsewhere. |
| .github/workflows/auto_update_price_and_context_window.yml | Workflow restructured: git config, branching, script run, and PR creation consolidated into one step with correct conditional guards; BASE_BRANCH fallback added; repo guard restored; GITHUB_TOKEN used instead of GH_TOKEN secret. |
Reviews (3): Last reviewed commit: "revert repo guard" | Re-trigger Greptile
|
Thanks for finding the Vercel crash first. Closing, since #48473 removed this workflow and its script from main |
Relevant issues
This PR brings back to life the automated refresh for Vercel AI gateway and OpenRouter gateway.
Fixes:
Context
This action refreshes models and their prices from OpenRouter and Vercel AI SDK: https://github.com/BerriAI/litellm/blob/litellm_internal_staging/.github/workflows/auto_update_price_and_context_window.yml
However, it was failing silently. Example of a failed run: https://github.com/BerriAI/litellm/actions/runs/29173737985/job/86599055076
I reproduced the error on my fork:
The reason is that it fails for models that have no output pricing. For example, alibaba/qwen3-embedding-0.6b only has input pricing. Missing pricing.output (embeddings, video models) makes float(row["pricing"]["output"]) throw.
Screenshot from Vercel AI gateway of a model that has no output pricing:

Works on the fork: https://github.com/oskarkocol/litellm-contrib/actions/runs/29249385824/job/86813935404
Note: I followed the repo convention of using ${{ secrets.GITHUB_TOKEN }} If you see an error like “GitHub Actions is not permitted to create or approve pull requests (createPullRequest)” due to repo permissions, use a PAT stored as custom secret, like ${{ secrets.GH_TOKEN }}
Follow-up PRs (stacked)
This PR fixes the workflow only. Provider additions are split out and stacked on this branch:
fix/auto-update-action). Draft PR.Please merge this PR first; the follow-ups will be retargeted to
litellm_internal_stagingafter it lands.Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays 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
Type
🐛 Bug Fix
✅ Test
Changes
QA runbook
Final Attestation