mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #21009] [MERGED] perf: reduce triple query to single fetch in model toggle #48931
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/21009
Author: @Classic298
Created: 1/28/2026
Status: ✅ Merged
Merged: 1/29/2026
Merged by: @tjbck
Base:
dev← Head:model-triple📝 Commits (1)
4c8e577fix: reduce triple query to single fetch in model toggle📊 Changes
1 file changed (+7 additions, -8 deletions)
View changed files
📝
backend/open_webui/models/models.py(+7 -8)📄 Description
Summary
Eliminates redundant database queries in toggle_model_by_id. Previously, the function made 3 separate queries to toggle a model's active state.
Changes
models/models.py toggle_model_by_id:
Performance Impact
Before: 3 queries (fetch is_active, update, fetch model)
After: 1 query + commit + refresh on same object
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.