Introduction

When using DeepSeek Harness (DSH) for model development and debugging, cost control is an important part. Developers need a clear understanding of the estimated cost for a session or an individual turn. The dsh-cost-meter plugin provides this capability.

What Is This?

This is a DSH plugin maintained by guojinpeng. It displays cost estimates for sessions and completed turns, and supports price synchronization with models.dev, OpenRouter, and DeepInfra, as well as custom model unit prices.

Core Features

At its core, the plugin converts complex token usage into clear cost information.

  1. Cost display: Displays cost estimates for sessions and completed turns. The session panel categorizes entries by peak prices, off-peak prices, and fixed prices, listing the group totals for each model; the turn panel lists the four price details for each model group.
  2. Data filtering: Hides rows with zero cost and does not display peak or off-peak token counts.
  3. Grouped statistics: Groups the models used by provider; the list comes from DSH session history.
  4. Currency support: Supports USD or CNY for each model. Changing the currency converts all four rates and displays separate USD and CNY totals.
  5. Price sources: You can choose models.dev, openrouter.ai, or api.deepinfra.com as the price source. Supports separate pricing for each full provider/model name.
  6. Price sync and caching: Initializes new model prices from the local cache of the selected source. Model prices are downloaded only when you choose Sync prices. Cache files are stored separately in data/models.dev.json, data/openrouter.ai.json, and data/api.deepinfra.com.json.
  7. Price matching rules: Matches source prices by model ID. Existing prices are retained for ambiguous matches, and they are also retained when the source cannot provide supported rates.
  8. Advanced settings and rules: Supports different peak pricing rules (DeepSeek, Alibaba Cloud, Zhipu GLM). Uses a holiday calendar (cached in data/holidays/).

Installation and Activation

Before using it, make sure your DSH version is 0.2.0-rc.2 or later.

  1. Run the following command in the terminal to install the plugin:
dsh plugin --profile web add -w @guojinpeng/dsh-cost-meter
  1. Restart DSH.

  2. Open the Plugins panel and select @guojinpeng/dsh-cost-meter to change or sync prices.

Typical Usage

After installing the plugin and restarting DSH, you can see cost estimates in the session or turn panel. Click the information button on the price details to view the specific calculation formula. In the plugin settings, you can choose Sync prices to update model prices, or manually configure the USD/CNY unit price and exchange rate for each model.

Use Cases and Cautions

This plugin is suitable for developers and researchers who need to manage API call costs precisely. The plugin runs with the permissions of the current DSH process; it is recommended to review the source code and license before installation. The configuration is stored in ~/.dsh/guojinpeng/dsh-cost-meter/config.json.

Closing Note

dsh-cost-meter helps DSH users intuitively monitor session and turn costs. See GitHub or the SkillHub directory for more information.