dsh-token-gauge: Real-time Token Dashboard on the DSH Web Interface

Introduction

When running long sessions in DeepSeek Harness (DSH), context tokens accumulate continuously, and decoding speed fluctuates with backend load. Although the Web client distributes fields such as tokenUsage and sessionStats via session projections, the default interface does not render these numbers as a “glanceable”仪表 (dashboard). If you want to view cumulative usage, tok/s, and estimated costs during the conversation without altering session logic or injecting extra content into the model side, you need a read-only frontend overlay plugin.

Below is an introduction to the community plugin dsh-token-gauge (npm package @stone100010/dsh-token-gauge), maintained by stone100010 and categorized as “Model Inference” in the SkillHub directory. It mounts three draggable gauges on the DSH Web GUI. All data comes from existing client-side projections; it does not subscribe to new events or register tools.

What is this

dsh-token-gauge is a client plugin for the DeepSeek Harness Web configuration: it floats above the application to display Token usage, decoding throughput, and estimated costs. It supports draggable positioning, resizing, and remembers the layout within the browser.

The plugin registers to the shell.overlay slot declared by @deepseek-ai/dsh-client-ui-layout (full-frame, click-through), sitting alongside built-in overlay entries without blocking underlying interface operations. In terms of implementation, it adds no session events, tools, or model-visible content; it is a purely read-only view that does not alter conversation behavior.

The development and testing target version is DSH 0.1.5-rc.2. The plugin relies on ctx.sessions, ctx.slots, and four projection key names. If the upstream renames these interfaces, the plugin requires synchronized updates.

Core Features

What the three dials represent

The README uses a table to explain the scales and meanings, summarized below:

Dial Scale Meaning
Token Usage (Left) 0 – 300M Cumulative tokens for the entire session log; the pointer entering the amber zone usually indicates “input context far exceeds output,” meaning the session may have surpassed the model’s comfort zone.
tok/s (Center, Max) 0 – 500 Decoding throughput: prioritizes the “new output tokens per second” observed by the page, falling back to the session’s recorded average when idle; jumping readings often correspond to backend instability.
Total Cost (Right) 0 – $12 Estimated session cost based on reference unit prices, displayed relative to a budget scale.

Each dial features green / amber / red warning zones, a pointer, large numerals, and fine-grained details below (such as In/Out breakdown, session averages, budget, etc.). Data sources are existing Web client projections like tokenUsage, contextPressure, contextBreakdown, and sessionStats.

Panel Interaction and Diagnostic Row

After installation and a hard refresh, the panel appears in the bottom right corner by default. Drag the title bar to move, drag the bottom-right corner to resize, and use the title bar controls to collapse; position, size, and collapse state are persisted per browser.

The route + session reading in the title bar (implementation detail A4 diagnostic row) indicates the resolution path (binding, scope, or unresolved), the currently read session id, and the output token count. If numbers don’t match, check this row first to confirm the data source.

Cost Scale is an Estimate

The cost dial is marked as estimated (est.). The README explains: for example, if deepseek-v4.1-flash is not in the installed DSH model catalog, DSH will not calculate a cost projection for it; the plugin defaults PRICES to align with the reference prices of the deepseek family in the catalog. To use the $12 scale for budget comparison, you should fill in the gateway’s actual “per million token” unit price in the constants at the top of lib/client.js.

Example of adjustable constants (excerpt from README):

const SCALE_TOKENS = 300e6;   // left dial maximum
const SCALE_RATE   = 500;     // centre dial maximum
const SCALE_COST   = 12;      // right dial maximum, also the budget
const ZONES = { tokens: [0.5, 0.8], rate: [0.6, 0.84], cost: [0.5, 0.8] }; // amber, red
const PRICES = { uncachedInput: 0.14, cacheRead: 0.0028, cacheWrite: 0.14, output: 0.28 }; // USD / M

After modification, the Web client bundle needs to be reloaded according to your deployment method (usually restarting dsh web and hard refreshing the page).

Environment and Requirements

  • Must run DSH with the web profile, e.g., dsh web or npx @deepseek-ai/dsh web.
  • The package engines requires Node >= 22 (see package.json).
  • When installing via the profile plugin manager, pnpm must be available on the system PATH.

Installation and Activation

Execute in a shell where dsh and pnpm are configured:

dsh plugin --profile web add @stone100010/dsh-token-gauge

This is the official installation command provided by the README, performing link and registration for the web profile.

When pnpm or dsh is not on PATH

The README provides a setup.sh within the repository: it locates dsh itself and completes the equivalent link and registration. Typical steps are to enter the cloned directory and run ./setup.sh install, ./setup.sh verify, and use ./restart-and-verify.sh to restart and confirm the plugin is loaded if necessary. If installing solely from npm, the tarball also includes setup.sh, but restart-and-verify.sh assumes a cloned repository.

Regardless of the method, after opening the token-bearing URL printed by the server, hard refresh once (Ctrl+Shift+R); the client bundle is injected during page load.

Typical Usage

  1. Start DSH Web: dsh web or npx @deepseek-ai/dsh web.
  2. Install @stone100010/dsh-token-gauge as described in the previous section, and restart the web process (if required by docs or scripts).
  3. Open the Web UI in a browser, hard refresh, and confirm the gauge panel appears in the bottom right.
  4. Start or switch sessions, observing the left dial for cumulative tokens, the center for tok/s, and the right for estimated costs; check the title bar diagnostic row for route and session id when troubleshooting data.
  5. If using models with non-default catalog pricing or self-hosted gateways, edit PRICES (and SCALE_*, ZONES if necessary) in lib/client.js, then restart and refresh.

Uninstall example:

dsh plugin --profile web remove @stone100010/dsh-token-gauge

Or run ./setup.sh uninstall in the cloned directory. Afterwards, restart dsh web.

Use Cases and Notes

Who it is for: Developers who frequently debug long contexts in DSH Web, compare decoding stability across different backends, or need to check token budgets locally. It is categorized as an observability enhancement related to “Model Inference,” rather than a toolchain for modifying models or prompts.

Permissions and Security: The plugin loads with the current DSH process and user profile, possessing the same client access surface as that Web session (reading existing projections). Before installation, you should review the GitHub repository source code and the MIT license to ensure compliance; SkillHub is a community directory site and has no official affiliation with DeepSeek / High-Flyer.

Version: The version in current npm data is 0.1.1; the GitHub repository shows approximately 1 star. Do not assume full compatibility with DSH versions not yet declared in the README.

Development Side: The main client logic is in the hand-authored lib/client.js (ModuleLoader bundle, no build step). The repository’s node test/harness.mjs provides 61 checks covering registration, projection subscription, dragging, and persistence behaviors.

Conclusion

dsh-token-gauge projects existing token and session statistics from DSH Web into three draggable gauges. It is read-only, does not touch the session protocol, and is suitable for quickly sensing context pressure, decoding speed, and estimated costs during development and debugging. Directory and Source Code:

  • SkillHub Directory Page: https://www.skillhub.cn/plugins/stone100010/dsh-token-gauge
  • GitHub: https://github.com/stone100010/dsh-token-gauge
羽毛球分组比赛记分
小程序二维码

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

Xiaoye