Skip to content

Use core v0.54.0: time to first token and generation speed - #240

Merged
fylorn merged 1 commit into
devfrom
feat/generation-speed
Sep 28, 2026
Merged

fylorn merged 1 commit into
devfrom
feat/generation-speed

Conversation

@fylorn

@fylorn fylorn commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Core 0.54.0 (ThinkWatchProject/ThinkWatch-Core#220) records when each response's first token arrives and how fast the response is generated. This PR pins that release and shows both figures.

Why

The only timing we had was the time to the response headers. The menu bar's live rate divided output by the time after the headers. A response that is not streamed gets its headers only when generation is done, so one such request could push that figure to tens of thousands of tokens per second. The headers of a streamed response usually come back at once, so queueing and reading the prompt were counted as generation.

What changes

  • Traffic. The latency cell now reads first token → total. Hovering it lists the first token, the total time, the generation time and the speed. There is no new column: at the default window size (1100 × 720, sidebar open) a speed column fits in Chinese (864 of 864 px) but pushes the English table 16 px wide, and the Cost column out of view. A running request shows its first token as soon as request_first_token arrives, and before that only the clock. A response that is not streamed shows its total time only, with no hover.
  • Request details.
    • Five figures: first token, total time, speed, tokens, cost.
    • The bar is split into waiting for the first token and generating.
    • The response-header time (TTFB) moves into the rows below.
    • A response that is not streamed shows "—" for the first token and the speed, and has no bar.
  • Overview.
    • The latency section now reports time to first token.
    • A new Generation speed section gives the median speed by model and by upstream. It has the same two columns and row order as the latency section, and its figures line up with that section's P95 and Samples columns.
  • Upstreams. The timing column is now TTFT / speed: the median first token above, and the median speed below in the muted second line, as in the 24-hour column. A separate speed column would have taken 107 px from the upstream name column, and 21 px here.
  • Menu bar. The wording is unchanged; the figure now comes from the corrected live rate.
  • Rust. dashboard and upstream_stats also fetch /token-rate and /token-rate/provider. These calls are made from Rust only, so the webview whitelist is unchanged.
  • Screenshot pipeline. scripts/shots mock rows carry ttft_ms and tokens_per_sec, and status.json is regenerated from 0.54.0. overview.json is left as it is: its sample keys were edited by hand in Use core v0.52.0: upstream and proxy dialogs show the settings as written; keys behind an eye toggle #226, and it has no protocol change here.

Upgrading empties the request history: the request store schema moves from 21 to 22.

Checks

  • pnpm typecheck, pnpm test (553 tests) and pnpm build.
  • cargo fmt --check, cargo clippy --all-targets -D warnings (and --lib), and cargo test, including the control-plane handshake against twcore 0.54.0 built from the tag.
  • In the full preview harness:
    • The traffic table stays 864 px in both languages.
    • The details of a streamed request show all five figures and the bar; those of a whole response show "—" and no bar.
    • The overview and the upstream table show the new figures.
    • In live mode, a running row adds its first token when it arrives.

🤖 Generated with Claude Code

Core 0.54.0 records when each response's first token arrives and how fast
it is generated, and fixes the live rate, which a single response that is
not streamed could push to tens of thousands of tokens per second.

- Traffic: the latency cell shows time to first token → total time. Hovering
  it lists the first token, the total, the generation time and the speed.
  The table gets no new column, because at the default window size the
  English table would no longer fit. A running request shows its first
  token as soon as it arrives.
- Request details: five figures (first token, total time, speed, tokens,
  cost). The bar is split into waiting for the first token and generating,
  and the response-header time moves into the rows below. A response that
  is not streamed shows "—" for the first token and the speed, and no bar.
- Overview: the latency section reports time to first token. A new
  Generation speed section gives the median speed by model and by upstream,
  aligned with the latency section above it.
- Upstreams: the timing column reads "TTFT / speed", with the median first
  token above and the median speed below, in the same two-line layout as
  the 24-hour column.
- The menu bar keeps its wording; its figure now comes from the corrected
  live rate.

Upgrading empties the request history: the request store schema moved
from 21 to 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 15e9a7c into dev Sep 28, 2026
4 checks passed
@fylorn
fylorn deleted the feat/generation-speed branch September 28, 2026 01:06
@fylorn fylorn mentioned this pull request Sep 28, 2026
fylorn added a commit that referenced this pull request Sep 28, 2026
* chore: 2026.9.22

- package.json, src-tauri/tauri.conf.json, src-tauri/Cargo.toml and the
  thinkwatch-lite entry of src-tauri/Cargo.lock at 2026.9.22
- release-notes/2026.9.22.md: core 0.54.0 (protocol 27), the request
  history that the new request store empties, and the time to first token
  and generation speed it adds (#240)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* release-notes: add #237 and #242 to 2026.9.22

- Menu bar: Today catches up when the computer wakes after sleeping through
  midnight, or when the clock or time zone changes; the traffic page's
  today and the keys page's 24-hour usage follow (#242)
- Routing: model names outside the suggestions are kept in a rule's model
  condition, Change model to and the dry run (#237)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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