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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(ollama/chat): 'think' param handling
Kowyo4f33bc4e4690
diff --git a/litellm/llms/ollama/chat/transformation.py b/litellm/llms/ollama/chat/transformation.pyindex 3b755e79330..dfd53a5e2ba 100644--- a/litellm/llms/ollama/chat/transformation.py+++ b/litellm/llms/ollama/chat/transformation.py@@ -281,6 +281,7 @@ class OllamaChatConfig(BaseConfig):stream = optional_params.pop("stream", False)format = optional_params.pop("format", None)keep_alive = optional_params.pop("keep_alive", None)+ think = optional_params.pop("think", None)function_name = optional_params.pop("function_name", None)litellm_params["function_name"] = function_nametools = optional_params.pop("tools", None)@@ -344,6 +345,8 @@ class OllamaChatConfig(BaseConfig):data["tools"] = toolsif keep_alive is not None:data["keep_alive"] = keep_alive+ if think is not None:+ data["think"] = thinkreturn datadiff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.pyindex 981a987ec91..662affcb278 100644--- a/litellm/llms/ollama/completion/transformation.py+++ b/litellm/llms/ollama/completion/transformation.py@@ -412,6 +412,7 @@ class OllamaConfig(BaseConfig):stream = optional_params.pop("stream", False)format = optional_params.pop("format", None)images = optional_params.pop("images", None)+ think = optional_params.pop("think", None)data = {"model": model,"prompt": ollama_prompt,@@ -425,6 +426,8 @@ class OllamaConfig(BaseConfig):data["images"] = [_convert_image(convert_to_ollama_image(image)) for image in images]+ if think is not None:+ data["think"] = thinkreturn data