Preface¶
When calling providers such as DeepSeek, Moonshot, Kimi For Coding, OpenAI Codex (Codex Connect), OpenCode Go, etc. through DSH (DeepSeek Harness), balances and package quotas are usually scattered across different interfaces. Manual queries are fragmented and can easily expose API Keys to the browser side. dsh-plugin-llm-balance is a DSH plugin that provides a draggable floating card in the upper-right corner of the Web GUI page, used to centrally display the balance/quota of recently used providers, with color-coded thresholds.
What This Is¶
Below introduces the capabilities, installation method, and boundary conditions to note for FengHuoLinShan/dsh-plugin-llm-balance.
- Maintainer:
FengHuoLinShan - Positioning: DSH Web GUI plugin
- License:
MIT - Core scenario: View provider balances and quotas on the browser side without sending API Keys or OAuth tokens to the frontend
Core Features¶
Recently Used Provider Card¶
The plugin persistently displays a floating card in the Web GUI showing balance/quota for up to 3 most recently used providers. It only records model calls that completed successfully after the plugin was enabled, displaying the 3 most recent distinct providers.
Balance and Quota¶
The plugin supports both monetary balance and package quota display, including available windows such as 5-hour, weekly, and reset times. Status colors are calculated based on the most constrained window. Balance and quota change colors based on thresholds; gray is displayed when loading or query fails.
Interaction and Refresh¶
- Card is draggable and remembers its position
- Click the card to refresh
- Auto-refresh every 60 seconds by default
- Pauses refresh when the page is hidden, and updates immediately upon becoming visible again
DeepSeek Off-Peak/Peak Price Badge¶
DeepSeek rows can display a “Off-Peak / Peak” badge. This status is purely clock-based calculation and does not send balance query requests; the tooltip shows the time period table and countdown to the next switch.
Auto-Discovery Configuration¶
The plugin merges built-in providers, llm-pi-ai.providers.*, and this plugin’s configuration for auto-discovering currently displayable providers.
Credential Boundary¶
API Keys and OAuth tokens are not sent to the browser and do not appear in any responses, logs, or pages. Balance queries are completed through Connection RPC with loopback-only permissions.
Supported Scope¶
Providers listed in current documentation include:
- DeepSeek / DeepSeek Official
- Moonshot / Moonshot CN
- Kimi For Coding
- OpenAI Codex (Codex Connect)
- OpenCode Go
OpenAI Codex depends on the optional dsh-codex-connect with a minimum compatible version of 0.1.0-alpha.4.5. When not installed, the plugin still runs, and openai-codex honestly displays as not configured.
Installation and Enablement¶
First confirm that the DSH version meets the requirement: 0.1.0-rc.7 or higher. This version introduces the independent Connection RPC channel used by the plugin.
Install via GitHub below:
dsh plugin --profile web add "github:FengHuoLinShan/dsh-plugin-llm-balance#main"
After installation, restart the dsh service, then refresh the page. Plugin set changes require restarting the dsh service to take effect; client bundle changes support HMR when the pnpm run dev:web watcher is running in the DSH checkout; otherwise, reinstall/restart the service and refresh the page.
To display OpenAI Codex, additionally install dsh-codex-connect:
dsh plugin --profile web add dsh-codex-connect@alpha
After installation, complete ChatGPT OAuth login in its interface. Not installing this optional dependency does not affect the display of other providers.
Typical Usage¶
Viewing the Card¶
After restarting the dsh service and refreshing the page, a floating card will appear in the upper-right corner of the page. The card displays up to 3 most recently used providers with balance, quota, reset time, and other information.
Adjusting Polling Interval¶
Personalized configuration is done in ~/.dsh/profiles/web/cordis.patch.yml by overriding with line id. For example, overriding refreshMs to 30000:
# Override by line id in ~/.dsh/profiles/web/cordis.patch.yml
# Example field: refreshMs: 30000
# Note: When overriding, you must fully restate all config keys required by that line
The default polling interval is 60 seconds.
Self-Test¶
If you obtained the plugin from a source checkout, you can run the self-test script:
node test/balance.test.mjs
Uninstallation¶
dsh plugin --profile web remove dsh-plugin-llm-balance
Applicable Scenarios and Notes¶
Suitable for users currently using the DSH Web GUI who want to centrally view balance/quota for providers such as DeepSeek, Moonshot, Kimi For Coding, OpenAI Codex (Codex Connect), OpenCode Go, etc.
Points to note before use:
- The plugin runs with the current dsh process permissions; source code and license should be reviewed before installation.
- The license is
MIT. - Balance/quota data comes from official interfaces and may have slight delays; for reference only.
- The OpenCode Go endpoint currently has no official public documentation and may change.
- API Keys and OAuth tokens do not leave the server; they are not sent to the browser.
Links¶
- GitHub: https://github.com/FengHuoLinShan/dsh-plugin-llm-balance
- Community directory page: The URL is not confirmed in the current documentation, so no specific link is provided here.