dsh-model-surplus: View model usage and account balance next to session titles

Introduction

When running multi-model sessions with DeepSeek Harness (DSH), quotas are often distributed across different upstream providers: OpenCode Go has rolling, weekly, and monthly windows; Command Code has 5-hour and weekly windows; and DeepSeek official uses account balance. If you still rely on checking usage outside the browser after switching models, it can easily interrupt your debugging flow. Below is an introduction to the community plugin dsh-model-surplus (maintainer itchenshi). It displays the usage, plan quota, or balance of the corresponding section to the right of the session title based on the currently selected model. It is not an npm package and must be installed via the DSH plugin mechanism or DSH Ready GUI.

What is this

dsh-model-surplus is a client-side (Web) plugin for DSH: A widget is attached to the right of the session title, displaying the data for whichever model is currently in use, and it shows or hides immediately upon switching models. Upstream HTTP requests are sent from the host side, and API keys are read by reference from the engine credential service, so they are not sent to the browser. The three business sections (OpenCode Go, DeepSeek, Command Code) report independently; if you only configure keys for one section, the others will still work, and missing parts will display the reason (e.g., no key, usage n/a).

Core Features

OpenCode Go

  • Displays usage percentage for rolling, weekly, and monthly windows (account level; the upstream API does not break down percentages by individual model).
  • Displays the monthly limit for the currently selected model (e.g., Limit $60); limit data comes from a public documentation page and has a different source than the percentage, so discrepancies between them are expected behavior.

DeepSeek

  • Displays account balance: Total Balance / Gifted / Top-up.
  • Displays “Insufficient Balance” when the balance is unavailable.

Command Code

  • Displays the used amount and limit for 5-hour / weekly windows.
  • Displays the account’s remaining quota.

Refresh and Visibility

  • The widget pulls display data from the host route approximately every 60 seconds.
  • Upstream results for each section are cached for 120 seconds on the host side; no retries occur within 30 seconds after a failure.
  • The UI for a section appears only when the currently selected model belongs to the configured providers route set for that section; custom route names must be written into the corresponding section’s providers.

Installation and Activation

The plugin is built into the GUI: Open the GUI → Settings window → Check Model Surplus under “Third-party Plugins”. After installation, refresh the page as prompted (the plugin includes page-side components).

Other DSH Hosts (dsh web / CLI)

Choose one of the following commands to install (both include cordis.patch.yml, no additional configuration needed after installation):

# Recommended: Install directly from GitHub
dsh plugin --profile web add github:itchenshi/dsh-model-surplus

# Alternative: Install from Release tarball (example version v0.4.6)
dsh plugin --profile web add https://github.com/itchenshi/dsh-model-surplus/releases/download/v0.4.6/dsh-model-surplus-0.4.6.tgz

This package is not on the npm registry (this package does not exist on registry.npmjs.org); you can only use the methods above or the built-in GUI option.

After installation, restart the engine and refresh the page for the widget to appear on the right side of the session title.

Credentials and Configuration

Default Credential References

Section Default Credential Reference
OpenCode Go OPENCODE_GO_API_KEY
Command Code COMMANDCODE_GOAT_API_KEY
DeepSeek DEEPSEEK_API_KEY

When the host starts, if the plugin is loaded, a line similar to [model-usage] active (opencode-go: providers=opencode-go|opencode key=OPENCODE_GO_API_KEY; ...) will appear in the logs; if this line is missing, the plugin is not loaded.

cordis.patch.yml (Config for id: model-usage, all optional)

Key Default Description
enabled true When false, the entire plugin returns immediately
opencodeGo.baseUrl https://opencode.ai/zen/go/v1 Upstream root address
opencodeGo.apiKeyRef OPENCODE_GO_API_KEY Credential reference name
opencodeGo.providers [opencode-go, opencode] Routes treated as OpenCode Go
deepseek.baseUrl https://api.deepseek.com Upstream root address
deepseek.apiKeyRef DEEPSEEK_API_KEY Credential reference name
deepseek.providers [deepseek-official] Routes treated as DeepSeek
commandcode.baseUrl https://api.commandcode.ai Quota API root address; chat address .../provider/v1 is also recognized
commandcode.apiKeyRef COMMANDCODE_GOAT_API_KEY Credential reference name
commandcode.providers [commandcode-goat, commandcode] Routes treated as Command Code

If top-level baseUrl / apiKeyRef / providers are written directly, they are still interpreted as the opencodeGo section (the plugin only supported OpenCode Go in its early stages).

OpenCode Go single model monthly limits: The plugin fetches data from https://opencode.ai/docs/zh-cn/go/ and caches it in <DSH_HOME>/logs/model-surplus-limits.json, refreshing every 24 hours; it falls back to cache or a built-in table on failure.

Typical Usage

  1. Configure the keys for the sections you actually use in the DSH credential service (at least one is required).
  2. Install the plugin as described above, restart the engine, and refresh the Web page.
  3. In the session, select a route model belonging to OpenCode Go, DeepSeek, or Command Code, and observe the widget on the right side of the title; the widget will hide when you switch to an untracked route.
  4. If no key is displayed, check if the apiKeyRef for the corresponding section matches the key in the host; if the widget is not visible, check if the current model is in the corresponding providers list.

Use Cases and Notes

Suitable for: Developers who debug multi-upstream models in the DSH Web interface for long periods and need to view plan usage or DeepSeek balances on the same screen.

Environment & Compatibility (subject to the repository’s package.json):

  • DSH >= 0.1.5-rc.2 (Manifest states compatibility with 0.1.5-rc.2 and 0.2.0-rc.2).
  • Node >= 20.
  • Earlier engine versions are untested; each section can degrade independently.

Security & Trust: The plugin runs with the permissions of the current DSH process and makes requests to configured upstreams on your behalf. Before installation, please read the GitHub source code and the MIT license to confirm that the credential references and baseUrl comply with your deployment strategy. The DSH community plugin directory (such as the SkillHub catalog page) is an independent ecosystem site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-model-surplus consolidates OpenCode Go window usage, Command Code quotas, and DeepSeek balances next to the session title, switching according to the current model, reducing the frequency of checking quotas across multiple sites. For further information, please visit the catalog page itchenshi/dsh-model-surplus and the repository github.com/itchenshi/dsh-model-surplus.

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

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

Xiaoye