diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index be1cef611..8670436c3 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1102,6 +1102,16 @@ async def generate_chat_completions(form_data: dict, user=Depends(get_verified_u if model["owned_by"] == "arena": model_ids = model.get("info", {}).get("meta", {}).get("model_ids") + filter_mode = model.get("info", {}).get("meta", {}).get("filter_mode") + if filter_mode == 'exclude': + model_ids = [ + model["id"] + for model in await get_all_models() + if model.get("owned_by") != "arena" + and not model.get("info", {}).get("meta", {}).get("hidden", False) + and model["id"] not in model_ids + ] + selected_model_id = None if isinstance(model_ids, list) and model_ids: selected_model_id = random.choice(model_ids) diff --git a/src/lib/components/admin/Settings/Evaluations/ModelModal.svelte b/src/lib/components/admin/Settings/Evaluations/ModelModal.svelte index 4860bd56a..9816d242a 100644 --- a/src/lib/components/admin/Settings/Evaluations/ModelModal.svelte +++ b/src/lib/components/admin/Settings/Evaluations/ModelModal.svelte @@ -37,6 +37,7 @@ let selectedModelId = ''; let modelIds = []; + let filterMode = 'include'; let imageInputElement; let loading = false; @@ -72,7 +73,8 @@ meta: { profile_image_url: profileImageUrl, description: description || null, - model_ids: modelIds.length > 0 ? modelIds : null + model_ids: modelIds.length > 0 ? modelIds : null, + filter_mode: modelIds.length > 0 ? (filterMode ? filterMode : null) : null } }; @@ -95,6 +97,7 @@ profileImageUrl = model.meta.profile_image_url; description = model.meta.description; modelIds = model.meta.model_ids || []; + filterMode = model.meta?.filter_mode ?? 'include'; } }; @@ -281,7 +284,25 @@
-
{$i18n.t('Models')}
+
+
{$i18n.t('Models')}
+ +
+ +
+
{#if modelIds.length > 0}