From 2c7acb928512713386f87a491245a8f81bfd3d31 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 17 Apr 2026 13:58:32 +0900 Subject: [PATCH] refac --- backend/open_webui/utils/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/models.py b/backend/open_webui/utils/models.py index 768f7588d..33642a339 100644 --- a/backend/open_webui/utils/models.py +++ b/backend/open_webui/utils/models.py @@ -283,11 +283,15 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) # Pre-warm the function module cache once per unique function ID. # This ensures each function's DB freshness check runs exactly once, # not once per (model × function) pair. - for function_id in all_function_ids: + # Only attempt to load functions that actually exist in the local DB; + # imported/custom model configs may reference tools or filters the user + # hasn't installed, and trying to load those would cause persistent + # "Failed to load function module" log spam on every model refresh. + for function_id in functions_by_id: try: await get_function_module_from_cache(request, function_id) except Exception as e: - log.info(f'Failed to load function module for {function_id}: {e}') + log.debug(f'Failed to load function module for {function_id}: {e}') # Apply global model defaults to all models # Per-model overrides take precedence over global defaults