Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Fix MoonshotChatConfig to address limitations of kimi-thinking-preview model by excluding additional parameters (#12772)

Cole McIntoshbd134fa2db77
diff --git a/litellm/llms/moonshot/chat/transformation.py b/litellm/llms/moonshot/chat/transformation.py
index 1b67e315d74..0e78e58c7f8 100644
--- a/litellm/llms/moonshot/chat/transformation.py
+++ b/litellm/llms/moonshot/chat/transformation.py
@@ -83,8 +83,14 @@ class MoonshotChatConfig(OpenAIGPTConfig):
Moonshot AI limitations:
- functions parameter is not supported (use tools instead)
- tool_choice doesn't support "required" value
+ - kimi-thinking-preview doesn't support tool calls at all
"""
excluded_params: List[str] = ["functions"]
+
+ # kimi-thinking-preview has additional limitations
+ if "kimi-thinking-preview" in model:
+ excluded_params.extend(["tools", "tool_choice"])
+
base_openai_params = super().get_supported_openai_params(model=model)
final_params: List[str] = []
for param in base_openai_params: