dsh-token-gobbler: Auditing Tokens and Model Performance with DSH Session Traces

Preface

When running agents in DeepSeek Harness (DSH), every conversation turn and tool call lands in the session trajectory. Developers often care about three things: which model was actually used, what the throughput and latency are, and how much it would cost according to enterprise API price lists. Manually digging through session.jsonl or just looking at billing statements makes it difficult to align “who was used at which step,” “token counts per bucket,” and “comparison with enterprise Claude/Grok prices” onto a single timeline.

Below is an introduction to the community plugin token-gobbler (repo Psynosaur/dsh-token-gobbler), maintained by Psynosaur and categorized under model inference. It reads DSH’s persisted session data, reconstructs statistics, and provides a Web dashboard and CLI reports. The README positions it as follows: since using models in DSH is essentially doing evaluation, this plugin audits these “already run evaluations.”

What is this

token-gobbler is a composition plugin for DSH: it parses every session from the trajectory file ~/.dsh/sessions/<ws>/<sid>/session.jsonl.zstd (a multi-frame zstd compressed JSONL event log), combines it with the projection store for model attribution and token aggregation, and then estimates costs based on configurable price lists (enterprise-side and local-side). The same set of metrics applies to any source recorded via DSH, such as local llama.cpp, DeepSeek API, or enterprise-hosted models.

Core Features

Session-level Reconstruction

For each session, the plugin organizes:

  1. Model Attribution — Matches the provider/model that actually provided the inference step-by-step; prioritizes the usage block for each turn, otherwise estimates by step count, and finally falls back to the profile default model; aligns with the authoritative totals from the projection store and splits them down to the actual models used.
  2. Token Buckets — Uncached input, output, cache read, cache write (thinking is treated as a sub-category of output and is not double-counted).
  3. Speed — Decode tok/s (streaming output ÷ time from first chunk to usage block), prefill tok/s (new input ÷ TTFT), and step-by-step thinking time.
  4. Tool Call Costs — Estimated based on the size of the tool argument payload (approx. chars/4) rather than the entire step context.
  5. Pricing — Price lists (Enterprise vs. Local) and WFH / Enterprise cost splitting.

The core logic for parsing and reporting resides in lib/trajectory.ts and lib/report.ts; it includes multi-frame zstd decompression, step-by-step timestamps, two-layer parsing caches (memory and disk), and a Reprocess function to clear caches and rescan historical files.

Web Dashboard

After installation and restarting the harness, a Token Gobbler section is added to the DSH settings modal: collapsible drawers include Cost, Tokens, Speed, Activity, Chart defaults, Imported sources, etc.; Refresh and Reprocess are provided. The activity entry in the bottom right corner (the 🦃 button in the README) opens the activity modal, with tabs including Overview, Cost, Performance, Runs (horizontal comparison of multiple runs with the same model), Compare (select 2–4 different model runs, aligned by progress or wall-clock time), Daily (daily token heatmap calendar), Llama Metrics (polling llama.cpp service), and Settings (price lists).

Charts are drawn by the plugin’s own canvas implementation (client/graph.ts, client/graph-canvas.tsx) and do not bundle third-party chart libraries. There are six modes: Lines, Both, Dots, Trend, Bars, Heat; default modes and curve styles can be configured in Settings › Token Gobbler › Chart defaults.

Importing Other DSH Home Directories

Settings › Token Gobbler › Imported sources allows registering DSH homes from another machine or OS (e.g., mounted NTFS user directories, macOS /Volumes, rsync copies of ~/.dsh), enabling statistics to cover DSH sessions across multiple devices.

Command Line Reports

Reports can be generated without opening the Web UI:

node bin/token-gobbler.js          # Human-readable format
node bin/token-gobbler.js --json   # Machine-readable
node bin/token-gobbler.js --days N # Limit to the last N days

package.json also provides npm scripts: usage, usage:json, and several report:* helper scripts (such as report:days).

Installation and Activation

The installation method provided in the official README is:

npx @deepseek-ai/dsh plugin --profile web add github:Psynosaur/dsh-token-gobbler

After completion, you must restart the harness. For local development, you can add "token-gobbler": "link:/path/to/token-gobbler" to the profile’s dependencies, add "token-gobbler" to dsh.profile.bundles, and then run pnpm install.

The plugin requires Node.js >= 24 (see engines in package.json). The version number in current materials is 1.2.1, license MIT.

Typical Usage

  1. Install the plugin via the command above and restart DSH (web profile).
  2. Use DSH as usual to complete development tasks; sessions are written to the default trajectory path.
  3. Open Token Gobbler in settings and use Refresh to pull the latest data; if you have changed parsing logic or suspect cache issues, use Reprocess to re-parse historical trajectories.
  4. View model attribution, speed, and costs in the Runs / Compare / Daily pages of the Activity modal; or run node bin/token-gobbler.js --days 7 in the terminal to export a summary of the last week.
  5. If you have multi-machine data, register additional ~/.dsh paths in Imported sources and then refresh statistics.

Use Cases and Notes

Who it is for: People who use DSH for long-term agent development and need to compare the performance and token costs of local models versus enterprise API models on real workloads; people who want to treat “daily sessions” as reproducible evaluation datasets and retain the details.

Permissions and Security: The plugin reads session and projection data on the local machine (and under configured import paths) with the current DSH process permissions. Before installation, you should review the source code and MIT license on GitHub to ensure that import paths do not point to untrusted directories.

Ecosystem Note: DSH adopts an “everything is a plugin” extension approach; the SkillHub directory page is a community collection and is not officially affiliated with DeepSeek / High-Flyer. The installation commands in this article follow the repository README.

Conclusion

token-gobbler transforms DSH’s recorded session trajectories into auditable token, speed, and price comparisons, sharing the same parsing logic for both CLI and Web. To learn more, visit the directory page Psynosaur/dsh-token-gobbler and the source code github.com/Psynosaur/dsh-token-gobbler.

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

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

Xiaoye