displaying context and token stats in real time
Add parsing progress display to webui
Fixes #17079
Adds parsing progress during prompt tokenization, similar to token generation progress.
Changes:
- Display
Input: processed / total (percent%)during prompt parsing - Display parsing tokens/second (
X.X t/s) during parsing - Calculate parsing speed from
prompt_progresstiming data
Implementation:
- Added
parsingTokensPerSecond,inputTokensProcessed, andinputTokensTotaltoApiProcessingState - Updated
parseCompletionTimingData()to calculate parsing speed fromprompt_progress.time_msandprompt_progress.processed - Updated
getProcessingDetails()to show input parsing progress when status is 'preparing'
Users now see real-time parsing progress instead of just "Processing...".
@NoahOksuz I can't figure out how to enable it. I see:
@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
