mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #23907] bug: native function_calling on custom model variant not forwarded to Ollama (v0.8.12) #35633
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rromenskyi on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23907
Summary
On Open WebUI v0.8.12 (latest at time of writing,
:main/:lateston GHCR), a custom model variant created inWorkspace → Modelswithfunction_calling: nativepersisted in itsparamscauses the model to receive no tools despite the server having a registered MCP / OpenAPI tool server. The frontend UI appears to honour the setting (the integrations menu shows the registered tools) but the request that ultimately reaches Ollama carries notools: [...]array, so the model never emitstool_calls.A direct
POST /api/chatto the same Ollama instance with the exact tools array returns correcttool_calls, so the model and the tool descriptions are fine — the break is in Open WebUI's middleware path for custom variants.Reproducer
get_current_weather_in_city(city: str)is fine.Admin → Settings → External Tools → Verify → Save. Confirm the tool shows up in the catalog.Workspace → Models → Createa variant ofqwen2.5:7bcalledqwen2.5:7b+tools. In the edit form:qwen2.5:7b+tools, ask "What is the current weather in Bountiful, Utah?".Expected
Model emits a
tool_calls: [{function: {name: "get_current_weather_in_city", arguments: {city: "Bountiful, Utah"}}}], Open WebUI invokes the tool, response shows the actual weather.Actual
Model replies with plaintext explaining how the user could run
curl wttr.in/...or similar. No tool is called. Backend logs show:So Open WebUI fetches the tool list from the registered MCP server (confirming registration works) but the model never generates a tool_call.
Evidence this is an OWUI bug, not Ollama/model
Same Ollama instance, same model, same tool definitions — sent directly:
Returns:
So qwen2.5:7b + Ollama + the exact tool spec work perfectly when the
toolsarray reaches them. OWUI is dropping the array somewhere.Code path
main.py:1728-1735setsmetadata.params.function_calling = 'native'when eitherform_data.params.function_calling == 'native'ORmodel_info_params.function_calling == 'native'. The OR branch should pick up the custom-variant setting.utils/middleware.py:2678then readsmetadata.params.function_calling == 'native'and setsform_data['tools'] = [...]fromtools_dict.tools_dictis non-empty (ListToolsRequest confirms MCP server was consulted), andfunction_calling: nativeis saved in the variant. So either:metadata.params.function_callingis not reaching middleware.py:2678 as'native', ortools_dictis empty at that point despite the earlier ListToolsRequest.I haven't fully traced which.
Workarounds
POST /api/chat/completionswith explicittoolsinform_data.params(per-request Native override from Chat Controls) sometimes works, sometimes doesn't — seems chat-session-state dependent.mcphostworks without issue — same model, same tools, same prompts.Version details
ghcr.io/open-webui/open-webui:main@sha256:a10c18cd35fa9bcaa7650598c1699609db1292ce4fc89499b5eaf93ac435f380(v0.8.12, 2026-03-27)qwen2.5:7b(also triedqwen2.5:14b,qwen2.5-coder:7b— same behaviour)mcp-weather-simple,tools/listreturns 21 tool specsdevbranch is on 0.9.0 — if the fix is already there, happy to re-test once published on GHCR as:devor similar. Right now only:mainandgit-<sha>tags of 0.8.12 are available.Thanks!
@pr-validator-bot commented on GitHub (Apr 21, 2026):
⚠️ Missing Issue Title Prefix
@rromenskyi, your issue title is missing a prefix (e.g.,
bug:,feat:,docs:).Please update your issue title to include one of the following prefixes:
Example:
bug: Login fails when using special characters in password@tjbck commented on GitHub (Apr 21, 2026):
Unable to reproduce, did you enable the tool in the UI specifically?