Introduction¶
Under DSH’s plugin architecture, the Web chat view can extend functionality through independent packages. If you are already using the DSH Web chat and want to view token usage for a specific, multiple, or all historical conversations on the same page (rather than just seeing fragmented details for individual messages), @az7627/dsh-token-usage provides a usage statistics drawer: a time-series stacked bar chart, along with a total count precise to the unit digit and a detailed breakdown per conversation.
What is this¶
- Plugin Name:
@az7627/dsh-token-usage - Maintainer:
az7627 - Positioning: DeepSeek Harness plugin for tracking token usage in the Web chat view
- License: MIT
- Version:
0.1.1is explicitly stated inpackage.json - Repository:
https://github.com/az7627/dsh-token-usage
Its core data comes from session log replay (via the /usage RPC channel), so you can view the data immediately after installing it for historical conversations.
Core Features¶
-
Entry Point: The “Usage Statistics” button at the right edge of the session header. Clicking it opens the drawer on the right.
-
Conversation Selection: Supports multi-selection. Defaults are “Current Conversation” / “Select All” / “Only Current”.
-
Time Granularity: 15 minutes / 1 hour / 1 day; Range: Last 7 days / Last 30 days / All.
-
Usage Buckets:
- Cached Input:
cacheReadTokens - Input:
inputTokens + cacheWriteTokens - Output:
outputTokens
- Cached Input:
-
Display: ECharts stacked bar chart, aligned to the local timezone calendar; tooltip precise to the unit digit; provides totals and conversation details.
Installation and Activation¶
First, execute the installation command. Here we use the npm package name with scope; the unscoped dsh-token-usage is already taken by someone else.
npx @deepseek-ai/dsh plugin --profile web add @az7627/dsh-token-usage
After installation, restart dsh web:
npx @deepseek-ai/dsh web
When updating, re-run the add command above; pnpm will install the latest version.
Uninstall:
npx @deepseek-ai/dsh plugin --profile web remove @az7627/dsh-token-usage
Typical Usage¶
After installing and restarting, open the DSH Web chat view and click “Usage Statistics” at the right edge of the session header. First, select the conversations to be counted, then select granularity and range, and then view the stacked bar chart, tooltip, totals, and details per conversation.
If you want to develop this plugin locally, you can use the absolute path of the current directory for installation:
npx @deepseek-ai/dsh plugin --profile web add <absolute path of current directory>
After modifying the source code, execute build, then restart dsh web:
pnpm run build
npx @deepseek-ai/dsh web
This step does not require re-running add.
Common commands for local development:
pnpm install
pnpm run build
pnpm test
Applicable Scenarios and Notes¶
Suitable for people who need to verify token usage in DSH Web: for example, viewing last 7 days / last 30 days / all historical conversations, comparing 15 min / 1 hour / 1 day granularity, verifying the three buckets (cached input, input, output), and the total precise to the unit digit.
Notes before installation:
- The plugin will load and run in the current dsh environment; you should check the source code and license before installing. The project license is MIT.
- Pay attention to the npm package name scope to avoid mistakenly installing one with an unscoped name.
- Dependency notes:
zodis runtime;echartsis bundled into the browser bundle. peerDependenciesincludes multiple@deepseek-ai/dsh-*packages, as well asreactandreact-dom ^18.2.0.- Type checking depends on the pre-built
lib/typesin thedeepseek-harnesssource tree in the same directory; this is a compile-time reference only, all runtime dependencies are provided by dsh installation.
Conclusion¶
The value of @az7627/dsh-token-usage is quite straightforward: displaying token usage in the DSH Web chat view broken down by time, conversation, and input/output, and you can view it immediately after installing the plugin for historical conversations.
Repository: https://github.com/az7627/dsh-token-usage.
Directory page: Verified sources do not provide a fixed URL; if found via the DSH plugin directory, please refer to what is actually displayed on the directory page. The DSH plugin directory is an independent community site and has no official affiliation with DeepSeek / Foxconn.