Preface¶
In the DeepSeek Harness (DSH) Web interface, developers often need to track the token usage and rate of the current session, but there is no intuitive, aggregated real-time cost calculation. The dsh-ui-cost-meter plugin reads Harness token logs and, combined with configured rates, displays the total cost of the current session below the composer.
What It Is¶
This is a Web GUI client plugin maintained by user yuu1111. Its core purpose is to add a “pill” component that displays the total cost of the current session next to the existing statistics. The value is calculated based on the provider usage already recorded by Harness, multiplied by the configured per-million-token rate.
Core Features¶
- Real-Time Cost Display: Shows the cost incurred so far in the current session.
- Cost Pill: Displayed as a pill below the composer, alongside the built-in step/token statistics.
- Rate-Based Pricing: The cost is calculated by multiplying the provider usage already recorded by Harness with the configured per-million-token rate.
- Undescribed Token Tracking: If a route has no configured rate, its tokens are marked as “undescribed” (with a
+at the end) and listed in the panel. - Cache Tracking: Supports tracking cache hits, reads, and writes.
Installation and Enabling¶
Install the plugin using the official CLI:
dsh plugin --profile web add dsh-ui-cost-meter
Configuration¶
Specify the currency symbol and rates in the plugin configuration. Rates are in units of per million tokens. Each route (provider/model) can only have one rate configured. You need to replace the rates in the example with actual paid rates.
- id: cost-meter
name: dsh-ui-cost-meter
config:
symbol: '$'
rates:
<provider>/<model>:
input: 0.15
output: 0.6
cacheRead: 0.003
cacheWrite: 0
Notes¶
- Not Billing Records: The displayed values are Harness token statistics multiplied by the rates you configured, not the provider’s formal billing statement. Incorrect rate configuration will lead to incorrect display.
- Single Rate per Route: Each route can only have one rate. If the route price changes during a session, ensure the configuration reflects the current actual paid price.
- Currency Customization: Customize the currency symbol via the
symbolfield. The plugin does not perform cross-currency conversion.
Summary¶
dsh-ui-cost-meter adds real-time cost tracking capability to the DSH Web interface. Developers can configure the plugin with actual paid rates to quickly evaluate the cost of a single session during development. For more details, see the project directory or source code repository.
- GitHub: https://github.com/yuu1111/dsh-ui-cost-meter