dsh-live-token-speed: Real-time tok/s in DSH Input Box Stats Bar

Introduction

When debugging model streaming output in the DSH Web GUI, the statistics bar at the bottom of the input box displays decoding speed. The built-in ActivityPill (from @deepseek-ai/dsh-client-ui-chat) uses decodeTokens / decodeMs, which is the entire session’s average decoding speed. After the conversation gets longer, this number hardly moves, making it difficult to determine if the model is fast or slow “at this moment”.

The following introduces the community client plugin dsh-live-token-speed (maintainer WeidongTech): It replaces the built-in implementation in conversation.composer.dock with the same cell id activity, changes the speed on the main interface to a real-time tok/s with a sliding window of about 2 seconds, and retains a comparison with the session average in the overlay.

What is this

Item Description
Name dsh-live-token-speed
Repository WeidongTech/dsh-live-token-speed
Category Client (dsh.client.platform: web)
License MIT
Current Version (package.json) v0.1.1

The Host side (index.js) is an empty implementation; all logic is in the browser-side client.js.

Three Types of Readings on the Interface

After the plugin replaces the activity in the dock, the behavior of the main bar and the overlay is as follows (from the README table):

State Stats Bar Display
Streaming output Real-time tok/s with the latest 2-second sliding window (refreshes approx 10Hz)
Just finished a step Average tok/s for that step
Idle / History Average for that step; open the overlay to see the session average

The overlay opened by clicking the statistics bar will show side-by-side: Real-time / Step Average / Session Average, as well as model time, tool time, and average TTFT.

How Real-time Speed is Calculated

The streaming phase is driven by legacy.partial in the snapshot (unsettled assistant step and its growing blocks) via assistant/live-chunk. The plugin’s general steps are:

  1. Accumulate text by token density during rendering: CJK is approx 1 char per token, others approx 4 chars per token (consistent with dsh-token-meter heuristics), and perform prefix incremental caching;
  2. Use requestAnimationFrame to write (timestamp, accumulated tokens) into a circular buffer;
  3. Take the earliest sample in the window as the baseline, Δtoken / Δt is the real-time speed; when no new tokens arrive, shift the window right, and the reading decays to 0;
  4. Zero out the cache when turn:step changes to avoid negative speeds across steps.

Installation and Enablement

Installation commands are based on the repository README. After installation, you need to restart DSH (the host assembles the plugin tree at startup, and only then does the client side load).

Local Development (Link Local Directory):

dsh plugin --profile desktop add "E:/随便玩玩dsh/live-token-speed"

Simply replace the path with your local cloned or copied plugin directory.

Multi-machine / Tablet (Pull from GitHub, no credentials needed for public repos):

# Install latest main
dsh plugin --profile <your profile> add github:WeidongTech/dsh-live-token-speed

# Or lock to a specific release version
dsh plugin --profile <your profile> add github:WeidongTech/dsh-live-token-speed#v0.1.1

Update:

dsh plugin --profile <your profile> update dsh-live-token-speed
# If pnpm doesn't resolve the new commit, run `add` once more

Uninstall:

dsh plugin --profile desktop remove dsh-live-token-speed

The README also states: When link:ing a local directory on the host, restarting DSH takes effect after changing the plugin; on the tablet side, you can bump the package.json version, push (optionally tag), and then run update.

Adjustable Parameters

Modify the constants at the top of client.js, and restart DSH to take effect:

Constant Default Meaning
WINDOW_MS 2000 Sliding window length; smaller is more responsive, larger is smoother
MIN_SPAN_MS 150 Minimum window span; if insufficient, no data is shown initially
EMIT_MS 100 Refresh throttling (10Hz)
CHARS_PER_TOKEN 4 Density of non-CJK text

Typical Usage

  1. Add the plugin for the corresponding profile using the commands above and restart DSH.
  2. Start a conversation with streaming assistant output and observe the statistics bar at the bottom of the dock: during output, you should see the real-time tok/s growing with the current block, rather than the long-stagnant session average.
  3. When streaming ends or when reviewing historical steps, the main bar shows the average for that step; click the statistics bar to open the overlay when you need to compare with the session-level average.
  4. If the fluctuation feels too sharp or too slow, modify WINDOW_MS / EMIT_MS in the local plugin directory and restart to verify.

Use Cases and Notes

Suitable for: Developers who frequently monitor streaming quality, tune models, or compare different configurations in the DSH Web client and need to see the output rhythm of “this current segment”.

Notes:

  • Real-time tok/s is estimated via text density heuristics, not server-side precise token counting; it may not align with billing or official metrics.
  • The plugin is a community work within the DSH “everything is a plugin” ecosystem. The directory listing SkillHub entry and GitHub are public sources, with no official app store affiliation with DeepSeek / Huansuan.
  • The client plugin runs within the current DSH process and browser environment. Please review the source code and MIT license yourself before installation to decide whether to use it on your local machine or internal network.

Repository Structure (for Troubleshooting)

live-token-speed/
├── package.json        # dsh.bundle.patch + dsh.client
├── cordis.patch.yml    # insert a line to mount the plugin into profile
├── index.js            # Host side: empty implementation
└── client.js           # Client side: replaces activity cell

Conclusion

dsh-live-token-speed does not change the DSH core, it only replaces the activity cell in the composer dock: during streaming, it provides a responsive tok/s using a 2-second window, and retains the step and session averages in the overlay for easy comparison with the built-in “full-session average”.

  • Directory page: https://www.skillhub.cn/plugins/WeidongTech/dsh-live-token-speed
  • GitHub: https://github.com/WeidongTech/dsh-live-token-speed
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye