AI Agent Hub
Back to plugins
🧩

dsh-token-cost

admin-security Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install gdy01/dsh-token-cost

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install gdy01/dsh-token-cost in your terminal; the source is at https://github.com/gdy01/dsh-token-cost . Restart dsh web after install and the cost panel button will appear in the sidebar.

About this plugin

When running multiple DeepSeek-model sub-projects through DSH, token usage is buried in per-project session logs, and the RMB price differs across uncached input, cache-hit input, and output tokens. Calculating the real cost used to mean sifting through raw logs by hand. dsh-token-cost turns that into a single sidebar button.

The plugin scans every session.jsonl and .zstd file under ~/.dsh/sessions, aggregates by project (cwd) and by model, splits each request into three token categories — uncached input, cache-hit input (cacheReadTokens), and output — then converts them to RMB using a built-in DeepSeek official price table (CNY per 1M tokens). Models not in the table are still listed with raw token counts so you can add or override prices in cordis.patch.yml without touching code. A small button appears at the bottom of the DSH web sidebar; opening it reveals per-project totals with expandable per-model breakdowns. The HTTP API is bound to loopback only, and the plugin carries zero runtime npm dependencies (Zstandard decoding uses the Node built-in node:zlib module).

Ideal for developers and team leads who manage multiple DSH projects across several models and want an at-a-glance view of token cost composition, particularly the savings unlocked by prompt-caching hit rates.

Use Cases

  • Quickly check per-project token spend after parallel inference runs
  • Evaluate real savings from prompt-cache hit rates
  • Add custom prices for non-listed models without touching code

Best For

  • Developers managing multi-project inference via DSH
  • Team leads who need per-project LLM cost accounting
  • AI engineers using DeepSeek models and tracking cache-driven savings