From fcfdc472a765e840e79ae5b71118c5b5bbbee8e8 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:01:02 +0100 Subject: [PATCH] feat: find models by their ID in the admin and workspace model search (#35297) Searching in Admin Settings > Models only matched the display name, and Workspace > Models matched the name, the base model and the owner but not the model's own ID. A model that was renamed, or whose name differs from its ID, could not be found by typing the ID that the tooltip and the API show. Both searches now match the ID too, like the chat model selector, tools and functions searches already do. Fixes #35296 --- backend/open_webui/models/models.py | 1 + src/lib/components/admin/Settings/Models.svelte | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/models/models.py b/backend/open_webui/models/models.py index 791269b920..bf63b475cd 100755 --- a/backend/open_webui/models/models.py +++ b/backend/open_webui/models/models.py @@ -518,6 +518,7 @@ class ModelsTable: stmt = stmt.filter( or_( Model.name.ilike(f'%{query_key}%'), + Model.id.ilike(f'%{query_key}%'), Model.base_model_id.ilike(f'%{query_key}%'), User.name.ilike(f'%{query_key}%'), User.email.ilike(f'%{query_key}%'), diff --git a/src/lib/components/admin/Settings/Models.svelte b/src/lib/components/admin/Settings/Models.svelte index 30f845d0f0..a4fcff8999 100644 --- a/src/lib/components/admin/Settings/Models.svelte +++ b/src/lib/components/admin/Settings/Models.svelte @@ -165,7 +165,12 @@ filteredModels = models .filter((m) => !selectedTag || modelTags(m).includes(selectedTag)) - .filter((m) => searchValue === '' || m.name.toLowerCase().includes(searchValue.toLowerCase())) + .filter( + (m) => + searchValue === '' || + m.name.toLowerCase().includes(searchValue.toLowerCase()) || + m.id.toLowerCase().includes(searchValue.toLowerCase()) + ) .filter((m) => { if (viewOption === 'available') return availableModelIds.has(m.id) || isPresetModel(m); if (viewOption === 'unavailable') return !availableModelIds.has(m.id) && !isPresetModel(m);