Introduction¶
If you have multiple providers connected to DSH—such as openai-codex, kimi-coding, and deepseek-official—you’ve likely encountered two issues. First, when vendors release new models, you have to manually fill in the model IDs in llm-pi-ai.providers.<id>.models by referring to the documentation. Second, each provider’s quota is scattered across their respective consoles, requiring you to switch pages to check the remaining balance in the 5-hour window or whether the pay-as-you-go balance suffices.
dsh-model-sync brings these two tasks into DSH’s settings page: a page to synchronize the model list and a page to view quotas, along with a ring next to the input box that follows the current session model. Below is an introduction to its features, installation, and usage.
What is this¶
dsh-model-sync is a DSH plugin by jiay98528-dev, licensed under MIT.
One-sentence positioning: It writes the latest online model list of each Provider into DSH settings, displays the 5-hour/7-day window or pay-as-you-go remaining balance via a ring next to the input box that follows the current session model. It occupies two settings pages—Model Sync is responsible for pulling and writing model IDs, Usage is responsible for reading quota readings by model, and the Composer ring is responsible for visibility within the session.
Core Features¶
Model Sync: Writing Model Lists to Settings¶
The Settings → Model Sync page provides a card for each Provider, listing the provider ID, baseURL, and model chips. IDs not yet written to settings are marked with a blue border. Click Apply N new models to write them to llm-pi-ai.providers.<id>.models.
MiniMax, Kimi Coding, and OpenAI Codex do not expose an OpenAI-style /models endpoint; the plugin uses known directory IDs for these providers.
Usage: Quota Windows and Pay-as-you-go Balance¶
The Settings → Usage page lists quotas by Provider:
- The 5-hour/7-day windows each occupy a line, displaying the remaining percentage, vendor cumulative count, and reset countdown (e.g.,
2d 3h left), along with a colored progress bar where the color follows the remaining quota; - The pay-as-you-go line displays
current / baseline. The first sample is automatically taken as the baseline, but you can also click Use current balance as baseline to set the current balance as the baseline. The balance line records the time the baseline was set.
Composer Ring¶
The ring is located to the right of the model name in the input box and to the left of the context usage. It follows the current session model and changes when the model is switched. Models with two limits display double rings: an inner ring for the 5-hour limit and an outer ring for the 7-day limit. Hovering over the ring displays a detail card titled provider / model, with each window shown on a separate line (e.g., 5 hours left 100% · 2h 15m left). Kimi Coding’s top-up packages are also included in the hover card. Quotas for other providers can still be viewed on the Usage page.
Refresh and Language¶
The page automatically refreshes the quota every 60 seconds, or you can manually click Refresh to pull immediately. UI text follows the DSH language settings and supports both English and Chinese.
Installation and Enabling¶
Install via npm:
dsh plugin --profile web add dsh-model-sync
You can also install from the GitHub source. The source package comes with a prebuilt lib/ directory, so allowBuilds is not required:
dsh plugin --profile web add github:jiay98528-dev/dsh-model-sync
The plugin comes with a cordis.patch.yml bundle patch (dsh.bundle) and declares dsh.client.immediately: true. It takes effect immediately after installation without manual configuration. After completing the steps above, restart dsh web, refresh the page, and open Settings → Model Sync. If the list is empty, click Refresh.
Typical Usage¶
Syncing the Model List¶
- Open Settings → Model Sync.
- Click Refresh if the list is empty.
- Check the provider ID,
baseURL, and model chips on each card. IDs with a blue border indicate they have not yet been written to settings. Click Apply N new models to write them tollm-pi-ai.providers.<id>.models. - The Enable plugins collapsible block at the bottom of the page can toggle this plugin and the optional
sub-model-access. It writes a disabled flag tocordis.patch.ymland takes effect immediately.
Viewing Quotas¶
- Open Settings → Usage.
- View the remaining percentage, vendor cumulative count, and reset countdown for the 5-hour/7-day windows of each Provider line by line; check the pay-as-you-go line for
current / baseline. If necessary, click Use current balance as baseline to reset the baseline. - The page automatically refreshes every 60 seconds. If you can’t wait, click Refresh.
The quota sources for each Provider are as follows:
| Provider | Window | Source |
|---|---|---|
openai-codex |
5h / 7d | chatgpt.com/backend-api/wham/usage |
kimi-coding |
5h / 7d | api.kimi.com/coding/v1/usages |
zai |
5h / 7d | api.z.ai/api/monitor/usage/quota/limit |
minimax-cn |
5h / 7d | api.minimaxi.com/v1/api/openplatform/coding_plan/remains |
xai |
7d | grok.com gRPC-web, ported from CC Switch |
deepseek-official |
Balance | api.deepseek.com/user/balance |
xiaomi |
No data | No public API |
Viewing the Ring in the Session¶
- Select the model as usual.
- Look at the ring to the right of the model name in the input box. It follows the session model and changes when the model is switched.
- Hover over the ring to view the detail card, titled
provider / model, where each line shows the remaining percentage and countdown for a specific window.
Configuration¶
The default configuration for the plugin is as follows:
- id: model-sync
name: dsh-model-sync
config:
profile: web
pollMs: 60000
Two configuration items:
| Config Item | Default Value | Description |
|---|---|---|
profile |
web |
Which $DSH_HOME/profiles/<name> to read/write |
pollMs |
60000 |
Poll interval parameter, minimum 5000. The page currently refreshes quota every 60 seconds. |
Applicable Scenarios and Notes¶
Suitable for users who connect multiple providers to DSH simultaneously and do not want to leave the current interface to check the model list and quotas. There are a few points to note before use:
- Quota calls use credentials already stored in DSH; the plugin itself does not save any keys.
- The DeepSeek pay-as-you-go baseline is stored in
$DSH_HOME/profiles/<profile>/model-sync.baseline.json. Readings higher than the stored baseline are treated as a top-up, and the baseline is reset. - The ring position is bound to the DSH 0.1.0-rc.6 composer class names. The DSH version update may require adaptation.
- Host code is located under
node_modules. After modifying and rebuilding this package, restartdsh web. For client-side changes, simply refresh the page. xiaomidoes not have a public plan API, so the plugin has no data for it.
Additionally, the plugin runs with the permissions of the current dsh process. Before installing any plugin, it is recommended to review its source code and license. This plugin is MIT, and its source code is available on GitHub for direct review.
Conclusion¶
To summarize: dsh-model-sync does two things—it synchronizes the latest model list of each Provider into DSH settings and visualizes the 5-hour/7-day window and pay-as-you-go balance as progress bars and input box rings; it comes with a bundle patch and takes effect immediately upon installation. If you maintain a multi-provider DSH environment, it is worth installing a copy to try.
- GitHub: https://github.com/jiay98528-dev/dsh-model-sync
- Community Plugin Directory Listing Page (Community maintained, no official affiliation with DeepSeek / Huaxuan): https://www.skillhub.cn/plugins/jiay98528-dev/dsh-model-sync