Real-time Usage Panel Plugin dsh-mimo-quota

Foreword

DeepSeek Harness (DSH) adopts a plugin-based architecture but lacks an official usage query interface on the Web side. When developers need to track Token consumption, costs, and model composition in real-time, they often have to rely on third-party tools or manual calculations. The dsh-mimo-quota plugin provides a real-time usage panel for the DSH Web client by monitoring local streaming events.

Installation

Install using either of the following methods in the DSH plugin manager or settings:

# 通过 git URL 安装
git https://github.com/hbgdjb/dsh-mimo-quota.git
# 或通过 registry 包名安装
npm install dsh-mimo-quota

After installation, the application must be restarted. The plugin will automatically write to the manifest and take effect in the current profile.

Environment Requirements and Configuration

This plugin must run on the DeepSeek Harness 0.1.x Web client. After successful installation, the following parameters can be configured in the profile’s cordis.patch.yml:

Field Description Default
storageFile Path to the usage record JSON <profile>/mimo-quota-usage.json
currency Display currency symbol ¥
pricing Price overrides (default + models, unit: ¥ / million tokens) Built-in Xiaomi pricing

The data storage file uses a v2 structure: { version: 2, records: [...], sessions: { id: { title, dir } } }.

Core Features

  • Real-time usage panel: Displays Token usage, spending amount, API request count, input/output tokens, and provides trend charts and model composition.
  • Interactive controls: Supports switching models, statistics granularity, time ranges (e.g., 30-second auto-refresh or manual refresh) and statistics scopes (all/project/conversation).
  • Pricing system: Built-in editable pricing panel, supports modifying the default price and per-model prices (input/cache hit/cache write/output), with one-click reset.
  • Tiered pricing: Built-in peak/off-peak pricing for deepseek-flash and deepseek-v4-pro. Beijing time 09:00–12:00 and 14:00–18:00 are peak hours; all other times and weekends are off-peak. Spending amounts are automatically calculated based on record timestamps.
  • Historical data import: Supports importing CSV files. Files must be placed at <profile>/mimo-quota-import.csv; refreshing the page merges them (with automatic deduplication and duplicate counting).

Usage Examples

  • Modify pricing: Directly modify the four pricing fields in the panel; saved changes take effect immediately. To adjust prices for specific models, add the corresponding models in the pricing configuration.
  • Import historical data: Prepare a CSV file with headers including Session ID, Title, Raw input tokens, Output tokens, etc. Place it at the specified path and refresh the page.

Notes

  • Data source: Spending amounts are estimates based on pricing and tiered rules, not official invoices. Please refer to the official console for accurate amounts.
  • Version compatibility: The plugin’s data structure is v2, and it relies on Harness’s llm/stream streaming event local measurements.
  • Logging: Conversation event logging uses a three-channel accounting approach: “rebuild + real-time + 60s file polling.”

References

  • GitHub repository: https://github.com/hbgdjb/dsh-mimo-quota
羽毛球分组比赛记分
小程序二维码

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

Xiaoye