imeepos/dsh-billing-plugin

deepseek harness billing plugin

dsh-billing is an event-sourced real-time billing plugin for DeepSeek Harness: the bill is a pure function of the session log plus the deployment price table, with no model-context injection. A draggable water-fill gauge in the bottom-right corner of the web client shows the live bill for the current single session -- water level as budget percentage consumed (green <25%, blue 25-50%, orange 50-75%, red >=75%), and clicking it toggles a detail panel with cost, remaining budget, cache-hit/miss/output shares with token counts, and call count. It supports both token-based and fixed per-call style price buckets (inputPerMillion, outputPerMillion, cacheReadPerMillion, cacheWritePerMillion) with peak/off-peak windows, a currency code, an optional per-session budget (a statistics field only, with no enforcement), and a configurable clock offset.

Other ★ 1 updated 2026-08-14 ✅ runtime-tested
View on GitHub ↗

Install

curl -LO https://github.com/imeepos/dsh-billing-plugin/releases/latest/download/dsh-billing-0.2.0.tgz && npm install ./dsh-billing-0.2.0.tgz

Download the packaged release artifact (it contains only the built lib/, no source build required) and install it into the dsh deployment directory so the cordis loader resolves the plugin: curl -LO https://github.com/imeepos/dsh-billing-plugin/releases/latest/download/dsh-billing-0.2.0.tgz then npm install ./dsh-billing-0.2.0.tgz. Copy the tarball to a reachable machine if GitHub is unreachable. The README also documents a from-source development path (git clone, npm install, npm run build, npm run build:client). NOTE: the npm name dsh-billing exists on the registry (0.4.1, 2026-09-30) but exposes no repository field, so it cannot be confirmed to be this repo -- install from the release tarball as documented.

Compatibility

DeepSeek Harness (companion code of the book 《深入拆解 DeepSeek Harness》). The plugin must be mounted via the - insert: list in the profile's cordis.patch.yml (top-level entries fail with entry "billing" not found); verify with dsh --profile <your-profile> --dump-config. Prices are configured per model with peak/off-peak buckets and a per-model effectiveFrom epoch (calls before it price at zero). Peak windows default to [[9,12],[14,18]] in the configured clock (utcOffsetMinutes 480 = Beijing time). The gauge shows only the currently selected single session, never a total across sessions.

Details

Recent updates

The README documents the install steps, the mandatory - insert: cordis.patch.yml block with a full config example (currency, budget, per-model prices with effectiveFrom and offPeak/peak buckets), verification via --dump-config, a one-click install prompt block for an AI assistant, the configuration-field table, the price-bucket field table, and usage (water level tiers, click for the detail panel, drag to reposition with localStorage persistence).

FAQ

How do I install dsh-billing?
Per the README, download the release artifact with curl -LO https://github.com/imeepos/dsh-billing-plugin/releases/latest/download/dsh-billing-0.2.0.tgz and install it with npm install ./dsh-billing-0.2.0.tgz, then add the - insert: block to the profile's cordis.patch.yml and verify with dsh --profile <profile> --dump-config.
Does it inject anything into the model context?
No -- the README states the bill is a pure function of the session log plus the deployment price table, with no model-context injection.
Does the gauge total all my sessions?
No -- the README says it reflects the currently selected single session only, and switching to another session refreshes the gauge to that session's bill (costs are never summed across sessions).

Alternatives

940842546/dsh-usage-billing · crazywoola/dsh-balance · bpc-oss/dsh-web-billing

More plugins in Other

Browse more in Other

Guides for Other plugins