Skip to content

Commit 2c7acb9

Browse files
committed
refac
1 parent 50363ba commit 2c7acb9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

backend/open_webui/utils/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,15 @@ def get_filter_items_from_module(function, module):
283283
# Pre-warm the function module cache once per unique function ID.
284284
# This ensures each function's DB freshness check runs exactly once,
285285
# not once per (model × function) pair.
286-
for function_id in all_function_ids:
286+
# Only attempt to load functions that actually exist in the local DB;
287+
# imported/custom model configs may reference tools or filters the user
288+
# hasn't installed, and trying to load those would cause persistent
289+
# "Failed to load function module" log spam on every model refresh.
290+
for function_id in functions_by_id:
287291
try:
288292
await get_function_module_from_cache(request, function_id)
289293
except Exception as e:
290-
log.info(f'Failed to load function module for {function_id}: {e}')
294+
log.debug(f'Failed to load function module for {function_id}: {e}')
291295

292296
# Apply global model defaults to all models
293297
# Per-model overrides take precedence over global defaults

0 commit comments

Comments
 (0)