dsh-plugin-price-aware: A DSH Plugin for Cost-Aware Agents

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:

  1. Real-time Bill Reading: The model can read unit prices, account balances, and the current session’s running bill in real-time.
  2. 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.
  3. Budget Gate: When approaching the budget limit, the plugin proactively asks the user to prevent overspending.
  4. Differentiated Pricing Support: Supports DeepSeek’s peak/off-peak pricing and cache-hit pricing.
  5. Command Line Interaction: Provides commands such as /money, /budget, and /estimate for user queries and settings.
  6. 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:

  1. View Price & Balance
    Use the /money command to view the current model unit price, account balance, amount spent in the current session, and remaining budget.

  2. Get Task Quote
    Use /estimate <kind> [turns] [residentK] to get a task quote. This returns cost projections for A/B/C tiers.

  3. 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.

  4. External Code Usage
    Import the dsh-plugin-price-aware/pricing module in your code to reuse the cost calculation logic within it.

Notes

  1. Restart Requirement: You need to restart dsh after installation to load the plugin.
  2. 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.
  3. Dependencies: Depends on @deepseek-ai/cordis.
  4. 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.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye