Introduction

The Web UI for DeepSeek Harness (DSH) provides basic conversation statistics. The dsh-ui-cost plugin takes over this line of data, providing developers with real-time token usage statistics and estimated costs based on official pricing.

Plugin Introduction

This is a pure DSH browser plugin maintained by uaapple, and it follows the MIT license. It does not modify the ui-conversation core code, so even if DSH or DSH Desktop is upgraded and the default core is restored, the plugin remains compatible.

The plugin is registered in the conversation.composer.dock cell as a shadow entry for the core statistics entry (id: 'stats'), overriding the entire line of data.

Core Features

The plugin takes over the following data in the statistics line:

  • Conversation information: Turn and step counts.
  • Performance metrics: Wall time for LLM and tools, TTFT (time to first token) and decoding throughput.
  • Cache status: Cache-hit share.
  • Billing data: Billed token counts and estimated costs based on official pricing.

Cost calculation logic:
The plugin prices the durable tokenUsage projection based on the current model selection in the session. The calculation includes uncached input, cache writes (based on the cache-miss input rate), cache reads (based on the cache-hit rate), and output tokens.

Pricing and time periods:
Prices are sourced from the official Models & Pricing page (unit: CNY / 1M tokens). Rates automatically follow the officially announced peak/off-peak schedule: peak is 09:00–12:00 and 14:00–18:00 Beijing Time, and the non-peak rate is halved.

Installation and Activation

Install through the DSH command line:

dsh plugin --profile web add github:uaapple/dsh-ui-cost

To ensure reproducible installations, it is recommended to pin the command to a full commit SHA.

If the plugin package declares dsh.bundle, the command above will automatically mount the line. To mount it manually, you can write the following in the configuration:

- insert:
    - id: ui-cost
      name: dsh-ui-cost

Notes

  • Community plugin: This plugin is a community project and has no official affiliation with DeepSeek AI.
  • Stability: If the plugin crashes, the shadow cell is automatically retired, and the default statistics bar is displayed again.
  • Uninstallation: If the plugin is composed through cordis.yml, removing the composition restores the default statistics bar.
  • Runtime environment: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.