Skip to content

fix(fireworks_ai): register Kimi K3 so tool_choice is supported - #35385

Closed
Sdnsoumy wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
Sdnsoumy:litellm_fireworks_kimi_k3_tool_choice
Closed

Sdnsoumy wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
Sdnsoumy:litellm_fireworks_kimi_k3_tool_choice

Conversation

@Sdnsoumy

Copy link
Copy Markdown

Relevant issues

Fixes #35382

Linear ticket

Pre-Submission checklist

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

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • 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)

Screenshots / Proof of Fix

Before this change, fireworks_ai/accounts/fireworks/models/kimi-k3 had no entry in the model registry, so LiteLLM's capability validation treated tool_choice as unsupported and raised UnsupportedParamsError before the request ever reached Fireworks.

After this change the model is registered with supports_tool_choice: true and supports_function_calling: true, so requests carrying tool_choice pass validation and are forwarded to Fireworks.

Type

🐛 Bug Fix

Changes

  • Added fireworks_ai/accounts/fireworks/models/kimi-k3 and the short-form alias fireworks_ai/kimi-k3 to model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json, including pricing, context window, and capability flags (supports_function_calling, supports_tool_choice, supports_reasoning, supports_response_schema, supports_vision).
  • Added regression coverage in tests/test_litellm/test_utils.py asserting the Kimi K3 full-path and short-form entries exist in both registry files with the expected pricing, context window, and capability values.

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

Copilot AI review requested due to automatic review settings July 31, 2026 18:06

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CLAassistant

CLAassistant commented Jul 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Registers the Fireworks AI Kimi K3 model so LiteLLM recognizes its capabilities and pricing.

  • Adds full-path and short-form Kimi K3 entries to the primary and backup model registries.
  • Records context limits, token pricing, and supported capabilities, including function calling and tool choice.
  • Extends registry tests to validate both entries and ensure the two registry files remain consistent.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains, and the previously reported OpenAPI schema-test issue is absent from the current code.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds internally consistent full-path and short-form Kimi K3 registry entries with pricing, token limits, and capability metadata.
litellm/model_prices_and_context_window_backup.json Mirrors the Kimi K3 metadata in the packaged backup registry.
tests/test_litellm/test_utils.py Adds CI-covered assertions for Kimi K3 metadata and equality between its full-path and short-form entries in both registries.

Reviews (2): Last reviewed commit: "feat(fireworks_ai): add Kimi K3 model re..." | Re-trigger Greptile

assert "requestBody" in post_spec
body_schema = post_spec["requestBody"]["content"]["application/json"]["schema"]

assert body_schema.get("type") == "object"

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 Component reference breaks schema test

When FastAPI represents MCPRestToolCallRequest as a component $ref, this assertion treats the reference as an inline object, causing the new OpenAPI regression test to fail before validating the request fields.

Rule Used: What: Flag any modifications to existing tests and... (source)

@Sdnsoumy
Sdnsoumy force-pushed the litellm_fireworks_kimi_k3_tool_choice branch from 266e5e5 to af1b685 Compare July 31, 2026 18:11
@Sdnsoumy

Copy link
Copy Markdown
Author

The branch was rebased onto the current litellm_internal_staging to drop an unrelated MCP commit that was accidentally included. The PR is now isolated to the Fireworks Kimi K3 registry entries and their regression test (3 files). The earlier review flagged tests/test_litellm/proxy/test_openapi_schema_validation.py, which is no longer part of this PR.

@greptileai please re-review the latest commit.

@codecov

codecov Bot commented Jul 31, 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 Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing Sdnsoumy:litellm_fireworks_kimi_k3_tool_choice (ecda6ad) with litellm_internal_staging (31a86da)

Open in CodSpeed

@Sdnsoumy
Sdnsoumy force-pushed the litellm_fireworks_kimi_k3_tool_choice branch from af1b685 to 2bc0655 Compare August 4, 2026 05:41
Fixes missing supports_function_calling and supports_tool_choice metadata for fireworks_ai/accounts/fireworks/models/kimi-k3, which caused UnsupportedParamsError when using tool_choice with that model despite Fireworks supporting it upstream. Adds both the full-path entry and short-form alias, plus a regression test.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

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.

[Bug]: Fireworks Kimi K3 rejects tool_choice despite upstream support

3 participants