DeepSeek Harness Plugin: Display Per-Turn Conversation Cost (CNY)

Introduction

When working with models in DeepSeek Harness, developers can typically only see the token usage returned by the API, without a straightforward cost estimate. Without a clear picture of the spend per turn or across an entire session, it is easy to exceed budget during debugging or extended runs. The following introduces a plugin that displays the cost per turn and per session (in RMB) directly in the interface, without sending any additional requests.

Plugin Overview and Problem Solved

This plugin (dsh-turn-cost-chip) is a model-inference plugin for DeepSeek Harness, developed by maintainer yangyanlu06. It reads the token usage data already recorded by Harness, multiplies it by DeepSeek’s official pricing, and produces the cost for each reply turn and the cumulative session cost. It does not generate new model requests, nor does it modify existing events or services—it simply displays the calculated results.

Core Features

After the page loads, the plugin provides two cost readouts:

  • At the end of each reply turn: 本轮 ¥0.0421
  • Represents the cost of all model requests and tool calls in that turn.
  • Below the top input box: 本次会话 ¥0.87
  • Represents the cumulative cost of the current session.

When you hover over or use a screen reader, a detailed breakdown is shown: model routing, peak/off-peak pricing tiers, uncached input, cache-hit reads, cache writes, output, and pricing notes.

Installation and Enablement

Install from GitHub (for profiles launched with dsh):

dsh plugin --profile <profile> add github:yangyanlu06/dsh-turn-cost-chip

Install from a local directory or tarball:

dsh plugin --profile <profile> add ./dsh-turn-cost-chip-1.0.0.tgz

In the desktop application, you can also go to Settings → Plugins → Add Plugin → Local Directory and point to the plugin’s folder.

After installation, refresh the page to see the cost readouts; disable the plugin to hide them.

Typical Usage

  1. Make sure the plugin is installed and enabled.
  2. Start a conversation in DeepSeek Harness.
  3. After each model reply completes, you will see “本轮 X.XX 元” at the end of the reply.
  4. Below the top input box, you will see “本次会话 X.XX 元”.
  5. Hover over the numbers to view the itemized breakdown.

Use Cases and Caveats

Suitable for model-inference scenarios requiring fine-grained cost control and auditing, such as:
- Cost monitoring for long sessions
- Comparing actual spend across different models/routings
- Estimating API costs during development and debugging

Caveats:
- The plugin runs with the permissions of the current dsh process. Review the source code and license before installing.
- The displayed values are estimates and do not include account discounts, credits, or coupons. The final bill is subject to the service provider.
- Chinese public holidays are not detected. If a holiday falls within a weekday peak window, it is still billed at peak rates, which may overestimate.
- Only turns within the current page load window are counted. Older turns are not included in the total cost, but per-turn cost remains accurate.
- Tokens generated by sub-agents (sub-sessions) are not counted toward the parent session’s turn cost, as sub-sessions are independent Sessions.
- Each turn is priced only according to the first reported model routing, because total token counts are not split by routing.

Closing Note

This plugin displays per-turn and per-session costs directly in DeepSeek Harness, making it easier for developers to keep track of inference spend. For more details and source code, see the plugin directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye