Introduction¶
When running conversations and agents with DeepSeek Harness (DSH), token consumption is often scattered across multiple calls, retries, and cache reads/writes. Although status information is available next to the input box, checking “how much was used per hour today,” “the distribution across models,” or “whether the cache hit rate is stable” over a longer timescale typically requires digging through local sessions or relying on other panels. The community plugin dsh-clear-usage (maintainer: xgxx666) centralizes the display of real usage from settled calls under Settings → Usage Stats. It preserves the original DSH input box status bar and details popup, without replacing the interface below the input box.
What is this¶
dsh-clear-usage is a Web Client plugin for DSH (dsh.client.platform is web in package.json), currently at version 0.1.0 under the MIT license. It reads usage from local DSH session records and performs statistics and display only: it shows Tokens and call counts, but does not estimate costs or display monetary amounts. The plugin only registers a settings page; input box usage, speed, and click-to-view details remain provided by the original DSH.
Similar to the existing dsh-usage-panel in the directory, both analyze local historical usage within the settings page, resulting in some functional overlap. This plugin focuses on DSH’s native cache hit rate, hourly activity for today, and Token composition (uncached input, cached read, output, cached write), while retaining the original input box status bar.
Core Features¶
Access to Usage Statistics¶
After installation, open Settings → Usage Stats to view usage for Today, Month, All, and Custom Date Range. For a custom range, select the start and end dates and click “Query”; the range includes both the start and end dates.
Today: 24-Hour Bar Chart and Composition¶
The “Today” page displays a 24-hour usage bar chart. Hovering or keyboard focusing reveals the Tokens and call counts for each hour; a composition bar displays uncached input, cached read, and output, and will also show cached write if present. Hourly distribution is archived based on the call settlement time in local time; usage from calls spanning across hours is not averaged or split into multiple hours.
Month, All, and Custom: Heatmap and Model Distribution¶
The Month, All, and Custom ranges utilize a compact heatmap; opening or switching time ranges automatically locates the most recent date. Hovering displays a two-line dark tooltip with the date and abbreviated Token count.
Model usage is displayed in a centered ring chart (donut chart): the center shows total Tokens, and the color legend below displays the usage, type, and proportion of each model. Model usage defaults to the original model name; expanding “Model Type” at the bottom of the page allows setting display names. Labels without a selected type are clickable to jump to the local/API options for that model. Types and display names are saved automatically and only affect filtering and display; after deletion, they are hidden from the admin list, model usage list, and ring chart, and the ring total and proportions are recalculated based on currently displayed models. The historical total usage and activity charts at the top of the page retain the full record. Deleting a model does not remove DSH model configurations or session logs; it can be restored in “Deleted Models”.
Data Scope and Cache Hit Rate¶
Tokens come from real usage of settled calls. Retries are accumulated separately; updates to the same call overwrite old samples; thinking Tokens are already included in the output and are not double-counted. Historical statistics exclude inherited prefixes from session branches to prevent double counting. If cache is not reported or records are incomplete, clear notifications are provided.
The cache hit rate follows the official formula:
Cached Read ÷ (Uncached Input + Cached Read + Cached Write)
If the official source does not provide cached read values, they are treated as native zero; the plugin does not guess cached Tokens based on KV memory reuse in the inference engine.
Both local and API models only display Tokens; no unit price configuration is required.
Performance and Refresh¶
The first read of history processes up to four sessions in parallel and reuses existing statistics based on session versions. Reopening the page immediately displays a cached snapshot from the current application run, while updating in the background and marking “Updating Usage”; if a read fails, existing data is preserved. Switching model types, time ranges, or dates filters immediately within the interface without rescanning history; clicking refresh also fetches the latest usage.
Installation and Enablement¶
Applicable to DSH Web profile version 0.2.0-rc.2 and higher compatible versions. The Node.js runtime range matches the plugin’s engines: ^22.19.0 || >=24.0.0.
Execute the installation command provided in the README in your terminal:
dsh plugin --profile web add github:xgxx666/dsh-clear-usage
The plugin page in the DSH desktop version can also select this project directory for local installation (directory link). Keep the project directory; moving or deleting it will affect DSH loading. This package does not include dependency installation scripts and requires no API keys.
Typical Usage¶
- Install via the command above and ensure your DSH version using the Web profile meets the requirements.
- Open Settings → Usage Stats, start by viewing the hourly bar chart and Token composition for Today, and check if cache reads/writes behave as expected.
- Switch to Month or All to browse activity density via the heatmap; hover to view abbreviated Tokens for a single day.
- When a fixed interval is needed, select the start and end dates in Custom and click “Query”.
- Set display names or types for models in “Model Type” at the bottom of the page to facilitate ring chart filtering; accidentally deleted items can be restored in “Deleted Models”.
Model classifications are saved in $DSH_HOME/dsh-clear-usage/models.json. Old fields with existing configurations are retained for compatibility with historical versions; the page no longer provides unit price inputs or amount displays.
Use Cases and Notes¶
Who is it for: Web-based users who want to view local Token consumption, cache hit rates, and distributions by hour and model within DSH using unified metrics, and do not require cost estimation.
Privacy and Data: Usage is read from local DSH session records; message content never leaves DSH. The plugin does not read credentials, call vendor APIs, or upload statistics.
Security Notice: The plugin runs with the permissions of the current DSH process. Before installation, you should read the source code and MIT license of the GitHub Repository to ensure compliance with your environment policies. The community directory SkillHub Plugin Page has no official affiliation with DeepSeek or High-Flyer. The DSH ecosystem follows an “everything is a plugin” extension approach.
Modifications to the interface usually support hot-reloading; however, modifying host statistics-related code (such as index.js, lib/usage.js) requires a normal restart of DSH. Developers can run npm test and npm run check in the plugin directory for basic checks.
Summary¶
dsh-clear-usage provides real Token statistics based on local sessions, official cache hit rates, and hourly activity plus model ring charts within the settings page, without altering the original input box status bar. If you are already using the DSH Web profile with a version no lower than 0.2.0-rc.2, you can install it via the official command and view it in Settings.
- Community Directory: https://www.skillhub.cn/plugins/xgxx666/dsh-clear-usage
- Source Code & Documentation: https://github.com/xgxx666/dsh-clear-usage