Skip to content

Comments

feat(tui): show tokens per second in assistant message footer#14493

Open
thdxr wants to merge 4 commits intodevfrom
feature/tui-assistant-tokens-per-second
Open

feat(tui): show tokens per second in assistant message footer#14493
thdxr wants to merge 4 commits intodevfrom
feature/tui-assistant-tokens-per-second

Conversation

@thdxr
Copy link
Contributor

@thdxr thdxr commented Feb 20, 2026

This PR adds tokens per second (tok/s) display to the TUI assistant message footer.

Changes

  • Added index prop to AssistantMessage component to enable efficient backwards iteration through message list
  • Modified duration memo to stats memo that returns both duration and total output tokens
  • Tokens are accumulated from all assistant messages since the parent user message
  • Display format: {duration} · {tps} tok/s

Implementation

  • Single backward loop starting from current message index
  • Accumulates tokens from assistant messages between user message and current message
  • Exits immediately when parent user message is found
  • Only shows tok/s when output tokens > 0

…nses

Previously, users only saw tok/s metrics after a message completed. Now

the TUI displays live streaming speed that updates throughout the response,

giving immediate feedback on model performance.
@thdxr thdxr force-pushed the feature/tui-assistant-tokens-per-second branch from a72ec51 to 2d89c22 Compare February 21, 2026 19:13
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.

1 participant