AI Agent Hub
Back to plugins
dsh-tokstat preview

dsh-tokstat

Client Updated 2026.08.18

Run the following command in DeepSeek Harness:

dsh plugin install kongjianguan/dsh-tokstat

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

Run dsh plugin install kongjianguan/dsh-tokstat in your terminal; the source code is available at https://github.com/kongjianguan/dsh-tokstat

About this plugin

You likely run a large volume of LLM requests through dsh every day, yet piecing together total token spend, per-request first-token latency, throughput, and silent retry costs from scattered log files is surprisingly tedious. dsh-tokstat reads dsh session logs directly (zstd frame-level incremental parsing under ~/.dsh/sessions) and reconstructs every LLM call into analyzable metrics: input, output, and cached tokens; TTFT; TPS; wall-clock duration; retry and failure counts; and estimated cost—all aligned with the official sessionStats projection.

The plugin ships in two complementary forms. The first is a "Stats" section inside the dsh web settings page that polls every two seconds, giving you at-a-glance overview, per-model, per-session, and per-request breakdowns right in your browser. The second is a standalone Python terminal TUI with seven views toggled by the keys o-t-m-p-s-r-e, covering a dashboard hero card with sparklines, hourly or daily token and latency trend charts, per-model and per-provider comparison tables with sortable columns, per-session drill-down, a scrollable request log (up to 1 200 rows with keyword filtering), and an error distribution panel that breaks down retry causes and flags failed steps.

It is built for three audiences: everyday users who want to know exactly how many tokens and how much money dsh burns each day; model evaluators comparing providers on TTFT, TPS, and cache-hit rates; and heavy agent users who need to pinpoint which step in a long chain is silently retrying or timing out. No extra infrastructure is required—install the plugin, restart dsh, and the numbers appear.

Screenshots

Use Cases

  • Track how many tokens and how much money dsh burns each day
  • Compare TTFT, TPS, and cache-hit rates across models and providers
  • Pinpoint which step in a long agent chain is retrying or timing out

Best For

  • Everyday users who want to keep an eye on daily token and cost spend
  • Model evaluators comparing providers on latency and throughput metrics
  • Heavy agent users who need to locate silent retries and failures quickly