mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #7766] enh: speedup open_webui.main.get_all_models() #14881
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @juancarlosm on GitHub (Dec 11, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7766
I have more than 80 models and UI is very slow, every call to a completion it takes more time than usual compared to another interfaces.
I have realized that every call to "get_all_models()" is very slow, and this is why (at least in my case):
open_webui/main.py: 1078
I'm using global_action_ids and, for each model is making the repeated calls to "Functions.get_function_by_id(action_id)" and "get_function_module_by_id(action_id)". The time to process this for 83 models is: 3.225s on my server.
Refactoring that function to prefetch global_action_ids data improves the function:
With this changes, that loop takes from: 3.225 to: 0.233s
I have seen significant improvement in the UI with this change. Any of you can reproduce it?