Preface¶
In the DeepSeek Harness (DSH) Web UI, session statistics typically require checking cache hit rates, token usage, and costs. dsh-gauge is a plugin designed for the DSH Web UI, providing more detailed display and estimation of these metrics. Below introduces its features, installation, configuration, and considerations.
What Is This¶
dsh-gauge is a DSH plugin from the noone89A/dsh-gauge repository, licensed under MIT. It targets the DeepSeek Harness Web UI, providing precise cache hit rates, token usage bucketing, context occupancy, session cost estimation, and peak/off-peak status display. It is suitable for developers who need to verify usage and cost estimates at the session level.
Core Features¶
- Precise Cache Hit Rate: Calculated as
cacheRead / (cacheRead + uncached + cacheWrite), with configurable decimal places. - Bucketed Token Details: Displays hit/miss input tokens and output tokens; automatically hides write buckets when the count is 0.
- Session Cost Estimation and Price Adjustment Comparison: Estimated based on actual usage × model unit price, automatically following DeepSeek official pricing adjustments.
- Peak/Off-Peak Pricing by Request Time: Each assistant message applies peak/off-peak rates based on its own timestamp.
- Peak Hour Badge: Displays peak/off-peak status at the end of the statistics line.
- Usage Panel: Shows model, hit rate, billed input, bucket totals, context occupancy, and cost estimates.
- Two-Line Statistics: The first line retains official session metrics, while the second line displays the plugin’s precise usage.
- Bilingual and Currency Adaptation: When the UI language is English, text switches to English and costs are estimated in USD; otherwise, CNY is used.
Installation and Activation¶
It is recommended to install via the dsh plugin command:
dsh plugin --profile web add dsh-gauge
This command adds the plugin to the Web profile. After installation, restart the Web UI:
dsh web
After the steps above, the statistics lines and usage panel provided by the plugin will appear in the DSH Web UI.
For manual installation, you can first perform the following two steps:
cd ~/.dsh/profiles/web
npm install dsh-gauge
Then add "dsh-gauge" to dsh.profile.bundles in profiles/web/package.json.
For local development or debugging, you can also install from source:
pnpm add file:C:/Object/dsh-plugin/dsh-gauge
After modifying the source code, run:
npm run build
to apply changes.
Configuration¶
To adjust settings, navigate to:
Settings → Plugins → Configurable Plugins
Adjust the configuration in the dsh-gauge card; except for replaceNativeStatsLine, changes take effect immediately after saving.
You can also directly edit:
~/.dsh/profiles/web/cordis.patch.yml
For example:
# ~/.dsh/profiles/web/cordis.patch.yml
- id: gauge
config:
showPrice: true
Note that patch entries are flat {id, ...} loader entries; writing - update: will be rejected with an error.
If you modify replaceNativeStatsLine or edit cordis.patch.yml, you need to restart:
dsh web
To display the configuration card, gauge needs to be added to the WEB_SETTINGS_NAMESPACES allowlist of dsh-host-apiproxy; not adding it does not affect core functionality.
Applicable Scenarios and Considerations¶
Suitable for those who need to view precise hit rates, bucketed tokens, context occupancy, and cost estimates in the DSH Web UI.
Notes:
- Costs are estimates; the official billing statement takes precedence.
- The plugin runs with the current
dshprocess permissions; review the source code and license before installation. The repository uses the MIT license, and the source code can be viewed at:
https://github.com/noone89A/dsh-gauge
- The DSH plugin ecosystem emphasizes “everything is a plugin”; the community directory is an independent site with no official affiliation to DeepSeek / High-Flyer.
dsh-gaugeshould be treated as a community plugin.
Conclusion¶
dsh-gauge integrates hit rates, token bucketing, context occupancy, and cost estimates into session statistics and panels in the DSH Web UI, making it easier to verify session usage. GitHub repository:
https://github.com/noone89A/dsh-gauge
To find it in the directory, search for the plugin name dsh-gauge.