Skip to content

[Serve] Show the prompt read rate (prefill tok/s) in the console done line - #484

Closed
jack7277 wants to merge 2 commits into
simplexai-labs:mainfrom
jack7277:feat/console-prefill-speed
Closed

jack7277 wants to merge 2 commits into
simplexai-labs:mainfrom
jack7277:feat/console-prefill-speed

Conversation

@jack7277

@jack7277 jack7277 commented Dec 5, 2026 •

Copy link
Copy Markdown

What

The console done line now also shows the prompt read rate (prefill tok/s), and the request accounting row gains prefill_tok_s. Until now the console only showed the decode rate; the prompt read rate was visible only in the engine's own prompt line and in the API timings.prompt_per_second. Having it on the done line makes the two phases of a request comparable at a glance.

How

  • serve/server_parts/core.py: new prefill_speed(prompt_tokens, last) - the tokens actually read (not the cached ones) over the engine's prompt_ms, the same figures request_timings turns into prompt_per_second. None for a fully cached prompt or an engine without a prompt clock; a cancelled read counts only what was read; old engines without prompt_read fall back to reused.
  • serve/server.py: import it, add prefill_tok_s to the accounting row, append the prefill rate to the [strata] done: console line (omitted when there is no rate).

Tests

python -m unittest serve.test_answer_speed serve.test_request_accounting - 27 tests, all OK, including 7 new PrefillSpeed cases (matches request_timings, cached tokens excluded, slot-session cache, fully cached prompt, cancelled read, old-engine fallback, no clock) and the new prefill_tok_s assertion in test_request_accounting.

@jack7277 jack7277 closed this by deleting the head repository Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant