mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-22 09:31:58 -05:00
[PR #15311] feat/fix: Revamp of usage tracking, endpoint and display #111100
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/15311
Author: @Ithanil
Created: 6/25/2025
Status: 🔄 Open
Base:
dev← Head:usage_revamp📝 Commits (6)
be3d6f1directly return number of active users from backend for usage display5b1e504remove unused websocket variables6f88e8dfix usage_pool update mechanism and store running message ids instead of session ids per model in usage poole79637blet /api/usage return active requests per model and display the information in UserMenu5b3460cadd/change localesd6a79a7remove extraneous ' ,' at the end of running model list📊 Changes
7 files changed (+74 additions, -52 deletions)
View changed files
📝
backend/open_webui/main.py(+3 -3)📝
backend/open_webui/socket/main.py(+24 -15)📝
src/lib/components/chat/Chat.svelte(+12 -7)📝
src/lib/components/layout/Sidebar/UserMenu.svelte(+33 -25)📝
src/lib/i18n/locales/de-DE/translation.json(+1 -0)📝
src/lib/i18n/locales/en-US/translation.json(+1 -0)📝
src/lib/stores/index.ts(+0 -2)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Revamped tracking and display of "usage", fixing a tracking issue, exposing only necessary information to the client (i.e. not all active user IDs) and now displaying the actual concurrent LLM usage, overall and per model, which is arguably the more more interesting metric compared to the number of users with active websockets.
Added
Changed
Removed
activeUserIds,USAGE_POOLFixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Issue before this PR, where USAGE_POOL wasn't reliably filled -> no tooltip appears on hover:
https://github.com/user-attachments/assets/8a691796-abe5-4ed1-af2b-7a64ae7c80bd
With this PR, A) model usage is tracked properly and B) overall and individual running requests are displayed:
https://github.com/user-attachments/assets/63ef0f69-984e-4a4e-84bb-1853c1da8cd6
Also, just a proof that active users are tracked properly:
https://github.com/user-attachments/assets/e88f894f-bd19-47c8-93de-2affe296bc8a
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.