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: handle non-str case
Krrish Dholakiad282e7eaac85
diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.pyindex 5689864017f..4a491c88963 100644--- a/litellm/llms/ollama/completion/transformation.py+++ b/litellm/llms/ollama/completion/transformation.py@@ -331,8 +331,10 @@ class OllamaConfig(BaseConfig):response_text = response_json.get("response", "")content = Nonereasoning_content = None- if response_text is not None:+ if response_text is not None and isinstance(response_text, str):reasoning_content, content = _parse_content_for_reasoning(response_text)+ else:+ content = response_text # type: ignoremodel_response.choices[0].message.content = content # type: ignoremodel_response.choices[0].message.reasoning_content = reasoning_content # type: ignoremodel_response.created = int(time.time())