dsh-session-cost: DeepSeek Harness Session Cost Monitoring

Preface

When developing agents in DeepSeek Harness, in addition to viewing the total token count and throughput, monitoring the actual cost of the Session is crucial. The existing stats bar lacks an intuitive cost display. The dsh-session-cost plugin adds a cost pill to the Session’s bottom stats bar (composer dock), directly displaying segmented costs based on model catalog pricing.

Plugin Overview

Name: dsh-session-cost
Maintainer: GalileoNio
Category: Client
License: MIT
Dependency: Node.js >= 20
Positioning: A client plugin designed to display segmented costs within the DeepSeek Harness Session stats bar.

Core Features

  1. Cost Pill Display: Adds a cost pill to the Session stats bar, displaying the total cost of the current Session.
  2. Model Catalog Pricing: Costs are calculated based on pricing from the model catalog, covering 41 providers and approximately 1495 models.
  3. Breakdown by Dimension: Clicking the cost pill reveals a detailed cost breakdown grouped by (Model, Billing Window).
  4. Manual Price Override: Allows users to set manual price overrides beyond catalog pricing.

Installation and Activation

This is a Bundle-type plugin; upon installation, it registers a Loader entry in the Harness. Use Git to clone it to the specified directory:

git clone git@github.com:GalileoNio/dsh-cost.git "$HOME/.dsh/profiles/plugins/dsh-session-cost"

Once installed, it can be loaded via the Plugins page, or installed programmatically using plugin_manager install_bundle with an absolute path.

Configuration and Usage

Plugin configuration is located in the corresponding card on the Plugins page. Since there is no auto-generated schema form, configuration items must be entered manually. Main configuration items include:
* Price List: Defines the prices for models.
* Billing Window: Defines the time periods during which prices are effective.
* Symbol & Currency: Sets the symbol and currency unit for cost display.

During Session interaction, a cost pill will appear in the stats bar. Clicking this pill allows you to view detailed cost data grouped by (Model, Billing Window).

Implementation Details & Pricing Sources

  • Calculation Location: Cost calculation is performed on the Host side, utilizing the Session’s full persistent log rather than relying solely on paginated data from the chat window.
  • Pricing Sources:
    • Model Catalog: Fetches pricing from the Harness’s own model catalog (@earendil-works/pi-ai) by default, supporting tiered pricing for long contexts.
    • DeepSeek Official Routing: Specifically adapts DeepSeek’s official routing, using its published price lists.
    • Manual Override: Models not covered by the catalog or custom discounts can be manually overridden via plugin settings.

Notes

  • Manual Configuration: The current version does not have an auto-generated configuration form; all settings must be entered manually.
  • Hot Reload: After modifying the plugin source code, usually, simply refreshing the page is sufficient for changes to take effect; no Harness restart is required.
  • Node Version: Ensure the running environment has Node.js version 20 or higher.

Summary

dsh-session-cost provides intuitive cost monitoring capabilities for DeepSeek Harness Sessions. Through the stats bar pill and the detail panel, it helps developers grasp segmented costs in real-time. This is a practical auxiliary tool for agent development scenarios requiring fine-grained cost control.

GitHub Repository: https://github.com/GalileoNio/dsh-cost
Ecosystem Directory: https://www.skillhub.cn/plugins/GalileoNio/dsh-cost

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

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

Xiaoye