From e890f0c6577f1c3c73d03af20ef367476ee921e7 Mon Sep 17 00:00:00 2001 From: BiGy2018 <360055070@qq.com> Date: Tue, 22 Sep 2026 00:31:06 +0800 Subject: [PATCH] fix(deepseek): retain mutable request mapping contract --- litellm/llms/deepseek/chat/transformation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/deepseek/chat/transformation.py b/litellm/llms/deepseek/chat/transformation.py index ff71348cffe..e9edac58ec0 100644 --- a/litellm/llms/deepseek/chat/transformation.py +++ b/litellm/llms/deepseek/chat/transformation.py @@ -61,11 +61,11 @@ class DeepSeekChatConfig(OpenAIGPTConfig): if ( model.removeprefix("deepseek/").startswith(("deepseek-v4-", "deepseek-flash")) - and optional_params.get("thinking") == {"type": "enabled"} + and not (isinstance(thinking_value, dict) and thinking_value.get("type") == "disabled") and isinstance(reasoning_effort, str) and reasoning_effort != "none" ): - return {**optional_params, "reasoning_effort": reasoning_effort} + return {**optional_params, "reasoning_effort": reasoning_effort} # mutable-ok: adapters mutate this dict return optional_params