From 1fcadd6c05a3ea1ea4cf5028b1bf88cb5c7416dc Mon Sep 17 00:00:00 2001 From: Kowyo Date: Wed, 22 Oct 2025 07:39:08 +0800 Subject: [PATCH] feat(ollama): set 'think' to False when reasoning effort is not high/medium/low (#15763) --- litellm/llms/ollama/chat/transformation.py | 2 +- litellm/llms/ollama/completion/transformation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/ollama/chat/transformation.py b/litellm/llms/ollama/chat/transformation.py index b740eb122f..9c8700daf8 100644 --- a/litellm/llms/ollama/chat/transformation.py +++ b/litellm/llms/ollama/chat/transformation.py @@ -188,7 +188,7 @@ class OllamaChatConfig(BaseConfig): if model.startswith("gpt-oss"): optional_params["think"] = value else: - optional_params["think"] = True + optional_params["think"] = value in {"low", "medium", "high"} ### FUNCTION CALLING LOGIC ### if param == "tools": ## CHECK IF MODEL SUPPORTS TOOL CALLING ## diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.py index b476e5c8a6..b02662233b 100644 --- a/litellm/llms/ollama/completion/transformation.py +++ b/litellm/llms/ollama/completion/transformation.py @@ -183,7 +183,7 @@ class OllamaConfig(BaseConfig): if model.startswith("gpt-oss"): optional_params["think"] = value else: - optional_params["think"] = True + optional_params["think"] = value in {"low", "medium", "high"} elif param == "response_format" and isinstance(value, dict): if value["type"] == "json_object": optional_params["format"] = "json"