Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture that allows developers to extend the Web interface. When developing with the DeepSeek API or using it for everyday conversations, checking the account balance, daily cumulative spending, and whether the current time falls in peak pricing periods often requires switching pages or refreshing. dsh-balance-chart is a DSH Web GUI plugin that renders account balance, daily spending, and peak/off-peak period pricing as a dual-layer chart in the conversation title bar, providing real-time monitoring with zero dependencies.

Plugin Overview

Name: dsh-balance-chart
Maintainer: fqsklm
License: MIT
Purpose: A DSH Web GUI plugin that displays a dual-layer chart of balance, daily spending, and peak/off-peak period pricing in the conversation title bar. It uses a zero-dependency design and records charges using a balance-delta-first approach, keeping it closer to actual billed amounts.

Core Features

  • Balance progress bar: Displays the account balance in the title bar. The amount representing a full bar can be changed in settings.
  • Peak/off-peak period strip: Shows the 24-hour peak/off-peak periods and supports clicking to open the DeepSeek platform usage page.
  • Per-turn consumption bar chart: Shows the balance consumption for each conversation turn, colored according to the pricing period at that time.
  • Daily cumulative line: Overlaid on the bar chart to show the cumulative consumption for today.
  • Hover details: Hover to view detailed consumption data for a turn, including time, turn number, cumulative total, token breakdown, and so on.
  • Fullscreen view: Click the fullscreen icon to view the all-day billing breakdown table and per-turn details.
  • Collapse: Click to collapse into a summary strip to save space. The state is saved automatically.
  • Settings: Supports modifying price cards, peak/off-peak periods, weekend rules, and more without code changes.
  • Auto-follow latest: The card and fullscreen view automatically scroll to the latest data, avoiding staying on historical data.

Installation and Enabling

  1. Clone the repository into a local directory:
    git clone https://github.com/fqsklm/dsh-balance-chart.git
    cd dsh-balance-chart
  1. Add the plugin to the DSH Web profile:
    dsh plugin --profile web add link:$PWD
  1. Manually edit the configuration file to mount the plugin. Edit $DSH_HOME/profiles/web/cordis.patch.yml and add the following content at the end of the file:
    - insert:
        - id: balance-chart
          name: dsh-balance-chart
  1. Return to the browser and press F5 to refresh the page. The chart will appear in the title bar.

Usage

  • Quick glance: When the title bar is expanded, the first line shows the peak/off-peak strip and today’s consumption, with the bar chart and balance bar below.
  • Hover: Move the mouse over the bar chart to view detailed consumption data for a turn.
  • Open platform: Click anywhere on the peak/off-peak strip to open the DeepSeek platform usage page in a new tab.
  • Collapse: Click ▴ to collapse into a one-line summary. The state is saved automatically.
  • Fullscreen: Click ⛶ to view the all-day billing breakdown table and per-turn details.
  • Settings: Click ⚙ to modify price cards or rules.

Configuration and Data

  • Prerequisites: The DSH credentials must include DEEPSEEK_API_KEY. Otherwise, the balance layer will be shown as unavailable, but consumption conversion will continue to work.
  • Configuration file: Located at $DSH_HOME/.dsh-balance-chart. (You need to manually edit cordis.patch.yml to mount the plugin. Data files are saved in the DSH_HOME directory by default.)
  • Accounting method: Uses a balance-delta-first approach by default, which is closer to actual billed amounts.

Conclusion

This plugin addresses the lack of an intuitive way to view balance, spending, and peak/off-peak period pricing in the DSH interface through a zero-dependency design. After installation, the chart automatically follows conversation updates without requiring window switching.