-
Notifications
You must be signed in to change notification settings - Fork 13.7k
displaying context and token stats in real time #17111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@NoahOksuz I can't figure out how to enable it. I see:
|
works locally. im just working on another PR atm ill take a second look in 5 minutes at this |
|
aha, I just patched sources of used build. Which seems not enough :( If you share a picture how it looks on your side, I can genuely how I think it looks. |
|
I think you need to enable progress updates from the backend. Setting return_progress to true in the request body should enable it. // tools/server/webui/src/lib/services/chat.ts chat.ts ~ line 117
const requestBody: ApiChatCompletionRequest = {
messages: processedMessages.map((msg: ApiChatMessageData) => ({
role: msg.role,
content: msg.content
})),
stream
};should be const requestBody: ApiChatCompletionRequest = {
messages: processedMessages.map((msg: ApiChatMessageData) => ({
role: msg.role,
content: msg.content
})),
stream,
return_progress: true // Add this
};Then it works for me |
allozaur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @NoahOksuz, thanks a lot for this contribution. Found one minor improvement to add, also please make sure that npm run lint && npm run check succeeds locally on your end and passes the checks in GH Actions.
Lastly, please provide the short testing instruction on how this improvement can be reproduced consistently, it's a bit unclear how it can be tested reliably at the moment.
| const parsingTokensPerSecond = promptProgress && promptProgress.time_ms > 0 | ||
| ? (promptProgress.processed / promptProgress.time_ms) * 1000 | ||
| : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const parsingTokensPerSecond = promptProgress && promptProgress.time_ms > 0 | |
| ? (promptProgress.processed / promptProgress.time_ms) * 1000 | |
| : undefined; | |
| const parsingTokensPerSecond = promptProgress && promptProgress.time_ms > 0 && promptProgress.processed > 0 | |
| ? (promptProgress.processed / promptProgress.time_ms) * 1000 | |
| : undefined; |


Add parsing progress display to webui
Fixes #17079
Adds parsing progress during prompt tokenization, similar to token generation progress.
Changes:
Input: processed / total (percent%)during prompt parsingX.X t/s) during parsingprompt_progresstiming dataImplementation:
parsingTokensPerSecond,inputTokensProcessed, andinputTokensTotaltoApiProcessingStateparseCompletionTimingData()to calculate parsing speed fromprompt_progress.time_msandprompt_progress.processedgetProcessingDetails()to show input parsing progress when status is 'preparing'Users now see real-time parsing progress instead of just "Processing...".