mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-09 10:50:35 -06:00
[PR #22788] [CLOSED] perf: massive 99.982% payload size reduction for functions list (~x5,550 smaller) #97905
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22788
Author: @silentoplayz
Created: 3/18/2026
Status: ❌ Closed
Base:
dev← Head:fix/functions-payload-optimization📝 Commits (1)
65426fdperf(functions): massive 99.98% payload reduction for function list📊 Changes
3 files changed (+35 additions, -13 deletions)
View changed files
📝
backend/open_webui/models/functions.py(+32 -12)📝
backend/open_webui/models/users.py(+2 -0)📝
src/lib/components/admin/Functions.svelte(+1 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
/api/v1/functions/listendpoint to significantly reduce payload size. Previously, the endpoint included both the full function source code and the complete user settings object (which can be large) for every function in the list. This optimization removes thecontentfield and uses a leanerUserResponsemodel, reducing response sizes by over 99.9% in some cases (e.g., from 323MB to 58KB).Fixed (in the process of working on this optimization)
.lengthon anullvalue before the function list had loaded.Changed
FunctionUserResponseto inherit fromFunctionResponse(excludingcontent) and use a limitedUserResponsemodel.get_function_listinmodels/functions.pyfor efficient, manual field selection to prevent unintended data leakage from the database objects.Additional Information
By stripping out the redundant function source code and those heavy user settings, we've achieved a 99.982% reduction in payload size.
To put that in perspective:
This not only makes the page load instantly but also significantly reduces the memory footprint on your browser and the bandwidth usage on your server.
Screenshots or Videos
Before:
After:
Before vs After Screen Recordings:
Screencast from 2026-03-18 04-06-45.webm
Screencast from 2026-03-18 04-05-12.webm
Screencast from 2026-03-18 04-13-40.webm
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.