[PR #22464] [CLOSED] fix: add pagination and streaming to OOM-vulnerable endpoints (#22206) #49761

Closed
opened 2026-04-30 02:04:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22464
Author: @Classic298
Created: 3/8/2026
Status: Closed

Base: devHead: fix/paginate-oom-endpoints


📝 Commits (1)

  • 6eb154f fix: add pagination and streaming to OOM-vulnerable endpoints (#22206)

📊 Changes

9 files changed (+314 additions, -141 deletions)

View changed files

📝 backend/open_webui/models/chats.py (+21 -9)
📝 backend/open_webui/models/feedbacks.py (+24 -9)
📝 backend/open_webui/models/files.py (+24 -7)
📝 backend/open_webui/routers/chats.py (+42 -6)
📝 backend/open_webui/routers/evaluations.py (+45 -7)
📝 backend/open_webui/routers/files.py (+9 -3)
📝 src/lib/apis/chats/index.ts (+91 -61)
📝 src/lib/apis/evaluations/index.ts (+24 -16)
📝 src/lib/apis/files/index.ts (+34 -23)

📄 Description

Untested - Reference PR only

https://github.com/open-webui/open-webui/issues/22206

Multiple API endpoints loaded entire datasets into memory at once, causing OOM crashes for users with large data volumes. This commit adds server-side pagination and streaming to all affected endpoints.

High priority (regular user OOM):

  • GET /chats/all: added page/limit params with batched queries

  • GET /evaluations/feedbacks/user: added page/limit params

  • GET /files/: added page/limit params

Medium priority (admin OOM):

  • GET /evaluations/feedbacks/all: added page/limit params

  • GET /evaluations/feedbacks/all/export: converted to NDJSON streaming

  • GET /chats/all/db: converted to NDJSON streaming export

  • GET /chats/all/archived: added page/limit params

Model layer: enabled actual skip/limit in get_chats() (was commented out), added skip/limit to get_archived_chats_by_user_id, get_all_feedbacks, get_feedbacks_by_user_id, get_files, get_files_by_user_id.

Frontend: updated getAllChats, getAllArchivedChats, getFiles to paginate in batches; updated getAllUserChats and exportAllFeedbacks to parse NDJSON streams.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22464 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/paginate-oom-endpoints` --- ### 📝 Commits (1) - [`6eb154f`](https://github.com/open-webui/open-webui/commit/6eb154fd2cefa66db43b5465dca22868ace9ba7b) fix: add pagination and streaming to OOM-vulnerable endpoints (#22206) ### 📊 Changes **9 files changed** (+314 additions, -141 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/chats.py` (+21 -9) 📝 `backend/open_webui/models/feedbacks.py` (+24 -9) 📝 `backend/open_webui/models/files.py` (+24 -7) 📝 `backend/open_webui/routers/chats.py` (+42 -6) 📝 `backend/open_webui/routers/evaluations.py` (+45 -7) 📝 `backend/open_webui/routers/files.py` (+9 -3) 📝 `src/lib/apis/chats/index.ts` (+91 -61) 📝 `src/lib/apis/evaluations/index.ts` (+24 -16) 📝 `src/lib/apis/files/index.ts` (+34 -23) </details> ### 📄 Description # Untested - Reference PR only https://github.com/open-webui/open-webui/issues/22206 Multiple API endpoints loaded entire datasets into memory at once, causing OOM crashes for users with large data volumes. This commit adds server-side pagination and streaming to all affected endpoints. High priority (regular user OOM): - GET /chats/all: added page/limit params with batched queries - GET /evaluations/feedbacks/user: added page/limit params - GET /files/: added page/limit params Medium priority (admin OOM): - GET /evaluations/feedbacks/all: added page/limit params - GET /evaluations/feedbacks/all/export: converted to NDJSON streaming - GET /chats/all/db: converted to NDJSON streaming export - GET /chats/all/archived: added page/limit params Model layer: enabled actual skip/limit in get_chats() (was commented out), added skip/limit to get_archived_chats_by_user_id, get_all_feedbacks, get_feedbacks_by_user_id, get_files, get_files_by_user_id. Frontend: updated getAllChats, getAllArchivedChats, getFiles to paginate in batches; updated getAllUserChats and exportAllFeedbacks to parse NDJSON streams. ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [X] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 02:04:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#49761