From 780ce4271159fc7fafb6e6760026ee3cf4927f34 Mon Sep 17 00:00:00 2001 From: William Gill Date: Sun, 19 Apr 2026 14:50:34 -0500 Subject: [PATCH] Image Studio: move tool_choice into params.custom_params (correct field) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous commit put tool_choice at the top level of params. Open WebUI drops that silently — apply_model_params_to_body has a whitelist of mapped param names (temperature, top_p, etc.) and tool_choice isn't on it. The Custom Parameters UI section also only iterates params.custom_params, which is why the value didn't appear there after importing the preset. Correct location is the custom_params sub-dict, where values go through json.loads before being merged into the outgoing chat completion body. 'required' stays a string after the failed json.loads and ends up exactly where the OpenAI / Ollama tools spec expects it. Source: src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte (UI binding) and backend/open_webui/utils/payload.py (serialization). Co-Authored-By: Claude Opus 4.7 (1M context) --- deployments/ai-stack/openwebui-models/image_studio.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployments/ai-stack/openwebui-models/image_studio.json b/deployments/ai-stack/openwebui-models/image_studio.json index c3b7087..fc7c2a0 100644 --- a/deployments/ai-stack/openwebui-models/image_studio.json +++ b/deployments/ai-stack/openwebui-models/image_studio.json @@ -8,7 +8,9 @@ "temperature": 0.5, "top_p": 0.9, "function_calling": "native", - "tool_choice": "required" + "custom_params": { + "tool_choice": "required" + } }, "meta": { "profile_image_url": "/static/favicon.png",