mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #12127] [CLOSED] perf: optimize get_models #61707
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/12127
Author: @yvedeng
Created: 3/27/2025
Status: ❌ Closed
Base:
dev← Head:yvedeng/optimize-models-endpoint📝 Commits (1)
b157814perf: optimize get_models📊 Changes
4 files changed (+10 additions, -7 deletions)
View changed files
➕
backend/open_webui/conftest.py(+4 -0)📝
backend/open_webui/models/models.py(+3 -4)📝
backend/open_webui/test/apps/webui/routers/test_models.py(+2 -2)📝
backend/open_webui/test/util/mock_user.py(+1 -1)📄 Description
Changelog Entry
Description
This PR is to improve the performance of the DB query for the get_models() function.
Given that we have N models, we can reduce the number of DB queries from 1 + N (for retrieving the users) to 1.
Changed
Additional Information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.