Skip to content

fix: add moonshot/kimi-k3 to the cost map on main - #37753

Merged
mateo-berri merged 1 commit into
mainfrom
litellm_hotfix_kimi_k3_cost_map
Aug 21, 2026
Merged

fix: add moonshot/kimi-k3 to the cost map on main#37753
mateo-berri merged 1 commit into
mainfrom
litellm_hotfix_kimi_k3_cost_map

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

User Flow

Before: a developer looking up Kimi K3 on the hosted model catalog finds nothing

  1. They open https://models.litellm.ai and search "kimi-k3"
  2. The only match is the Azure Foundry variant azure_ai/FW-Kimi-K3; the native moonshot/kimi-k3 is absent
  3. They open https://models.litellm.ai/model/moonshot/kimi-k3 and get no pricing or context data

After: the same search shows the native Moonshot entry with real pricing

  1. They open https://models.litellm.ai and search "kimi-k3"
  2. moonshot/kimi-k3 appears with $3.00/M input, $0.30/M cache read, $15.00/M output, 1,048,576-token context
  3. The model page shows reasoning, vision, video input, and tool calling support

Relevant issues

Data-only hotfix that copies the cost map entry from #37552, which is in review for litellm_internal_staging. models.litellm.ai and released litellm versions fetch model_prices_and_context_window.json from the main branch at runtime, so the hosted map won't show Kimi K3 until the entry reaches main. Same pattern as #30076. Pricing matches Moonshot's own published rates (platform.kimi.ai): $3.00/M cache-miss input, $0.30/M cache hit, $15.00/M output, over a 1,048,576-token context. Those are the direct-API rates the moonshot/ prefix bills against, so resellers like OpenRouter quote different numbers and aren't the reference here. The fireworks_ai/* and azure_ai/* kimi-k3 serverless variants are separate work that landed on litellm_internal_staging via #37658, which superseded #37512; this PR only adds the native moonshot/kimi-k3 key, which that changeset doesn't touch

Linear ticket

Resolves LIT-5226

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests (n/a: data-only cherry-pick of the feat(llm): add moonshot/kimi-k3 to model prices and context window map #37552 entry)
  • The handful of test files covering my change pass locally, e.g. 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)
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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

models.litellm.ai renders whatever https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json serves, so the proof below curls the same file the site fetches, at the merge base and at the PR tip

Before (007bd43)

  1. curl -s https://raw.githubusercontent.com/BerriAI/litellm/007bd43cfb6eeeabe94d6aa77bd05dd3aa6aa1bf/model_prices_and_context_window.json | jq '."moonshot/kimi-k3"'
null

After (ef1cde4)

  1. curl -s https://raw.githubusercontent.com/BerriAI/litellm/ef1cde433ea7c6dd1515de06c6d0d748fae4a197/model_prices_and_context_window.json | jq '."moonshot/kimi-k3" | {input_cost_per_token, cache_read_input_token_cost, output_cost_per_token, max_input_tokens}'
{
  "input_cost_per_token": 0.000003,
  "cache_read_input_token_cost": 3E-7,
  "output_cost_per_token": 0.000015,
  "max_input_tokens": 1048576
}
  1. Once this merges, https://models.litellm.ai shows the same JSON on its next fetch of the main map

Type

🐛 Bug Fix

Caveats (if any)

  • Entry is byte-identical to feat(llm): add moonshot/kimi-k3 to model prices and context window map #37552's, so pricing changes there need a follow-up here
  • Merging current litellm_internal_staging into this branch auto-merges the cost map with no conflict, so the staging promote is unaffected
  • max_output_tokens mirrors the context window like the other moonshot/kimi-* entries, since Moonshot publishes no separate output cap

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

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 #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 #37512 and #37658; neither
touches the native moonshot/kimi-k3 key.
@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds the native moonshot/kimi-k3 pricing, token limits, and capability metadata to the canonical model catalog and its packaged backup.

  • Records input, cache-read, and output pricing.
  • Advertises the model’s context and output limits.
  • Marks supported reasoning, multimodal, function-calling, tool-choice, and response-schema capabilities.
  • Keeps the canonical and backup maps synchronized.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, synchronization, or validation issue was identified.

The two cost maps contain identical, valid entries using established fields, and the added pricing matches the documented rates while existing validation and fallback contracts remain intact.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds a schema-compatible Kimi K3 catalog entry with corroborated pricing and no identified actionable defect.
litellm/model_prices_and_context_window_backup.json Mirrors the canonical Kimi K3 entry exactly so packaged fallback behavior remains synchronized.

Reviews (1): Last reviewed commit: "fix: add moonshot/kimi-k3 to the cost ma..." | Re-trigger Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 ef1cde4. Configure here.

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri
mateo-berri enabled auto-merge August 21, 2026 01:47

@tin-berri tin-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small, low-risk, data-only cherry-pick — adds the moonshot/kimi-k3 cost-map entry to main (mirrors the entry already reviewed in #37552 for staging), no code changes. The one failing check, misc / Run tests (test_handle_completed_vertex_batch_computes_cost_usage_and_models, cost off by exactly 2x), is pre-existing and unrelated — confirmed the identical failure on main's current head as of 2026-08-19, nothing to do with this diff. Worth a separate look at some point (that 2x looks like a real bug, not flakiness) but not a blocker here. Approved.

@mateo-berri
mateo-berri merged commit 24555ac into main Aug 21, 2026
79 of 80 checks passed
@mateo-berri
mateo-berri deleted the litellm_hotfix_kimi_k3_cost_map branch August 21, 2026 01:49
@codspeed-hq

codspeed-hq Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_hotfix_kimi_k3_cost_map (ef1cde4) with main (007bd43)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (ef1cde4) during the generation of this report, so 007bd43 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants