diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 412c33842..162857ef4 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -1556,8 +1556,10 @@ async def process_chat_payload(request, form_data, user, metadata, model): if mcp_clients: metadata["mcp_clients"] = mcp_clients - # Always inject builtin tools for native function calling based on enabled features - if metadata.get("params", {}).get("function_calling") == "native": + # Inject builtin tools for native function calling based on enabled features and model capability + # Check if builtin_tools capability is enabled for this model (defaults to True if not specified) + builtin_tools_enabled = model.get("info", {}).get("meta", {}).get("capabilities", {}).get("builtin_tools", True) + if metadata.get("params", {}).get("function_calling") == "native" and builtin_tools_enabled: builtin_tools = get_builtin_tools( request, { diff --git a/src/lib/components/workspace/Models/Capabilities.svelte b/src/lib/components/workspace/Models/Capabilities.svelte index f1e9741df..4f2c4988d 100644 --- a/src/lib/components/workspace/Models/Capabilities.svelte +++ b/src/lib/components/workspace/Models/Capabilities.svelte @@ -40,6 +40,10 @@ status_updates: { label: $i18n.t('Status Updates'), description: $i18n.t('Displays status updates (e.g., web search progress) in the response') + }, + builtin_tools: { + label: $i18n.t('Builtin Tools'), + description: $i18n.t('Automatically inject system tools in native function calling mode (e.g., timestamps, memory, chat history, notes, etc.)') } }; @@ -52,6 +56,7 @@ usage?: boolean; citations?: boolean; status_updates?: boolean; + builtin_tools?: boolean; } = {}; diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte index af863cc86..8307cb5e4 100644 --- a/src/lib/components/workspace/Models/ModelEditor.svelte +++ b/src/lib/components/workspace/Models/ModelEditor.svelte @@ -99,7 +99,8 @@ code_interpreter: true, citations: true, status_updates: true, - usage: undefined + usage: undefined, + builtin_tools: true }; let defaultFeatureIds = [];