Skip to content

Conversation

@NoahOksuz
Copy link
Contributor

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_progress timing data

Implementation:

  • Added parsingTokensPerSecond, inputTokensProcessed, and inputTokensTotal to ApiProcessingState
  • Updated parseCompletionTimingData() to calculate parsing speed from prompt_progress.time_ms and prompt_progress.processed
  • Updated getProcessingDetails() to show input parsing progress when status is 'preparing'

Users now see real-time parsing progress instead of just "Processing...".

@catap
Copy link

catap commented Nov 8, 2025

@NoahOksuz I can't figure out how to enable it. I see:

image

@NoahOksuz
Copy link
Contributor Author

@NoahOksuz I can't figure out how to enable it. I see:
image

works locally. im just working on another PR atm ill take a second look in 5 minutes at this

@catap
Copy link

catap commented Nov 8, 2025

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.

@gSUz92nc
Copy link
Contributor

gSUz92nc commented Nov 8, 2025

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

Copy link
Collaborator

@allozaur allozaur left a 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.

Comment on lines +256 to +258
const parsingTokensPerSecond = promptProgress && promptProgress.time_ms > 0
? (promptProgress.processed / promptProgress.time_ms) * 1000
: undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: webui: add parsing progress

4 participants