In everyday DSH (DeepSeek Harness) development, updating the model list and monitoring usage are two frequent pain points. DSH’s built-in model discovery mechanism returns the static catalog from build time for installed providers (such as GLM Coding and MiniMax); newly released models only appear after a pi-ai update. At the same time, the native interface lacks display of real-time usage across provider types. The dsh-better-model-select plugin addresses these two issues through API synchronization and an RPC channel.
This is a DSH plugin designed to keep the model list updated in real time in line with each provider’s APIs, and to display each provider’s real-time usage below the native session statistics line. The plugin is maintained by sxy-kumako and belongs to the network tool category.
Real-Time Model List Synchronization¶
DSH’s built-in model discovery returns the static catalog from build time for providers already present in the pi-ai catalog, without ever requesting remote endpoints. This plugin fills that gap:
- Scheduled reads: The plugin reads every route configured under
llm-pi-ai.providersevery 30 minutes (including at startup). - API requests: Using the route’s credentials (resolved through the DSH credential store), it requests the provider’s model-list endpoint (OpenAI-compatible
GET {baseURL}/modelsor Anthropic-compatible format). - Merge and write: It merges the remote list with the installed catalog. Existing models in the catalog remain unchanged (bare
{id}entries automatically inherit full catalog definitions), and newly added remote models generate full entries based on same-family catalog models. User-written entries always take precedence and are never deleted. - Real-time effect: Results are written to the route’s
modelssettings list. The model selector takes effect immediately, without a restart. - Fault tolerance: A failed remote request writes nothing; if the write is rejected by
llm-pi-aivalidation, only a log entry is created and the original value is retained.
Usage Badges and Colors¶
The plugin exposes usage data to the host through the RPC channel /dsh-better-model-select.
- Displayed content:
- GLM / MiniMax: Displays remaining coding-plan quota (5-hour window + weekly window).
- DeepSeek / OpenRouter / Kimi: Displays cash balance.
- Color coding:
- Remaining >30%: green
- Remaining ≤30%: orange
- Remaining ≤10%: red
Installation and Enablement¶
- Enter the DSH profile directory:
cd ~/.dsh/profiles/<你的 profile> # 例如 desktop 或 web
- Remove the old plugin copy (must delete before updating; do not overwrite in place):
rm -rf node_modules/dsh-better-model-select
- Copy the new plugin into node_modules:
cp -R ~/.dsh/plugins/dsh-better-model-select node_modules/
- Restart DSH Desktop.
Typical Usage¶
- Immediate effect: After the configuration is written to the
modelssettings, the model selector takes effect immediately without a restart. - Manual model-list sync: In a session, enter
/dsh-better-model-select?syncModels. - Force-refresh usage data: In a session, enter
/dsh-better-model-select?quota=force.
Use Cases and Cautions¶
- Direct connection mode: The 127.0.0.1:9999 proxy built into historical versions has been removed; provider requests use native direct connections through DSH (pi-ai).
- Data security: Credentials are resolved through the DSH credential store and are not written to logs. A failed remote request writes nothing.
- Permissions and source code: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.
The plugin resolves delayed model lists and opaque usage by using scheduled synchronization and RPC exposure. For more details and source code, see: GitHub.