dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
估算会话和每轮费用,按模型设置 USD 或 CNY 单价,并从 models.dev、OpenRouter 或 DeepInfra 同步价格。
This plugin shows estimated session and turn costs in DSH. Use DSH 0.2.0-rc.2 or later. Tests use DSH 0.2.0-rc.2.

dsh plugin --profile web add -w @guojinpeng/dsh-cost-meter
Replace web with your profile name.
If you used the old unscoped package, disable it before you install this package.
Install published versions from npm. npm provides the built package. GitHub contains the source code and release notes.
provider/model name.cnyPerUsd rate. The trend toggle also picks the basis of the mix, the time-of-day bars and the model shares. Select a bar to query its span. Cost by model opens as a scatter plot (total spend on a log scale against tokens, names fixed at the top right of each bubble, bubble colour following the blended price per 1M tokens from pale teal (cheap) to deep indigo (dear)) with a clickable provider-grouped legend, and switches to the share table.provider/model next to the Model rates title and selecting Add model. Declared models are saved with the configuration; models that history has not discovered can be removed.data/holidays/. Fetches a missing year in the background.~/.dsh/guojinpeng/dsh-cost-meter/config.json. Uses DSH_HOME when set.~/.dsh/dsh-cost-meter/config.json on first start if the new file does not exist. Keeps the old file.These screenshots use example model prices. They do not show a billing statement.
Existing model prices without a currency remain USD. Existing entries without an off-peak setting keep fixed rates until you switch it on. The switch is off by default for every new entry. Confirmed original-vendor DeepSeek off-peak rates from models.dev are multiplied by two to store peak rates. Every model applies its own selected rule; the default is the DeepSeek peak rule.
The configuration file stays at the same path. No configuration migration is required. Historical usage is replayed to restore dates and seven Beijing clock windows under projection state version 5; the inherited transcript that a side thread or a forked subagent copies into its own log is skipped, so those turns are billed once. Requests that cross a price boundary are estimated from the recorded usage settlement time. Only the DeepSeek peak rule reads the holiday calendar; the Alibaba Cloud and GLM rules never need it. If a holiday calendar is unavailable, uncertain weekday windows use the peak rate until the calendar is loaded.
priceSource selects the cache for new models. Existing configuration without this field uses models.dev. Each model's source records its last price import; edits to rates on the configuration page set it to manual. Changing the selected source does not change existing rates or fetch prices. Cost calculation uses only the saved rates.
Caches are separate: data/models.dev.json, data/openrouter.ai.json and data/api.deepinfra.com.json. OpenRouter and DeepInfra prices are not multiplied by two. DeepSeek entries with automatic off-peak pricing keep their rates when the source cannot confirm an official peak rate. Sync reports show skipped models and cache-write rates that were kept because the cache duration is unclear. Conditional prices and non-token charges are outside this fixed-rate estimate.
Session cost details:

Turn cost details:

Model price settings:

Install Node.js, pnpm 9 and Git. Install DSH globally before you run the tests:
npm install -g @deepseek-ai/dsh@0.2.0-rc.2
git clone https://github.com/guojinpeng/dsh-cost-meter.git
cd dsh-cost-meter
pnpm install --frozen-lockfile
Edit files in src/. Run tests and create a package:
npm test
npm run build
npm pack
npm pack also runs the build. It creates guojinpeng-dsh-cost-meter-<version>.tgz.
Install the generated file in your DSH profile. For version 0.4.4:
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.4.4.tgz
Restart DSH and check the plugin. Repeat the build, package and install steps after changes.
Tests use the global DSH installation. Set DSH_RUNTIME_ROOT to the DSH package directory if its location is different.
Commit source files and pnpm-lock.yaml. Do not commit generated files or local configuration.
See the module guide for source boundaries and verification commands.
Use an npm account with publish access to @guojinpeng/dsh-cost-meter.
Run these commands in the project directory:
npm login --registry=https://registry.npmjs.org/
npm whoami --registry=https://registry.npmjs.org/
npm view @guojinpeng/dsh-cost-meter version --registry=https://registry.npmjs.org/
An unpublished package can return E404 from npm view.
For an update, choose a version that is newer than the published version.
Update package.json. You can use this command to increase the patch version without creating a Git tag:
npm version patch --no-git-tag-version
pnpm install --lockfile-only
npm test
npm run pack:release
Check the package file list. pack:release runs npm pack and creates the versioned
npm tarball. Commit and push the version change. Then publish that tarball.
For example, replace <version> with the new version number:
npm publish ./guojinpeng-dsh-cost-meter-<version>.tgz --access public --registry=https://registry.npmjs.org/
npm view @guojinpeng/dsh-cost-meter version --registry=https://registry.npmjs.org/
Complete npm's authentication steps when prompted. Each package version can be published only once. After npm publication succeeds, create the matching Git tag and GitHub Release:
git tag v<version>
git push origin v<version>
gh release create v<version> --verify-tag --title "<version>" --generate-notes --latest
Replace <version> before you run these commands. GitHub Releases contain release
notes; uploading a tarball is optional. npm hosts the installation package.
The plugin catalog links the npm package through its repository field.
Users can then install the package:
dsh plugin --profile web add -w @guojinpeng/dsh-cost-meter