Introduction¶
When running model conversations in DSH, you’re typically more interested in “how long this turn took before text appeared” and “how fast decoding is,” rather than just the total token usage. The built-in UI displays a usage capsule, but it doesn’t directly provide Time To First Token (TTFT) and output speed (tok/s) readings in the action row of each response turn.
dsh-simple-tps, introduced below, is a client-side DSH plugin maintained by community member flyxiu: it displays the first-token latency and output speed for each turn in the action row below the assistant’s response in the web version—positioned after the branch button and before the built-in usage capsule; clicking it expands a detail modal. The current plugin version is 0.1.3, licensed under MIT.
What Is This¶
dsh-simple-tps is positioned as a DSH web GUI plugin that provides per-turn TTFT / TPS readings in the action row of each chat turn.
The implementation consists of two parts: host and frontend. The host holds the conversation projection and folds per-turn metrics from the complete event log; the frontend handles reading and presentation. The readings are registered through the conversation.chat.assistant-actions list slot, and the visual position is adjusted using CSS order to place it between the branch button and the usage capsule.
- Directory page: https://www.skillhub.cn/plugins/flyxiu/dsh-simple-tps
- Source code: https://github.com/flyxiu/dsh-simple-tps
Core Features¶
Per-Turn Readings and Details¶
Each response turn displays that turn’s metrics below it. The default form resembles the built-in usage capsule: it defaults to showing speed, and clicking expands the details.
Metric definitions (as defined in the README):
- First token: The TTFT of the first step, i.e., the first token timestamp minus the start timestamp of that step, corresponding to “how long you waited after pressing Enter before the model started speaking.”
- Avg: The arithmetic mean of all steps that recorded a first token; if there’s only one step, it equals “First token” and only one is shown.
- tok/s: Weighted by token, the total number of output tokens divided by the total decoding duration (each step’s message completion timestamp minus the first token timestamp). If any metric cannot be obtained, that item is omitted; if all metrics cannot be obtained, the entire entry is not rendered.
A single turn of conversation may contain multiple assistant steps. Tool calls split one turn into several model requests, and the folding rules above aggregate accordingly.
Host-Side Projection and Frontend Fallback¶
The browser-side session snapshot only covers the currently loaded window, and assistant/live-chunk only exists in real-time streams and is not written to the persistent log. The plugin therefore replays the first-token timestamp on the host side from the data.stream (time0 + dt[]) of assistant/message in the persistent log, using the same event semantics as DSH sessionStats. This ensures that historical turns after pagination, compression, and refresh still maintain precise TTFT rather than estimates.
When the projection is unavailable, the frontend falls back to the node timing field. Speed is calculated based on the entire step duration and displayed as a lower bound with ≈ (e.g., ≈45.0 tok/s).
Real-Time Speed (During Streaming)¶
During a conversation, the current streaming output displays real-time speed in characters/s after the “DeepSeeking” indicator, independent of per-turn readings. It disappears when the turn ends. Since the client cannot obtain token counts during the streaming phase, the real-time item uses character-based speed; per-turn readings remain token-based. The sampling window is the most recent 1.2 seconds. When paused or conditions are insufficient, the last reading is retained to reduce fluctuation.
Installation and Activation¶
Prerequisites: DSH version no lower than 0.2.1-rc.2; the host depends on the sessionProjections service, and the plugin will not activate if the projection is not registered.
The plugin is not published to npm and must be installed from the GitHub repository.
GUI: In “Settings → Built-in Plugins → Add Plugin,” enter:
https://github.com/flyxiu/dsh-simple-tps
Command Line (the argument after add is passed directly to pnpm):
dsh plugin --profile web add https://github.com/flyxiu/dsh-simple-tps
github:flyxiu/dsh-simple-tps is equivalent to the above URL in pnpm. For local development and debugging:
dsh plugin --profile web add link:/path/to/dsh-simple-tps
With the link: method, code changes take effect without pushing, but the plugin marketplace will not perform online update checks for it.
Update: The plugin marketplace compares the repository HEAD with the commit in the lockfile; clicking update in the marketplace is sufficient—no reinstallation needed (except for link: installations).
Uninstall:
dsh plugin --profile web remove dsh-simple-tps
dsh-restart
Typical Usage¶
After installation and satisfying the DSH version and sessionProjections requirements, no additional configuration is needed: open the web chat, and you’ll see the readings in the action row of each assistant response; when hovering over historical turns, they fade in just like the usage capsule. Clicking the readings opens the detail modal.
On the development side, if you modify the host’s lib/index.js, you need to run dsh-restart; if you modify the frontend’s lib/client.js, you need a hard browser refresh (Ctrl+F5). There is no hot reload.
Offline self-testing (does not depend on a running DSH):
node tests/run.mjs # Frontend: registration, folding, projection priority, narrow-screen degradation, number formatting
node tests/host.mjs # Host: stream restoration, multi-step folding, real log comparison
The package’s npm test is equivalent to running the above two commands in sequence.
Use Cases and Notes¶
Suitable for: Developers who do conversation debugging in the DSH web interface, comparing per-turn TTFT/TPS across different models or prompts; those who need precise metrics on the complete historical log rather than estimates based only on the current window.
Notes:
- The plugin runs with the permissions of the current DSH process. Please review the source code and MIT license before installation.
- Only for the web platform (
dsh.client.platformiswebinpackage.json). - The community directory SkillHub is an independent ecosystem site with no official affiliation with DeepSeek / High-Flyer; this plugin has 1 star on GitHub (based on directory clues).
- Node development environment requires
>=22(seepackage.jsonengines).
Conclusion¶
dsh-simple-tps places per-turn TTFT and tok/s into the chat action row you’re already looking at, and aligns with persistent log semantics using host projections to prevent historical turns from degrading after refresh. For installation or issues, visit the SkillHub directory page and GitHub repository.