feat(llm): add moonshot/kimi-k3 to model prices and context window map - #37552
Conversation
Greptile SummaryAdds Moonshot Kimi K3 pricing, context-window, and capability metadata to the canonical model map and its backup copy.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds the canonical Moonshot Kimi K3 pricing and model-capability entry using existing schema fields. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the canonical Kimi K3 metadata entry in the backup price map. |
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/lit..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Pricing per https://platform.kimi.ai/docs/pricing/chat-k3: - $3.00/M input (cache miss), $0.30/M cache read, $15.00/M output - 1,048,576 context window; max_completion_tokens settable up to 1,048,576 - Supports reasoning (reasoning_effort low/high/max), tool calling, structured output, vision and video input Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0163ce8 to
42cffe9
Compare
|
bugbot run |
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 42cffe9. Configure here.
models.litellm.ai and released litellm versions read model_prices_and_context_window.json from main at runtime, so Kimi K3 is missing from the hosted catalog even though the entry is in review for litellm_internal_staging in BerriAI#37552. This copies that entry onto main so the catalog picks it up on its next fetch. Data only: the cost map and its backup copy, no code changes. Pricing matches Moonshot's published rates ($3/M input, $0.30/M cache read, $15/M output, 1,048,576-token context). The fireworks_ai and Azure Foundry kimi-k3 variants are separate work in BerriAI#37512 and BerriAI#37658; neither touches the native moonshot/kimi-k3 key.
|
bugbot run |
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 277ed88. Configure here.
TLDR
Problem this solves:
moonshot/kimi-k3is missing from the model price mapHow it solves it:
moonshot/kimi-k3tomodel_prices_and_context_window.json(+ backup copy)User Flow
Before: a developer routing Kimi K3 through the gateway gets no pricing metadata, so spend tracking reads zero
"model": "moonshot/kimi-k3"After: the same request is priced correctly
"model": "moonshot/kimi-k3"Relevant issues
No issue was filed for the moonshot entry: kimi-k3 was noticed absent while configuring it as a gateway model. Related: #35344 asks for the Fireworks
kimi-k3entry, which is a separate changeLinear ticket
Resolves LIT-5873
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<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 more (for this data-only change, the same checks CI runs pass locally:jq empty,ci_cd/check_files_match.py,ci_cd/generate_model_prices_schema.py --check)@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
Full before/after QA, live against Moonshot: the before leg at the merge base (9821b45) prices a real completion at $0, the after leg at the PR tip (277ed88) prices the same completion from the new entry. Each leg ran on its own proxy booted from that commit with
LITELLM_LOCAL_MODEL_COST_MAP=True, its own Postgres, and a virtual keyPricing source: https://platform.kimi.ai/docs/pricing/chat-k3 ($3.00/M cache-miss input, $0.30/M cache-hit input, $15.00/M output, 1,048,576-token context). Capabilities per https://platform.kimi.ai/docs/guide/kimi-k3-quickstart.md:
max_completion_tokenssettable up to 1,048,576, native vision and video file input, always-on reasoning withreasoning_effort(low/high/max)Before, at the merge base (9821b45)
HTTP_STATUS=200, a real completion (idchatcmpl-6a88dda82e203c136a972943, 90 prompt + 10 completion tokens)HTTP_STATUS=200, one row (relevant fields):GET /v1/model/infoon the same proxy:HTTP_STATUS=200withmodel_infofor kimi-k3 all null (relevant fields):Every other cost field and
supports_*flag also came back nullAfter, at the PR tip (277ed88)
HTTP_STATUS=200, a real completion (idchatcmpl-6a88db3f50c94b5b8f5a3029, 90 prompt + 10 completion tokens), and the response now carries cost headersHTTP_STATUS=200, one row (relevant fields):90 * $3.00/M input + 10 * $15.00/M output = $0.00042, matching the logged spend exactly, and the row's
model_map_informationnamesmoonshot/kimi-k3withinput_cost_per_token: 3e-06GET /v1/model/infoon the same proxy:HTTP_STATUS=200,model_infofor kimi-k3 (relevant fields verbatim):Observations from the run, in scope for a reviewer but not caused by this PR:
supports_prompt_cachingstays null; matches the JSON entry, left aloneperplexity/perplexity/*model ids — Agent API models 400,sonarsilently answers off the chat endpoint #37716), untouched hereType
🆕 New Feature
Caveats (if any)
supports_web_searchdeliberately omitted: K3 docs sayweb_searchis being updated (matches kimi-k2.5/k2.6)Final Attestation
Note
Low Risk
Data-only price-map entry; no runtime, auth, or routing logic changes. Wrong numbers would only affect cost reporting.
Overview
Adds
moonshot/kimi-k3to the model price map (and backup) so LiteLLM can resolve costs and context limits instead of treating the model as unmapped ($0 spend).Pricing is $3.00/M input, $0.30/M cache read, $15.00/M output, with a 1,048,576-token window. Capability flags match other recent Kimi chat models (tools, reasoning, vision/video, response schema).
Reviewed by Cursor Bugbot for commit 277ed88. Bugbot is set up for automated code reviews on this repo. Configure here.