Introduction¶
When orchestrating multiple models with DeepSeek Harness (DSH), two common pain points arise: first, you don’t know how much balance or quota remains on the current model account; second, after switching models, the previous model’s quota information lingers on the interface, causing confusion. Existing workarounds either require manually navigating to the corresponding account page or digging through logs. dsh-quotaline embeds this information directly above the composer, turning balance and quota limits into a glanceable status bar.
What It Is¶
dsh-quotaline is a DSH client plugin that embeds a uniform-width status bar above the input field, displaying the balance or usage quota for the model currently selected in the session. It follows the session’s modelSelection and automatically re-queries when the model changes. The plugin only reads local credentials — it does not upload, sync, or write to ~/.dsh/.credentials.yaml. Maintainer: QianChang927.
Core Features¶
1. Model Following & Read-Only Credentials¶
- Reads the session’s
modelSelectionprojection; empty sessions fall back to the default model configured in settings. - Triggers an immediate re-query upon model switch to prevent balances from different providers from being displayed together.
- Reads credentials via the Host’s
credentialsservice in read-only mode. It does not call any write endpoints and does not parse or rewrite~/.dsh/.credentials.yaml.
2. Built-in Provider Support¶
| Provider | Displayed Content | Request Method |
|---|---|---|
| DeepSeek Account | Balance + Bonus Balance | DSH OAuth Account Service |
| DeepSeek API | Balance | GET {baseURL}/user/balance |
| Moonshot / Kimi API | Balance | GET {baseURL}/v1/users/me/balance |
| Kimi Code | 5h / Weekly / Monthly Usage | GET {baseURL}/v1/usages |
| Zhipu API | Balance | GET {baseURL}/api/paas/v4/balance |
| GLM Coding Plan | 5h / Weekly / Monthly Usage | GET {origin}/api/monitor/usage/quota/limit |
3. Custom Query Templates¶
Supports configuring HTTP templates via Settings to accommodate non-built-in providers or custom endpoints. Configurable items include: HTTP method, URL (with {baseURL}/{origin} placeholders), authentication method, credential reference, amount extraction path (supports [*] expansion), and currency path.
4. Real-time Refresh & Privacy¶
- “Runtime refresh” is enabled by default: while the Agent is working, the status bar refreshes once after each model response, delivered via a same-origin event stream. If the stream is unavailable, it falls back to polling (60s interval when the connection is idle, 15s when disconnected).
- All requests are initiated by the local Host. The client only receives labels, amounts, currencies, percentages, and error messages — it never touches API keys.
- No telemetry, no remote services, no additional accounts required.
5. Numeric Formatting & Display Rules¶
- Balance: Two decimal places, rounded half-up. For example,
5.198displays as¥5.20, and0.005displays as¥0.01. - Quota: Displayed as a percentage, rounded to the nearest integer. For example,
42.42%displays as42%, and42.5%displays as43%. - The “Remaining” mode shows
100 − used, always summing withusedto exactly 100%. - Percentages are clamped to
0–100; values exceeding 100% display as100%. - Zero and 100% represent true boundaries.
99.6%displays as99%used, and the remaining0.4%displays as99%left.
Installation & Activation¶
The plugin requires DeepSeek Harness version 0.2.2-rc.3 or later.
dsh plugin --profile desktop add dsh-quotaline
Replace desktop with the profile name you actually use (web, desktop, or a custom name). After installation, restart DSH so that both the Host half and the client bundle are fully loaded. Subsequent client-only updates require just a page refresh.
Typical Usage¶
- After installing the plugin and restarting DSH, a status bar appears above the Composer.
- Select a model in a new session (e.g., DeepSeek API or Kimi Code). The status bar automatically refreshes and displays the corresponding balance or usage.
- While using the Agent in a session, the status bar refreshes after each model response, showing the latest usage.
- To adjust refresh frequency or display mode, open Settings → Quota Line:
- Set the idle refresh interval (10–3600 seconds).
- Enable/disable runtime refresh.
- Choose the UI language (follow DSH, or fix to Chinese/English).
- Select the quota display mode (usedorleft). - To accommodate a non-built-in provider, create a new template under Custom templates, configure the method, URL, authentication, amount, and currency paths, then click Test to verify the extraction result.
Use Cases & Notes¶
- Ideal for scenarios requiring continuous monitoring of balance or usage during multi-model orchestration, such as long-running tasks, batch requests, or concurrent multi-model pipelines.
- The plugin runs with the current DSH process’s permissions. Review the source code and LICENSE (MIT) before installing.
- The plugin does not provide UI styling enhancements. It serves solely as a status information bar and does not interfere with input or interaction.
Conclusion¶
dsh-quotaline transforms balance and quota visibility from “you have to dig through pages” to “always visible at a glance,” making state management more transparent. Its core principles — “follow the model, read-only credentials, real-time refresh” — help reduce unexpected interruptions caused by insufficient balance or exhausted quotas in multi-model orchestration scenarios.
- Directory page: https://www.skillhub.cn/plugins/QianChang927/dsh-quotaline
- GitHub: https://github.com/QianChang927/dsh-quotaline