[GH-ISSUE #15111] feat: improve performance getting models #17473

Closed
opened 2026-04-19 23:14:16 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @mknet3 on GitHub (Jun 18, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15111

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Hi! I'm experiencing a high latency in the application when there are many models (more than 30) enabled. There are many queries being executed just to load the models. Here an example of a trace in Datadog (more than 500 spans):

Image

There are a lot of queries to get functions

SELECT function.id, function.user_id, function.name, function.type, function.content, function.meta, function.valves, function.is_active, function.is_global, function.updated_at, function.created_at
FROM function
WHERE function.type = ? AND function.is_active = ? AND function.is_global = ?

Image

Desired Solution you'd like

I would consider a fast query to get the models when loading the application and specific queries to get specific models when the user is going to use them.
Also consider cache models would be beneficial.

Alternatives Considered

No response

Additional Context

No response

Originally created by @mknet3 on GitHub (Jun 18, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/15111 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Hi! I'm experiencing a high latency in the application when there are many models (more than 30) enabled. There are many queries being executed just to load the models. Here an example of a trace in Datadog (more than 500 spans): ![Image](https://github.com/user-attachments/assets/2a7ca054-1c18-4cb6-982e-de20b8d1d591) There are a lot of queries to get functions ```sql SELECT function.id, function.user_id, function.name, function.type, function.content, function.meta, function.valves, function.is_active, function.is_global, function.updated_at, function.created_at FROM function WHERE function.type = ? AND function.is_active = ? AND function.is_global = ? ``` ![Image](https://github.com/user-attachments/assets/d035096c-fd30-4b97-be0d-6338972f4ccf) ### Desired Solution you'd like I would consider a fast query to get the models when loading the application and specific queries to get specific models when the user is going to use them. Also consider cache models would be beneficial. ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Jun 18, 2025):

PR welcome!

<!-- gh-comment-id:2983568621 --> @tjbck commented on GitHub (Jun 18, 2025): PR welcome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17473