During the use of DeepSeek Harness (DSH), frequently switching pages to check account balances or quotas can interrupt the workflow. This article introduces dsh-llm-balance, a plugin that integrates balance monitoring into the bottom-right corner of the interface.

Plugin Introduction

This plugin is an online tool component of DeepSeek Harness, maintained by L.H (MIT License). Its core value lies in solving the sudden “insufficient balance” and “exhausted quota” issues in multi-account management. With a persistent card, developers can check the remaining status of connected AI accounts without leaving the current interface.

Core Features

The plugin supports four services: DeepSeek, Moonshot, Kimi For Coding, and OpenCode Go. It provides the following capabilities:

  • Automatic Data Reading: Automatically finds and reads the remaining balance or subscription quota corresponding to API keys already filled in the configuration file, without requiring additional credential configuration.
  • Multi-dimensional Display:
    • Prepaid accounts (e.g., DeepSeek, Moonshot): Displays the remaining amount.
    • Subscription accounts (e.g., Kimi For Coding, OpenCode Go): Displays the used percentage and reset time.
  • Status Visualization:
    • Color Warnings: Turns red when less than 20% remains, yellow when less than 40% remains, and blue otherwise.
    • Current Status: Shows a green dot next to the provider currently in use.
  • Interaction Features:
    • Supports dragging and magnetic edge snapping.
    • Supports collapsed display (bubble mode).
    • Supports adjusting the refresh frequency (60 seconds / 5 minutes / 30 minutes / 1 hour).
    • Supports semi-transparent mode.
    • Remembers the view, position, collapsed state, and refresh frequency.

Installation and Activation

Run the official installation command in the terminal:

dsh plugin --profile web add dsh-llm-balance

After installation, refresh the web page to activate it. The plugin automatically finds filled-in API keys and requires no additional configuration.

Usage

  1. Switch Views: Click the icon to the right of the card title to cycle through “Current Model”, “Overall Summary”, and “All Sources”.
  2. Move and Snap: Hold and drag the title bar. When near the left or right edge, it automatically snaps to the edge. Double-click the title to reset it to the bottom-right corner.
  3. Collapse/Expand: After snapping, a ‹ or › appears in the corner of the card. Click the bubble to collapse it (showing the initial letters plus key numbers) or restore it.
  4. Refresh Frequency: Click the refresh frequency chip (e.g., 60s) to switch the interval.
  5. Transparency: Click the translucent icon to adjust the background color.

Configuration

The plugin works with the default configuration, but it supports deep customization. Modify the config entry in cordis.patch.yml and restart dsh web for the changes to take effect:

config:
  thresholds: { warn: 40, error: 20 }                    # 剩余低于 40% 黄、低于 20% 红
  balanceThresholds:
    'deepseek-balance:CNY': { warnBelow: 40, errorBelow: 20 }   # DeepSeek 余额阈值设置
  percentMode: used                                      # 显示已用%(改成 left 显示剩余%)
  refreshMs: 60000                                       # 默认 60 秒刷新一次

Notes:
* The subscription window displays the used percentage, but color determination is based on the remaining percentage.
* Balances have no total denominator, so percentages are not forced; set amount thresholds in the configuration.
* You must restart the service after modifying the configuration.

Privacy and Security

The plugin follows privacy-protection principles:
* Key Isolation: API keys remain only in the host process and are not persisted on the browser side.
* API Restrictions: The browser side only receives amounts, currencies, window durations, and error codes. The API is read-only and does not cache data.

Use Cases

Suitable for developers who need to monitor balances or quota usage of multiple accounts in real time within the DSH interface. Please confirm the source code and license before installation.