Check for existing issues
What happened?
Summary
When using LiteLLM as a proxy between OpenWebUI and Ollama, function/tool calls are returned as raw JSON in the message content instead of being properly structured as tool calls. The same tools work correctly when routed through OpenRouter (e.g., with Claude models), and also work correctly when OpenWebUI connects directly to Ollama (bypassing LiteLLM).
Expected Behavior
When the model decides to use a tool, the response should contain a properly structured tool_calls array, and the client (OpenWebUI) should execute the tool call.
Actual Behavior
The model's tool call is returned as raw JSON in the message content field and displayed to the user instead of being executed:
{"name": "search_knowledge_files", "arguments": {"query": "fun facts about the Roman Empire"}}
Possible Causes
Speculating here!
-
Response parsing issue: Ollama returns a proper tool call structure, but LiteLLM fails to parse it correctly and passes the raw JSON through as message content.
-
Request formatting issue: LiteLLM sends the tool definitions to Ollama in a format that causes Ollama to respond with JSON in the content field rather than using its native tool call response structure.
Additional Information
Further diagnostic information (including proxy logs showing raw request/response data) is available on request.
This appears to be related to previously reported issues (#11104, #11262, #17807) that were either incompletely fixed or have regressed.
Steps to Reproduce
Configuration
Model string passed to LiteLLM: ollama/hf.co/unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF:Q4_K_M
Native function calling is enabled. Multiple permutations of function calling-related settings (eg. supports_function_calling) have been tested with no change in behavior. I have also tried with and without a manual tool_choice. The models are configured to stream in LiteLLM.
Instructions
- Configure LiteLLM proxy with an Ollama model that supports tool calling (e.g., Qwen3 Instruct)
- Configure OpenWebUI to use LiteLLM as the backend
- Enable native function calling in OpenWebUI
- Send a message that should trigger a built-in tool call (e.g., "Search for fun facts about the Roman Empire")
- Observe that instead of executing the tool, the raw JSON is displayed in the chat
Relevant log output
N/A
What part of LiteLLM is this about?
Proxy
What LiteLLM version are you on ?
v1.81.0
Twitter / LinkedIn details
No response
Check for existing issues
What happened?
Summary
When using LiteLLM as a proxy between OpenWebUI and Ollama, function/tool calls are returned as raw JSON in the message content instead of being properly structured as tool calls. The same tools work correctly when routed through OpenRouter (e.g., with Claude models), and also work correctly when OpenWebUI connects directly to Ollama (bypassing LiteLLM).
Expected Behavior
When the model decides to use a tool, the response should contain a properly structured
tool_callsarray, and the client (OpenWebUI) should execute the tool call.Actual Behavior
The model's tool call is returned as raw JSON in the message content field and displayed to the user instead of being executed:
Possible Causes
Speculating here!
Response parsing issue: Ollama returns a proper tool call structure, but LiteLLM fails to parse it correctly and passes the raw JSON through as message content.
Request formatting issue: LiteLLM sends the tool definitions to Ollama in a format that causes Ollama to respond with JSON in the content field rather than using its native tool call response structure.
Additional Information
Further diagnostic information (including proxy logs showing raw request/response data) is available on request.
This appears to be related to previously reported issues (#11104, #11262, #17807) that were either incompletely fixed or have regressed.
Steps to Reproduce
Configuration
Model string passed to LiteLLM:
ollama/hf.co/unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF:Q4_K_MNative function calling is enabled. Multiple permutations of function calling-related settings (eg.
supports_function_calling) have been tested with no change in behavior. I have also tried with and without a manualtool_choice. The models are configured to stream in LiteLLM.Instructions
Relevant log output
N/A
What part of LiteLLM is this about?
Proxy
What LiteLLM version are you on ?
v1.81.0
Twitter / LinkedIn details
No response