Real-time TPS: Add an Output Speed Badge to DSH Desktop Sessions

Introduction

When running local models or cloud APIs in DSH Desktop, checking the current generation speed typically requires switching to another view to see the usage panel or waiting for a full round to end to calculate the average. This plugin displays real-time tok/s below the input box: it refreshes continuously during generation, provides the average for the current round after completion, and clicking it opens a panel to view the speed line chart and round statistics.

What is this

“Real-time TPS” (package name @local/dsh-live-tps, repo 1207627875/dsh-live-tps) is maintained by 1207627875. It is a DSH Desktop client plugin mounted at the dock position of the session input box. It reads session stream events; both local models and cloud APIs use the same stream mechanism, so no distinction of provider is needed. The directory is categorized as “Client”, currently 0 stars.

Core Features

The badge displays four types of text based on status:

Status Display
Generating Real-time 71.6 tok/s, refreshes every 200ms, taking a rolling window of the last 3 seconds
Waiting for first token Waiting for first token 0.4s
Round ended Average for this round 70.8 tok/s
Idle TPS, displays the last average when there is no data

Clicking the badge expands a floating panel, containing:

  • Large numbers for real-time / average speed
  • Speed line chart for the recent period
  • Output tokens, first token latency, and time taken for this round (also displays model name if available)
  • Collapse to return to a small badge; Collapse to Icon to leave only a 22px gauge icon; clicking the icon again re-expands

The expand mode is saved in the browser’s localStorage under dsh.live-tps.mode and is not lost after refresh.

Installation and Enablement

The plugin is distributed exclusively via GitHub and does not require npm. After installation, you must completely exit and reopen DSH Desktop: the client bundle is only loaded at startup, so simply refreshing the page is ineffective. When installing from the GitHub address, pnpm will invoke the local git; if the target machine does not have git, download the zip from the Release, unzip it, and install it using Method 3 with a local directory.

Method 1: Desktop Add (Recommended)

  1. Open DSH Desktop → Left side “Plugins” → “+ Add Plugin”
  2. Fill the repository address in the input box:
https://github.com/1207627875/dsh-live-tps
  1. Click “Install” and wait for “Installed” to appear
  2. In “Installed Plugins”, confirm that the switch for “Real-time TPS” is turned on
  3. Completely exit and reopen DSH Desktop (close the window and open it again, do not refresh the page)
  4. Open any session, and a TPS badge should appear below the input box

Method 2: Send prompt to DSH Agent

The README provides a copy-pasteable installation prompt for the target machine’s DSH Agent to prioritize using install_bundle from plugin_manager (target filled with the GitHub address above) and to check the package.json of the desktop profile to confirm that dsh.profile.bundles contains @local/dsh-live-tps. The original text can be found in PROMPT.zh.md.

Method 3: Local directory / Source code

If you have a CLI deployment, you can install it directly into the profile:

dsh plugin --profile desktop add "D:\path\to\dsh-live-tps"

The Desktop profile is managed by Electron, so Method 1 is preferred.

Typical Usage

After installation and restart, verify in the following order:

  1. Open any session and confirm the TPS badge appears below the input box
  2. Send a short message; during generation it will display “Real-time xx tok/s”
  3. After generation ends, it will display “Average for this round xx tok/s”
  4. Click the badge to verify the line chart, first token, output tokens, and time taken for this round
  5. Try “Collapse” and “Collapse to Icon”

Data Source and Accuracy

The plugin subscribes to ctx.sessions.binding(sessionId).eventSource:

  • text-delta / reasoning-delta / tool-call-delta from assistant/live-chunk are used for real-time estimation
  • assistant/message / usage chunks provide the final outputTokens
  • turn/start / turn/end are responsible for resetting and cleanup

Real-time values are estimated via streaming chunks, while the final usage is based on the model’s response; there may be a discrepancy of a few tokens.

Compatibility

  • Tested Environment: DSH Desktop 0.2.1-rc.5 (Windows)
  • No third-party runtime dependencies; React / ReactDOM are provided by DSH
  • The dependent client APIs are @deepseek-ai/dsh-client-ui-conversation and @deepseek-ai/dsh-api-session-controller from dsh.client.inject, mounted at conversation.composer.dock

Directory Structure

File Purpose
client.js All capabilities: dock registration, event subscription, TPS calculation, panel UI
cordis.patch.yml Inserts the live-tps row
index.js Host-side empty plugin (bundle requires a single Host entry)
locale/zh.json / en.json Plugin page title, description, and UI copy
icon.svg Plugin icon
docs/*.png Dark / Light mode screenshots
INSTALL.zh.md Installation instructions and troubleshooting
PROMPT.zh.md Copy-pasteable installation prompt

Suitable Scenarios and Notes

Suitable for DSH developers who want to see output speed directly in the session: paying attention to tok/s and first token latency when running local models or calling cloud APIs.

Notes:

  • The plugin runs with the permissions of the current DSH process; you should review the source code (client.js contains all capabilities) and the license (MIT) before installing
  • After installation, DSH Desktop must be fully restarted; simply refreshing the page will not load the client bundle
  • Real-time values are just streaming estimates and may differ slightly from the final usage
  • The plugin is maintained by an individual, currently 0 stars, version 0.1.0, and a private package; the supported range is based on the tested environment mentioned above

Uninstall

  1. Turn off the switch for “Real-time TPS” in “Installed Plugins” on the plugin page
  2. Remove @local/dsh-live-tps from dsh.profile.bundles in the desktop profile’s package.json (dependencies can be left or removed)
  3. Restart DSH

Summary

Real-time TPS integrates speed display below the input box, eliminating the need for separate panels or waiting for a round to end. The directory page is at https://www.skillhub.cn/plugins/1207627875/dsh-live-tps, and the source code is at https://github.com/1207627875/dsh-live-tps.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye