feat: Separate Tool Model from Task model #4677

Closed
opened 2025-11-11 16:00:28 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @weikinhuang on GitHub (Apr 2, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Currently when a Task Model is set, when calling a tool, it will use it instead of the Current Model. This sometimes presents an issue where the Task model might be much less knowledgable than the main model.

I opened a discussion here https://github.com/open-webui/open-webui/discussions/12245, where I'm trying to use the Web Search tool to automatically let the LLM decide if it needs more information from the web instead of manually enabling/disabling it from the chat ui. While I was debugging, I noticed the AutoTools filter, which uses the Main Model correctly determines that it does not need additional information, but the tools call is done by the task model, and will make a web request regardless of the AutoTools filter's response.

Desired Solution you'd like

It would be great to separate the Tool Model setting from the Task Model setting, giving users the ability to use say a 0.5B model for title, tags, search query generation, and having a larger model (ex. gemma:4b or the Current Model) for calling tools.

Alternatives Considered

Creating a dedicated system prompt for the smaller Task Model.

Additional Context

Referenced issue body:


I've been trying to speed up my instance of open-webui with separate ollama servers in my homelab, where I'm hosting smaller models (gemma:4b) and larger models (mistral-small-3:24b) on separate ollama instances on different nodes.

I recently set up the (Web Search Tool)[https://openwebui.com/t/constliakos/web_search] along with the (AutoTool Filter)[https://openwebui.com/f/hub/autotool_filter]. Everything is working great when I set the Task Model in the admin to Current Model. The main model correctly determines when it needs to use the websearch tool, and calls it appropriately in a turn. However when I set a different task model, the AutoTool Filter correctly determines that no tool needs to be called, but the task model will call it anyways.

Looking through the logs with some debugging, I can correctly attribute the tool call to the task model and not the main model when set when logging __model__ in the Tool class.

Attached videos show the issue.

Using Current Model as task model.

https://github.com/user-attachments/assets/52eabdd1-7acd-47ae-b477-a97e9d92e711

Using gemma:4b as task model.

https://github.com/user-attachments/assets/60803bee-da61-4d2a-844d-463221d2c4cd

This is the setting I'm referring to:

chrome_Rv2vnm6Fsf

Originally created by @weikinhuang on GitHub (Apr 2, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Currently when a `Task Model` is set, when calling a tool, it will use it instead of the `Current Model`. This sometimes presents an issue where the Task model might be much less knowledgable than the main model. I opened a discussion here https://github.com/open-webui/open-webui/discussions/12245, where I'm trying to use the `Web Search` tool to automatically let the LLM decide if it needs more information from the web instead of manually enabling/disabling it from the chat ui. While I was debugging, I noticed the `AutoTools` filter, which uses the Main Model correctly determines that it does not need additional information, but the tools call is done by the task model, and will make a web request regardless of the `AutoTools` filter's response. ### Desired Solution you'd like It would be great to separate the `Tool Model` setting from the `Task Model` setting, giving users the ability to use say a `0.5B` model for title, tags, search query generation, and having a larger model (ex. `gemma:4b` or the `Current Model`) for calling tools. ### Alternatives Considered Creating a dedicated system prompt for the smaller Task Model. ### Additional Context Referenced issue body: --- I've been trying to speed up my instance of open-webui with separate ollama servers in my homelab, where I'm hosting smaller models (gemma:4b) and larger models (mistral-small-3:24b) on separate ollama instances on different nodes. I recently set up the (Web Search Tool)[https://openwebui.com/t/constliakos/web_search] along with the (AutoTool Filter)[https://openwebui.com/f/hub/autotool_filter]. Everything is working great when I set the Task Model in the admin to `Current Model`. The main model correctly determines when it needs to use the websearch tool, and calls it appropriately in a turn. However when I set a different task model, the AutoTool Filter correctly determines that no tool needs to be called, but the task model will call it anyways. Looking through the logs with some debugging, I can correctly attribute the tool call to the task model and not the main model when set when logging `__model__` in the Tool class. Attached videos show the issue. Using `Current Model` as task model. https://github.com/user-attachments/assets/52eabdd1-7acd-47ae-b477-a97e9d92e711 Using `gemma:4b` as task model. https://github.com/user-attachments/assets/60803bee-da61-4d2a-844d-463221d2c4cd This is the setting I'm referring to: ![chrome_Rv2vnm6Fsf](https://github.com/user-attachments/assets/fe6d9eab-2503-4463-ac31-7c7071815547)
Author
Owner

@Classic298 commented on GitHub (Apr 2, 2025):

"Current Model for calling tools."

Set function calling to "native" for a model and you will achieve exactly this while retaining a very small model for all other tasks.

@Classic298 commented on GitHub (Apr 2, 2025): _"Current Model for calling tools."_ Set function calling to "native" for a model and you will achieve exactly this while retaining a very small model for all other tasks.
Author
Owner

@weikinhuang commented on GitHub (Apr 2, 2025):

I tried to do so, but for using (Mistral Small)[https://huggingface.co/bartowski/mistralai_Mistral-Small-3.1-24B-Instruct-2503-GGUF] the proper tool calling prompt isn't correctly built into the model file. And when I try to do so ollama I get:

400: Ollama: 400, message='Bad Request', url='http://ollama.ollama.svc.cluster.local.:11434/api/chat'

Image

@weikinhuang commented on GitHub (Apr 2, 2025): I tried to do so, but for using (Mistral Small)[https://huggingface.co/bartowski/mistralai_Mistral-Small-3.1-24B-Instruct-2503-GGUF] the proper tool calling prompt isn't correctly built into the model file. And when I try to do so ollama I get: ``` 400: Ollama: 400, message='Bad Request', url='http://ollama.ollama.svc.cluster.local.:11434/api/chat' ``` ![Image](https://github.com/user-attachments/assets/cf3d5f4b-78bf-4b0e-9894-4a4b237182c3)
Author
Owner

@weikinhuang commented on GitHub (Apr 8, 2025):

Another possibility for this feature request is the have a option for different models for each of the different types of tasks and not just for tools specifically.

Image

@weikinhuang commented on GitHub (Apr 8, 2025): Another possibility for this feature request is the have a option for different models for each of the different types of tasks and not just for tools specifically. ![Image](https://github.com/user-attachments/assets/679d9608-73d2-448f-b03c-7cd8a778b719)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4677