dsh-cost: An Evidence-First Token Cost Ledger and Budget Check Plugin for DeepSeek Harness
dongsheng123132/dsh-cost
dsh-cost provides an evidence-first token cost ledger and budget checks for DeepSeek Harness, with tools dsh_cost_report and dsh_cost_check plus an MCP server.
dsh-cost is a token cost accounting plugin designed for DeepSeek Harness. It attributes every usage record in the durable session log to its corresponding route, then applies your own price book to produce accurate, traceable cost reports. It never hides missing data or reassures you with a fake total. In addition to cost report and budget check tools, it supports offline ledger analysis, letting you process event files and make budget decisions from the command line.
How to Install
dsh plugin --profile web add github:dongsheng123132/dsh-cost- Category
- Models & Reasoning
- Platform
- DSH Plugin
- Author
- dongsheng123132
- Distribution
- Plugin
dsh-cost Key Features
dsh-cost Repo Summary
What Does It Do?
dsh-cost is a token cost ledger and budget check plugin for DeepSeek Harness that tracks token usage with an evidence-first approach. It solves the problem of opaque cost attribution and hidden missing data, letting you get accurate cost reports and budget decisions directly inside DSH based on durable session logs. Core capabilities include cost reporting, budget checks, price book configuration, and offline ledger analysis.
Core Features
- Cost report tool: breaks down costs by route from durable session logs, showing evidence completeness and current token pressure.
- Budget check tool: explicit fail-open/fail-closed budget decisions without automatically intercepting future calls.
- Price book configuration: uses your own price file, billed per million tokens, supporting separate buckets for input, output, cache read, and cache write.
- Offline ledger: processes session event files via command line, with budget thresholds and fail-closed mode; exit code 2 indicates over budget.
- Evidence boundary: missing usage or unpriced calls remain explicitly marked, never producing a reassuring fake total.
How to Use This Plugin?
After enabling it in DSH, call the dsh_cost_report tool to get a cost report, or dsh_cost_check for a budget check. To configure the price book, copy the example price file, fill in actual prices, then specify the path and default budget in the plugin config. For offline scenarios, use the command line to process event files with budget and fail-closed options.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: dongsheng123132/dsh-cost. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
