DeepSeek Harness Usage Statistics Plugin

Preface

When using DeepSeek Harness (DSH) for daily development or conversation, understanding the Token consumption and cost of each dialogue turn is the foundation of cost control and model performance evaluation. However, DSH does not provide usage statistics by default, requiring manual tracking or reliance on third-party tools. This plugin provides real-time balance and usage information alongside the conversation interface, and summarizes long-term usage by workspace and model in a sidebar.

What Is This

h-atk/dsh-usage is a plugin for DeepSeek Harness, maintained by H-ATK. It does not invoke models, does not send conversation content to third parties, and only reads local session projections and account balances to track Token usage and costs. It supports separate accounting for local models, third-party APIs, and DeepSeek’s official channel.

Installation & Enablement

Install the current version from GitHub:

dsh plugin --profile desktop add github:H-ATK/dsh-usage#v1.15.8

After installation, restart DSH and navigate to Plugins → Installed → Usage Statistics. At the bottom of the page, there are three independent toggles:

  • Balance Card
  • Usage Trail
  • Usage Overview

Enabling any feature will aggregate all existing sessions; new sessions created afterward are automatically included.

Core Features

Balance Card

The Balance Card is located to the left of the conversation input box, with the same height as the input field. It displays the following:

  • DeepSeek account balance
  • Previous turn’s cost
  • Current turn’s cost
  • Current period pricing (Peak / Off-peak)

A status indicator is shown while a turn is in progress; after completion, the cost amount is displayed. Interrupted turns show an interruption status. The current period shows Peak / Off-peak pricing, with a per-million-Token unit appended after the amount.

The balance is updated when the card is enabled, when switching sessions, at the end of each turn, and via a periodic fallback refresh.

Usage Trail

The Usage Trail is located to the right of “Trail” at the top of the session, recording the current session on a per-turn basis. Each turn displays: model, start time, duration, Tokens, cache, cost, period, status, and cache hit rate.

It supports local models and third-party APIs; details retain the actual usage for each turn.

Usage Overview

The Usage Overview supports multiple time ranges: All Time, Today, This Month, 7 Days, 30 Days, and a custom date range. Filtering by workspace and model is available.

The summary card shows: Total Tokens, DeepSeek consumption, Third-party API consumption, and number of turns.

The workspace card shows Tokens, DeepSeek cost, third-party cost, and turn count for each workspace.

The model table aggregates Tokens, cost, average cache hit rate, and turn count by model.

The trend chart displays Token and cost changes over time; clicking a bar reveals the day’s details.

Token composition includes: Input, Cache Read, Cache Write, and Output.

Local / Third-Party / Official Breakdown

Local providers (ollama, lmstudio, llama.cpp, vllm, local, etc.) are not billed and do not deduct from the DeepSeek balance.

Non-DeepSeek providers (OpenAI, Anthropic, Google, OpenRouter, etc.) are tracked separately as third-party APIs.

DeepSeek official consumption is denominated in CNY; third-party reference prices use their respective currencies and are not mixed into the wallet balance.

Third-party model rows display the specific model name and vendor icon, rather than just “Third-party API”.

Price Table

DeepSeek official prices are listed separately in CNY / million Tokens, covering Cache Read, Cache Write, Input, and Output.

The third-party catalog includes common reference prices for OpenAI, Anthropic, Google, and xAI.

The price table is editable; saving only affects future estimates and does not rewrite historical records.

Reference prices are for supplementary accounting; the vendor’s actual bill is the final authority.

Export

CSV: A standard comma-separated table; exporting in the Chinese interface produces Chinese headers.

Excel: Pre-set column widths, frozen headers, row heights, unified left alignment, and model version numbers; Token data includes “万 / 亿” (ten-thousand / hundred-million) units, while costs retain their original values.

Data & Archive

Usage history is written to the Host persistent archive:

~/.dsh/storages/dsh-usage-balance/archive.json

A browser local archive serves as a fallback and is migrated to the Host on first load.

Sessions that have already been collected remain in the archive even if they are subsequently deleted.

The archive retains up to approximately 100,000 turns.

Compatibility & Notes

  • Requires DSH Host 0.2.2-rc.3 or higher.
  • Balance display requires a logged-in DeepSeek account; if not logged in or the API is unavailable, -- is shown.
  • When the window is too narrow, the Balance Card is automatically hidden to avoid compressing the input field.
  • Costs are estimates; actual charges are subject to the platform’s billing statement.
  • The plugin runs with the current dsh process permissions; review the source code and license before installation.

Closing

This plugin provides transparent usage management through local archiving and multi-dimensional statistics. Simply install it and enable the corresponding toggles to get started. The plugin does not consume additional Tokens, does not send conversation content, and all data is stored only in the local DSH data directory.

  • Plugin directory page: https://www.skillhub.cn/plugins/H-ATK/dsh-usage
  • GitHub repository: https://github.com/H-ATK/dsh-usage
羽毛球分组比赛记分
小程序二维码

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

Xiaoye