From bd134fa2db777c617c881590bf3cec4ad8f189f9 Mon Sep 17 00:00:00 2001 From: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com> Date: Sat, 19 Jul 2025 16:10:57 -0600 Subject: [PATCH] Fix MoonshotChatConfig to address limitations of kimi-thinking-preview model by excluding additional parameters (#12772) --- litellm/llms/moonshot/chat/transformation.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: