Preface¶
DSH (DeepSeek Harness) can meter tokens precisely, but it does not automatically report costs. Existing harnesses lack price lists, /cost commands, or balance caps. dsh-plugin-price-aware fills this gap. It enables the model to read its unit price, account balance, and current session bill in every turn, and provides A/B/C tier quotes before executing expensive steps.
Core Features¶
This plugin primarily offers the following capabilities:
- Real-time Bill Reading: The model can read unit prices, account balances, and the current session’s running bill in real-time.
- Cost Estimation: Before executing a task, it provides A/B/C tier (Minimal/Standard/Exhaustive) cost estimates, with each tier including token projections and monetary amounts.
- Budget Gate: When approaching the budget limit, the plugin proactively asks the user to prevent overspending.
- Differentiated Pricing Support: Supports DeepSeek’s peak/off-peak pricing and cache-hit pricing.
- Command Line Interaction: Provides commands such as
/money,/budget, and/estimatefor user queries and settings. - Mathematical Core Module: Provides a pure mathematical core module for use in external harnesses, dashboards, or CI pipelines for budget checks.
Installation & Activation¶
Install the plugin using the following command:
dsh plugin add github:121212165/dsh-plugin-price-aware
After installation, the dsh process must be restarted for the changes to take effect. The plugin’s configuration file is located at cordis.patch.yml, where all fields are documented.
Typical Usage¶
After installation and restart, you can use it as follows:
-
View Price & Balance
Use the/moneycommand to view the current model unit price, account balance, amount spent in the current session, and remaining budget. -
Get Task Quote
Use/estimate <kind> [turns] [residentK]to get a task quote. This returns cost projections for A/B/C tiers. -
Manage Budget Policy
Use/budget [5]to read and modify the budget policy. When modifying the policy, the plugin prints the configuration edit content rather than silently changing the limit. -
External Code Usage
Import thedsh-plugin-price-aware/pricingmodule in your code to reuse the cost calculation logic within it.
Notes¶
- Restart Requirement: You need to restart dsh after installation to load the plugin.
- Quote Ceiling: Quotes are strictly ceilings. If the model does not stop talking, there is no guarantee that the final cost will not exceed the estimated value.
- Dependencies: Depends on
@deepseek-ai/cordis. - License: Released under the MIT License.
This plugin addresses the lack of cost awareness in DSH through real-time billing and budget controls. For more details and source code, please visit the GitHub Repository.