Introduction¶
When tracking usage costs in DeepSeek Harness (DSH), prices must be set for different models and time periods. The dsh-ui-pricing plugin solves this problem: it provides a user-configurable pricing system that supports per-model list prices, allows daily costs to be adjusted through time-based policies and multipliers, and displays spending in real time through CostLine in the composer interface.
Plugin Scope¶
This is a user-configurable cost-pricing plugin for DeepSeek Harness, maintained by ivvan3016, categorized as admin-security, and licensed under the MIT License.
Installation and Enablement¶
The plugin is distributed as an npm package and includes prebuilt artifacts, so no additional setup is required after installation.
dsh plugin --profile web add dsh-ui-pricing
After installation or update, you must restart the dsh web process. This is because the client plugin manifest and predictor registry are built when the server starts.
Configuration¶
Pricing settings can be configured in the plugin page card. The settings include per-model list prices, default time policy, and daily exceptions.
Model Prices¶
Set the currency price per million tokens. Cache write fees are calculated using the cache miss input rate (DeepSeek currently has no separate write price). Models not defined in the list have a price of 0.
Time Policy¶
The default policy is one time window from 00:00 to 24:00 with a multiplier of 1.0. In the plugin page card, you can define your own schedule for each workday. Each time window contains an HH:MM range and a multiplier. A multiplier of 1.0 means the original price, and 0.5 means half price.
pnpm Allow List¶
If installing from GitHub source, the build process might be blocked by pnpm. If you encounter the ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED error, you need to copy the exact key printed by pnpm into the pnpm-workspace.yaml configuration file:
allowBuilds:
dsh-ui-pricing@https://codeload.github.com/ivvan3016/dsh-ui-pricing/tar.gz/<commit-hash>: true
This key is bound to a specific commit hash, does not match the package name, and only changes when dependencies are updated to a new commit.
CostLine Usage¶
The plugin registers a CostLine component in the composer dock, used to display total spending across all active sessions.
Viewing and Correction¶
CostLine displays a total with an “Estimated” badge. Click the amount (in writable deployments) to open an in-place editor, prefilled with the current total. Entering a corrected total replaces the estimated value, and subsequent usage will still accumulate on top of it. The difference between the corrected value and the automatically calculated value is saved as manualSpend.
24-Hour Multiplier Band¶
On the right, the current local time and the effective multiplier are displayed, along with a 24-hour multiplier band that marks the current minute. Colors in the band indicate a discount (below the original price), a premium (above the original price), or neutral (original price).
Notes¶
- Unlisted models: The price defaults to 0 until defined in settings.
- Timeline alignment: When dragging or clicking timeline boundaries, they snap to the hour; minute-level adjustments must be completed in the settings documentation.
- Override mechanism: Daily exceptions are copies of the default schedule. Subsequent changes to the default schedule do not affect existing exceptions.
- Data refresh: The CostLine total is refreshed when the current session emits events or is reopened, so it reads the latest session prediction.