Repository navigation
feat: add Kimi K3 pricing for openrouter and novita - #36652
zainulabidin776 wants to merge 1 commit into
Conversation
Kimi K3 had no entry in either model cost map, so calls routed through openrouter/moonshotai/kimi-k3 or novita/moonshotai/kimi-k3 logged $0 spend and silently under-counted budgets, spend alerts and per-key limits Prices come from the provider APIs directly, recorded in each entry's source field. Novita quotes price_per_m in units of 1e-10 USD per token, confirmed against the three existing novita/moonshotai entries already in the map. Both providers independently report $3.00 per million input, $15.00 per million output and $0.30 per million cached input The openrouter entry intentionally omits max_output_tokens because OpenRouter reports top_provider.max_completion_tokens as null for this model. A test pins that absence so it does not get backfilled with the context length by assumption Refs BerriAI#33921
Greptile SummaryThe PR registers Kimi K3 pricing and capabilities for OpenRouter and Novita so calls receive non-zero cost accounting.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking gap in regression coverage for cached-input pricing. The pricing entries resolve through the existing generic calculator and standard token costs are tested, but the tests never provide cached-token usage to prove that the new cache-read rate is applied. Files Needing Attention: tests/test_litellm/test_kimi_k3_pricing.py
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds canonical OpenRouter and Novita Kimi K3 pricing, context limits, and capability metadata with no identified functional defect. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the new canonical pricing entries exactly for local and fallback loading. |
| tests/test_litellm/test_kimi_k3_pricing.py | Verifies map parity and ordinary token costs but does not exercise the newly added cached-token calculation path. |
Reviews (1): Last reviewed commit: "feat: add Kimi K3 pricing for openrouter..." | Re-trigger Greptile
| ) | ||
|
|
||
| assert prompt_usd == pytest.approx(3.0) | ||
| assert completion_usd == pytest.approx(15.0) |
There was a problem hiding this comment.
Cached pricing path remains untested
The new cost assertion supplies only aggregate token counts, so it never exercises cache_read_input_token_cost. A regression that ignores the added cached-input rate would still pass this suite and silently overcharge cached requests.
Knowledge Base Used: Cost Tracking and Budget Enforcement
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
Kimi K3 had no entry in either model cost map, so calls routed through openrouter/moonshotai/kimi-k3 or novita/moonshotai/kimi-k3 logged $0 spend and silently under-counted budgets, spend alerts and per-key limits
Prices come from the provider APIs directly, recorded in each entry's source field. Novita quotes price_per_m in units of 1e-10 USD per token, confirmed against the three existing novita/moonshotai entries already in the map. Both providers independently report $3.00 per million input, $15.00 per million output and $0.30 per million cached input
The openrouter entry intentionally omits max_output_tokens because OpenRouter reports top_provider.max_completion_tokens as null for this model. A test pins that absence so it does not get backfilled with the context length by assumption
Refs #33921
TLDR
Problem this solves:
How it solves it:
User Flow
Relevant issues
Linear ticket
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
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Caveats (if any)
QA runbook
Final Attestation