mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 03:18:21 -05:00
[PR #18682] [CLOSED] feat: add approximate total for chat completions #128537
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/18682
Author: @ryan-steed-usa
Created: 10/28/2025
Status: ❌ Closed
Base:
dev← Head:extend-cleanup-approximate-total📝 Commits (1)
6df0d2cfeat: add approximate total for chat completions📊 Changes
4 files changed (+31 additions, -24 deletions)
View changed files
📝
backend/open_webui/utils/chat.py(+2 -1)📝
backend/open_webui/utils/response.py(+29 -0)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+0 -1)📝
src/lib/utils/index.ts(+0 -22)📄 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. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
Added
calculate_chat_completion_approximate_totalfunction inbackend/open_webui/utils/response.pythat processes OpenAI-compatible data to compute approximate total time from prompt and predicted millisecondsChanged
chat_completedfunction inbackend/open_webui/utils/chat.pyto use the new calculation function before processing filtersRemoved
approximateToHumanReadableutility function fromsrc/lib/utils/index.tsas it's now superseded by the backend calculationapproximateToHumanReadablefromsrc/lib/components/chat/Messages/ResponseMessage.sveltesince it's no longer neededAdditional Information
Screenshots or Videos
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.