Repository navigation
fix(model-prices): add missing xAI and Moonshot models and fix an OpenRouter context limit - #44227
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…efresh OpenRouter prices Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
|
| "xai/grok-imagine-video-1.5-lite": { | ||
| "input_cost_per_image": 0.01, | ||
| "litellm_provider": "xai", | ||
| "mode": "video_generation", |
There was a problem hiding this comment.
xAI video remains uncallable The new entry makes cost and metadata lookups succeed, but a video-generation request for
xai/grok-imagine-video-1.5-lite still fails. LiteLLM resolves the provider to xai, finds no xAI video config, and raises video generation is not supported for xai. The model cannot complete the routing flow described in the PR.
| "cache_read_input_token_cost": 2.0625e-08, | ||
| "input_cost_per_token": 8.25e-08, |
There was a problem hiding this comment.
Off-peak window has no effect The new base input, output, and cache-read rates for
openrouter/tencent/hy3 match its unchanged off-peak rates. The same is true for hy4-preview. LiteLLM switches rates during the configured 16:00–00:00 UTC window, but that switch now changes nothing. Reconcile or remove the windowed rates so the registry does not retain a misleading discount configuration.
| "cache_read_input_token_cost": 2.7e-07, | ||
| "input_cost_per_token": 2.7e-06, |
There was a problem hiding this comment.
Corrected prices lack regression checks The PR changes model-specific rates, including
kimi-k3 input, output, and cache-read prices, without adding assertions for those values. The existing schema tests check that entries are valid, not that the corrected prices remain intact. A later registry refresh could silently reintroduce the billing drift; focused value assertions would catch it.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…y_audit_1790969119 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # litellm/model_prices_and_context_window_backup.json # model_prices_and_context_window.json
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a proxy admin routing to a newly released model sees it logged as unmapped, or with a wrong context limit
moonshot/kimi-k2.7-code-highspeedorxai/grok-imagine-video-1.5-liteto their configopenrouter/z-ai/glm-5.3-flashreports a 1,310,720 token input limit while OpenRouter lists 1,048,576After: the same models resolve with the provider's published prices and limits
openrouter/z-ai/glm-5.3-flashreports a 1,048,576 token input limitChanges by provider
Moonshot
Added
moonshot/kimi-k2.7-code-highspeed: $1.90 per 1M cache-miss input, $0.38 per 1M cached input, $8.00 per 1M output, 262,144 token context, reasoning, tool calling, image and video input. Sources: https://platform.kimi.ai/docs/pricing/chat-k27-code and https://platform.kimi.ai/docs/guide/kimi-k2-7-code-quickstartxAI
Added
xai/grok-imagine-video-1.5-liteasvideo_generation: $0.01 per input image, $0.02 per second at 480p, $0.03 at 720p, $0.14 at 1080p, text and image in, video out. Sources: https://docs.x.ai/developers/pricing and https://docs.x.ai/docs/models/grok-imagine-video-1.5-liteOpenRouter
#44287 landed on main during this run and already synced
kimi-k3,glm-5.3,inkling,qwen3.5-35b-a3bandling-3.1-flashto the values this PR originally carried, so after merging main the only OpenRouter change left isopenrouter/z-ai/glm-5.3-flashmax_input_tokens 1,310,720 -> 1,048,576, matchingcontext_lengthin https://openrouter.ai/api/v1/modelsA fresh read of the same API agrees with main for
deepseek-v4.1-flash,nemotron-3.5-lightning,hy3,hy4-previewandglm-5.2, so my earlier values for those were dropped. Formimo-v2.6-flashandmimo-v2.6-prothe API reportscontext_length1,050,000 buttop_provider.context_length1,048,576, so main's 1,048,576 was keptChecked and left unchanged
Gemini Antigravity preview models and AQA are listed by the Gemini models API, but https://ai.google.dev/gemini-api/docs/pricing publishes no per-token price for them, so they were not added. Groq
allam-2-7bis listed by the Groq models API with a 4,096 context, but Groq publishes no per-token price for it. Fireworksaccounts/fireworks/models/qwen3p8-2p4t-a95bis confirmed by https://api.fireworks.ai/inference/v1/models (262,144 context, tools, no image input), but no price was found on https://fireworks.ai/models/fireworks/qwen3p8-2p4t-a95b via curl or https://r.jina.ai/, and the browser fallback could not run here.openrouter/deepseek/deepseek-v4-flash-0731looked drifted on a first pass, but a second API read did not confirm it, so it was left alone. Anthropic (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 4.5), Together, DeepSeek, Bedrock and Voyage entries were checked against their official pricing pages and already matched. Mistral context and capability differences seen in its models API were not changed without a matching docs pageOpen registry PRs were reviewed for absorption. #43879 and #43753 add bare
kimi-k2.5anddeepseek-v3aliases for models that main already maps asmoonshot/kimi-k2.5anddeepseek/deepseek-v3, so they were not absorbed. #43859 (Tinker models) was not absorbed because its prices were not field-verified against Tinker's docs in this run. #42726, #44138, #44163, #44167 and #44168 change code or behavior and only touch the JSON incidentally, so they were left alonePre-Submission checklist
tests/unit/test_model_prices_schema.pyandtests/unit/test_model_cost_aliases.py(74 passed), pluspython3 ci_cd/check_files_match.pyScreenshots / Proof of Fix
Each side runs
litellm.get_model_infoon the model withLITELLM_LOCAL_MODEL_COST_MAP=True, which is the same lookup the proxy uses for spend trackingBefore (main at 9e31afb)
get_model_info("xai/grok-imagine-video-1.5-lite")->ModelNotMappedError: This model isn't mapped yetget_model_info("moonshot/kimi-k2.7-code-highspeed")->ModelNotMappedError: This model isn't mapped yetget_model_info("openrouter/z-ai/glm-5.3-flash")->max_input_tokens 1310720After (29d5a9b)
get_model_info("xai/grok-imagine-video-1.5-lite")->output_cost_per_second 0.02get_model_info("moonshot/kimi-k2.7-code-highspeed")->input 1.9e-06, output 8e-06, cache_read 3.8e-07, max_input_tokens 262144get_model_info("openrouter/z-ai/glm-5.3-flash")->max_input_tokens 1048576Type
🐛 Bug Fix
Caveats (if any)
Low
ci_cd/cost_map_pins.jsonis absent on main, so no pins were checkedosv-scanflags GHSA-vfj7-8cjw-p6xm inbracesfromui/litellm-dashboard/package-lock.json, which this PR does not touch and which has no fixed release yetrust-testfails atnamed::result_contracts_preserve_public_field_names, which also fails on main in https://github.com/BerriAI/litellm/actions/runs/37069683181Final Attestation
Link to Devin session: https://app.devin.ai/sessions/804e9537d3994f949f1d87d27f3976dc
Open in Devin Desktop: https://app.devin.ai/desktop/session/804e9537d3994f949f1d87d27f3976dc?variant=devin