mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #21004] [CLOSED] perf: resolve N+1 queries in models router (list and import) #41508
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/21004
Author: @Classic298
Created: 1/28/2026
Status: ❌ Closed
Base:
dev← Head:model-router-list📝 Commits (2)
e1ecb0dfix: resolve N+1 queries in models router (list and import)92fe87bUpdate models.py📊 Changes
1 file changed (+9 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/models.py(+9 -2)📄 Description
Summary
Eliminates N+1 database queries in two models router endpoints.
Changes
GET /models/list (get_models)
POST /models/import (import_models)
Performance Impact
get_models: N+1 → 1 query (reuses groups already fetched for filtering)
import_models: N+1 → 1 query (single batch fetch with SQL IN clause)
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.