Skip to content

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]

fix: code quality on ollama chat

Ishaan Jaff405b0c1ed793
diff --git a/litellm/llms/ollama_chat.py b/litellm/llms/ollama_chat.py
index 64fcf6dd3e8..22438eca082 100644
--- a/litellm/llms/ollama_chat.py
+++ b/litellm/llms/ollama_chat.py
@@ -1,4 +1,3 @@
-import inspect
import json
import time
import uuid
@@ -208,9 +207,9 @@ class OllamaChatConfig(OpenAIGPTConfig):
litellm.add_function_to_prompt = (
True # so that main.py adds the function call to the prompt
)
- optional_params[
- "functions_unsupported_model"
- ] = non_default_params.get("functions")
+ optional_params["functions_unsupported_model"] = (
+ non_default_params.get("functions")
+ )
non_default_params.pop("tool_choice", None) # causes ollama requests to hang
non_default_params.pop("functions", None) # causes ollama requests to hang
return optional_params