Repository navigation
Conversation
Greptile SummaryThis PR makes the Vercel AI Gateway pricing importer tolerate missing or null pricing and token-limit fields while preserving existing local values for omitted fields.
Confidence Score: 5/5The PR appears safe to merge; the earlier findings are resolved and no new actionable issue was identified. The workflow changes associated with the first previous finding are absent, regression tests now cover the optional-field behavior and merged registry values, and the two redundant source comments were removed without changing behavior.
|
| Filename | Overview |
|---|---|
| .github/scripts/auto_update_price_and_context_window_file.py | Safely omits unavailable Vercel pricing and token-limit values, with the previously flagged redundant comments removed. |
| tests/test_litellm/test_auto_update_price_and_context_window.py | Adds focused offline tests for missing and null gateway fields and preservation of existing local values. |
Reviews (3): Last reviewed commit: "fix: skip missing Vercel AI Gateway pric..." | Re-trigger Greptile
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
6282f5e to
83ac0d7
Compare
The Vercel AI Gateway model list does not publish pricing or token limits for every model. Embedding models omit the output price, and video models omit pricing entirely, so the importer raised KeyError: 'output' and the price refresh never completed. Treat pricing, input, output, context_window and max_tokens as optional and omit them from the transformed record when they are missing or null. The model id stays required. Because the sync step merges with dict.update, omitting a field now preserves whatever value the local price file already holds instead of overwriting it. On the live gateway list, 117 of 373 models are missing at least one of these fields.
83ac0d7 to
a472740
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
#48473 removed the weekly cost map sync workflow and the script this PR patches, so this fix no longer applies. Reopen if something is missing |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: nobody can refresh Vercel AI Gateway prices, so the shipped price list stays stale
KeyError: 'output'on the first embedding modelAfter: the refresh completes and writes prices for every model the gateway lists
Relevant issues
No issue filed. The evidence is in this repo's own Actions history: the scheduled
auto_update_price_and_context_windowworkflow is failing on this line.Linear ticket
Pre-Submission checklist
a4727400)Screenshots / Proof of Fix
Shared setup:
Both runs call
transform_vercel_ai_gateway_dataon that live payload.Before (02522a5)
CRASH: KeyError: 'output'— 117 of 373 live models are missing a field the code requiredAfter (a472740)
OK: transformed 373 modelsuv run --frozen pytest tests/test_litellm/test_auto_update_price_and_context_window.py tests/test_litellm/test_model_prices_schema.py -q->23 passedType
🐛 Bug Fix
Caveats (if any)
Low
context_window: 0keepmax_tokens: 0