Files
open-webui/backend/open_webui/routers
Classic298 4df2d9a7aa perf: filter workspace models by access in SQL instead of loading every model (#28795)
Exporting workspace models loaded every model row, built a full response object with its owner for each, and only then dropped the ones the caller may not see. On a large model table that made the export endpoint slow in proportion to models the user cannot even access.

The owner-or-grant check now happens in the query itself, reusing the permission filter this file already applies to the paginated list endpoint, so only visible rows are ever hydrated. The by-user wrapper had one caller left and is gone with it.

Measured with 500 workspace models of which 3 are visible to the caller: 5 queries and ~12.7 ms before, 4 queries and ~2.8 ms after. The resulting set is unchanged for owner, public, direct-user, group and multi-grant entries, and base model entries stay excluded as before.
2026-08-19 18:15:01 -07:00
..
2026-06-29 01:38:41 -05:00
2026-08-13 17:26:38 -06:00
2026-06-29 13:03:14 -05:00
2026-08-13 16:42:10 -06:00
2026-08-14 00:22:17 -06:00
2026-07-24 02:36:10 -04:00
2026-08-17 01:21:58 -07:00
2026-06-29 05:47:21 -05:00
2026-08-11 17:35:05 -06:00
2026-07-27 19:39:36 -04:00
2026-08-16 23:38:34 -07:00
2026-06-29 13:03:14 -05:00
2026-08-17 00:51:04 -07:00
2026-08-10 23:13:10 -06:00
2026-08-11 01:15:05 -06:00
2026-08-09 13:22:46 -06:00
2026-08-16 23:51:38 -07:00
2026-06-17 02:52:35 +02:00