Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture that allows developers to extend its capabilities. In model inference debugging or performance monitoring scenarios, directly observing real-time output speed (tok/s) and per-step detailed metrics (such as TTFT and cumulative tokens) helps identify performance bottlenecks. dsh-token-speed is a plugin that runs on the DSH web client. It visualizes speed data through a draggable circular gauge.
Core Features¶
The plugin is anchored in the bottom-right corner of the web GUI by default and provides the following capabilities:
- Real-time Speed Display: During generation, the gauge needle and central number rise in real time with streamed output. The speed is estimated from the output text volume × the measured chars/token ratio.
- Per-Step Precise Calibration: After each step completes, it calculates the actual tok/s using the provider-reported
usage.outputTokensandtiming(firstToken → completed), then uses this to recalibrate the chars/token ratio. - Details Panel: Click the gauge to expand it and view real-time speed, precise data for the previous step, output tokens, TTFT, and cumulative output within the current window.
- Status Indication: It indicates generating, tool executing, or idle state through colors or status markers.
- Draggable and Persistent Position: It supports press-and-drag repositioning, and the position is remembered in
localStorage. - Browser-Only: It does not modify host state and only reads session data as a read-only subscriber.
Installation and Enablement¶
The plugin is installed into a DSH profile via a local link. Using the desktop profile as an example, the steps are as follows:
- Create or clone
dsh-token-speedin a local repository, and add the dependency to the DSH profile’spackage.json:
// ~/.dsh/profiles/desktop/package.json
{
"dependencies": {
"dsh-token-speed": "link:/Users/<you>/Documents/DSH/dsh-token-speed"
}
}
- Enter the profile directory and install dependencies:
cd ~/.dsh/profiles/desktop
pnpm install
- Activation Rules:
insertlines incordis.patch.ymlare hot-reloaded by the profile’s HMR watcher, so no restart is usually required after changes.- If modifying the source code of
lib/client.js, a full page refresh (Cmd+R) is required for changes to take effect.
Typical Usage¶
After installation, the plugin is automatically mounted in the bottom-right corner of the interface. During model generation, observe the changes in the gauge needle and number; click the gauge to view the specific speed and token statistics for the previous step; press and drag the gauge to move it to any position on the screen.
Architecture and Considerations¶
The plugin’s data sources and scope constraints are key implementation details:
- Data Sources: The plugin does not use
useChatoruseProjectionin thesessionscope, nor can it read the session snapshot in therootscope (this scope only contains.subagent/.queue/.value). The correct entry point is to usectx.uiConversation.binding(sessionId).target('chat')to retrieve the data.legacy.partial: used as the real-time speed source; it contains in-progress{turn, step, blocks}.legacy.nodes: used as the precise tok/s source; it containsusage.outputTokensandtimingfor settled nodes.legacy.runningCalls: non-empty indicates that a tool call is executing.
- Dependency Services: It depends on
slots(slot registration) anduiConversation(session chat data). - Ecosystem Background: This plugin belongs to the DSH ecosystem and is maintained by the community. The directory page and GitHub link are provided at the end of this document.
Conclusion¶
dsh-token-speed provides DSH users with a lightweight inference speed monitoring solution through a circular gauge and details panel. It leverages browser-side capabilities and, without altering host logic, provides precise step-by-step performance data.