Skip to content

feat(models): add kimi-k2.5 to model cost map and backup - #43879

Closed
syedsp324 wants to merge 2 commits into
BerriAI:mainfrom
syedsp324:fix/add-kimi-k2.5
Closed

syedsp324 wants to merge 2 commits into
BerriAI:mainfrom
syedsp324:fix/add-kimi-k2.5

Conversation

@syedsp324

Copy link
Copy Markdown

TLDR

Problem this solves:

  • kimi-k2.5 is missing from the global cost map.
  • Offline proxy users lack fallback pricing for this model.
  • Dashboards track $0 spend for kimi-k2.5 usage.

How it solves it:

  • Maps kimi-k2.5 in model_prices_and_context_window.json.
  • Syncs the exact specs to the bundled fallback backup file.

User Flow

Before: a developer calling kimi-k2.5 sees zero token cost

  1. They send POST /v1/chat/completions with "model": "kimi-k2.5".
  2. The proxy completes the request but skips cost calculation.
  3. They open /ui/?page=logs and see the request logged at $0.

After: the proxy calculates and logs exact token costs

  1. The developer sends POST /v1/chat/completions with "model": "kimi-k2.5".
  2. The proxy calculates the exact cost using the new Moonshot pricing.
  3. They open /ui/?page=logs and see the request at non-zero spend.

Relevant issues

Closes #43840

Pre-Submission checklist

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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<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
  • 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)

Type

🆕 New Feature

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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Adds a new model to the pricing and configuration tables.

This PR should not merge until the bare and provider-qualified records describe the same Moonshot model consistently.

Findings

  1. P1 Output limit is too low ▶
  2. P1 Model metadata is incomplete ▶

Summary

Adds a bare kimi-k2.5 Moonshot price record to the primary and bundled backup maps.

  • The new record’s limits and metadata differ from the existing provider-qualified record for the same model.
  • Other edits reformat existing JSON without changing its values.

Reviews (1) · Last reviewed commit: "feat(models): add kimi-k2.5 to model cos..."

Comment thread model_prices_and_context_window.json Outdated
Comment on lines +17181 to +17183
"max_tokens": 8192,
"max_input_tokens": 262144,
"max_output_tokens": 8192,

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.

P1 Output limit is too low The existing moonshot/kimi-k2.5 record allows 262,144 output tokens, but this new record sets the limit to 8,192. For a request using the bare model name, get_max_tokens returns 8,192, and budget estimation caps its output reservation there even if the request allows more. That can understate the request’s potential spend.

Suggested change
"max_tokens": 8192,
"max_input_tokens": 262144,
"max_output_tokens": 8192,
"max_tokens": 262144,
"max_input_tokens": 262144,
"max_output_tokens": 262144,

Knowledge Base Used:

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!

Comment on lines +17180 to +17188
"kimi-k2.5": {
"max_tokens": 8192,
"max_input_tokens": 262144,
"max_output_tokens": 8192,
"input_cost_per_token": 0.0000006,
"output_cost_per_token": 0.000003,
"litellm_provider": "moonshot",
"mode": "chat"
},

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.

P1 Model metadata is incomplete The existing moonshot/kimi-k2.5 record includes a cached-input rate and flags for reasoning, vision, and tool use, but this bare-name record omits them. A caller looking up kimi-k2.5 receives the incomplete record, so capability checks can treat supported features as unavailable and cached-input pricing can differ depending on which model name is used.

Knowledge Base Used: Provider adapters and capabilities

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing syedsp324:fix/add-kimi-k2.5 (20c9834) with main (7204942)

Open in CodSpeed

@syedsp324
syedsp324 requested a review from klu-berri as a code owner October 18, 2026 10:33
@syedsp324

Copy link
Copy Markdown
Author

@greptileai

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Registry disposition is recorded in #48188. The bare model entry lacks verified historical prices and a general routing definition

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.

Add "kimi-k2.5" in "model_prices_and_context_window.json"

2 participants