DeepSeek Harness (DSH) adopts a plugin-based architecture. For developers who require precise cost control and model optimization, real-time monitoring of token usage is a core requirement. The dsh-token-usage-dashboard plugin provides a statistics panel in the DSH Web UI similar to GitHub’s Activity Heatmap. It aggregates key metrics from session logs, helping you quickly identify high-consumption stages.
Feature Overview¶
This plugin includes the following core modules:
- Five statistics cards: display total token usage, single-day peak, longest session, current consecutive usage days, and all-time longest consecutive usage days. Values automatically scale to fit a single line.
- GitHub-style heatmap: a scrollable 53-column by 7-row grid, supporting switching between “Daily” and “Weekly” views (in Weekly view, each week is represented by 7 cells, starting from the bottom). Hover over a cell to view the token count and request count for that specific date.
- Insights panel: aggregates total turns, LLM request count, active sessions, active days, cache hit rate, average tokens per turn, and average duration per turn.
- Model ranking: ranks the Top 5 favorite models by token usage and provides proportional bar charts for a clear visual representation.
- Data synchronization: supports real-time incremental updates, persists snapshots in the background, and quickly restores state after a restart.
Installation and Activation¶
Install the plugin using the official CLI:
dsh plugin --profile web add github:solstice621/dsh-token-usage-dashboard
After installation, restart the Web Profile to apply the plugin. Then open Settings → Stats in the DSH interface to view the dashboard. On first opening, the plugin scans historical session logs to initialize, after which real-time updates begin.
Typical Usage¶
- View statistics: see the five core metric cards and the heatmap overview on the dashboard home page.
- Switch views: click in the heatmap area to toggle between “Daily” and “Weekly” modes.
- Language adaptation: depending on the DSH interface language setting (Chinese or English), dashboard labels switch automatically.
Notes and Boundaries¶
Before use, note the following facts:
- Plugin format conflict: This plugin is available in “Bundle form” (recommended) and “Dynamic Plugin form” (toksta-5). Both register the settings block ID as
token-stats, so do not run them simultaneously. - Environment dependency: The
dsh plugincommand depends onpnpm. Ensure thatpnpmis in your system PATH (you can enable it withcorepack enable pnpm). - Data statistics rules:
- Only calls reported by the Adapter as having
usageare counted; title generation calls are excluded. - Model attribution information comes from the
request/headerof the session’s latest request. - If there is no usage today, the current consecutive usage day count is calculated up to yesterday.
- Only calls reported by the Adapter as having
- Style rendering: CSS injection is completed through built-in client-side styles, and the server-side pattern
ctx.get('styles')is not supported.
Conclusion¶
dsh-token-usage-dashboard is an effective tool for addressing token monitoring needs of DeepSeek Harness developers. It visually aggregates key data from session logs, reducing the time cost of manually inspecting logs. For more details and source code, visit the GitHub repository.