Preface¶
One of the core philosophies of the DeepSeek Harness (DSH) is that “everything is a plugin.” When running agents in practice, a common issue is that when multiple models, multiple providers, main sessions, and subagent sessions are mixed together, token usage, cache hit rates, and per-session consumption are scattered across session logs, making it difficult to get a clear overview at a glance.
dsh-usage-panel is a DSH plugin that provides a Token usage panel in the “Usage Statistics” section of the web GUI’s settings page, allowing you to view cumulative usage, time trends, model distribution, provider distribution, and high-token sessions. Below, we introduce its features, installation method, and usage considerations.
Plugin Positioning¶
The repository for dsh-usage-panel is located at AlfredChaos/dsh-usage-panel and is licensed under MIT.
It is designed for users of the DSH web profile, displaying Token usage KPIs, a six-month activity contribution heatmap, stacked bar charts by model, and model donut charts on the settings page. The data comes from Host projection aggregation and read-only recomputation of session logs; the plugin does not write data back to session logs.
Core Features¶
Cumulative Usage and Cache Hit Rate¶
The cumulative total usage includes:
- Billed input tokens;
- Billed output tokens;
- Session count;
- Most frequently used model share.
The cache hit rate is displayed using the following formula:
cache read ÷ (uncached input + cache read + cache write)
Activity Heatmap and Daily Trends¶
The six-month activity heatmap uses a GitHub-style contribution layout, bucketed by UTC day.
The daily bar chart stacked by model can be toggled between the last 7, 14, and 30 days to observe token usage changes at the model level.
Session, Provider, and Model Distribution¶
The panel lists the Top 10 sessions by token usage and labels each as main or subagent.
When multi-provider routing is present, a horizontal bar chart of token usage by provider is displayed.
The model donut chart shows model share, and lists the Top 5 models along with the cache hit rate for each model.
Export and Refresh¶
The plugin supports exporting:
- Full JSON;
- Daily CSV;
- Per-model CSV.
CSV exports include protection against formula injection and are output according to RFC 4180 with a UTF-8 BOM.
The plugin begins its initial scan after loading. The payload freshness period is 10 minutes; expired payloads are marked with a stale flag and refreshed in the background. The browser retains the last successful payload in localStorage.
Installation and Activation¶
First, install the plugin, then restart the DSH web profile, and finally open the settings page.
Install from npm:
dsh plugin --profile web add dsh-usage-panel
You can also install from GitHub or a local directory:
dsh plugin --profile web add github:AlfredChaos/dsh-usage-panel
dsh plugin --profile web add ./dsh-usage-panel
After installation, restart the DSH web profile:
dsh --profile web
Then open Settings → Usage (in the Chinese interface, it is labeled “消耗统计”).
The npm package provides pre-built lib/ files and has no install scripts. This plugin is developed for DeepSeek Harness 0.1.0-rc.6, with peerDependencies including:
"@deepseek-ai/cordis": "^4.0.1",
"react": "^18.3.1"
If you need to remove it later:
dsh plugin --profile web remove dsh-usage-panel
Typical Usage¶
-
After installation, open “Usage Statistics” and first check the cumulative total usage, cache hit rate, and the most frequently used model share.
-
In the daily bar chart, switch between the last 7, 14, and 30 days to observe token usage changes at the model level.
-
Check the Top 10 sessions to confirm whether high-token sessions are
mainorsubagent. -
If you are using multiple providers, view the horizontal provider bar chart to confirm token distribution.
-
When archiving or offline analysis is needed, export the full JSON, daily CSV, and per-model CSV.
Applicable Scenarios and Considerations¶
Suitable for:
- Developers using the DSH web profile;
- Users who need to observe token consumption under multi-model and multi-provider routing;
- Operations personnel or engineers who need to check cache hit rates, model share, and high-consumption sessions.
Notes:
- The plugin runs with the permissions of the current
dshprocess; review the source code and license before installation. - Statistical day buckets and exports use UTC calendar days.
- The plugin performs read-only aggregation and does not write data back to session logs.
- The payload freshness period is 10 minutes; expired payloads are marked with a
staleflag and refreshed in the background.
Conclusion¶
The value of dsh-usage-panel lies in consolidating token usage, cache hit rates, and model distribution scattered across session logs into a visual panel on the settings page, making it easy to quickly identify high-consumption sessions and model differences while running DSH agents.
Reference links:
- GitHub:
https://github.com/AlfredChaos/dsh-usage-panel - Community directory page (independent site, no official affiliation with DeepSeek / High-Flyer):
https://www.skillhub.cn/plugins/AlfredChaos/dsh-usage-panel