dsh-model-priority:Customizing the order of models and providers in DSH

Preface

When selecting models in DeepSeek Harness (DSH), the list order typically follows the adapter registration order, which often pushes frequently used models to the back. As of upstream discussions dated 2026-09-10, there is still no official entry point for “adjusting model order.” The community plugin dsh-model-priority (maintainer: menge237, category: client) fills this gap: it lets you drag-and-drop to reorder via the settings page or sidebar, causing the host listModels (and similar) interfaces to return results in your order, and writes the order back to the configuration source-of-truth, auto-backing up before saving.

What This Is

dsh-model-priority is a DSH client-side plugin. Current package version: 0.4.1, MIT licensed, requires DSH >=0.1.2-rc.1. It only handles “list order”: no request routing, failover, or usage tracking. The host renders the settings page and selectors according to the physical order of the models array; the plugin reorders the models array in the source-of-truth to avoid conflicts between two orderings—one on the settings page and another on the selectors.

Catalog page: https://www.skillhub.cn/plugins/mengge237/dsh-model-priority
Source code: https://github.com/mengge237/dsh-model-priority

Core Features

Two Operation Entry Points

  1. Settings → Models: An extension area within the DeepSeek card (slot settings.models.provider-card, key=llm-deepseek), where built-in DeepSeek family models can be dragged within the card.
  2. Sidebar “Model Order” page: Requires dsh-better-sidebar; after selecting a provider from a dropdown, drag-and-drop within the grouped model list to cover custom providers of the llm-pi-ai family.

Default models marked with ★ are pinned and cannot be dragged; “Reset to default” restores the host’s original order. When there are many routed models (e.g., Bailian), they are collapsed and grouped by families like qwen/glm/kimi.

How the Read Side Works

The server wraps a layer on the ctx.llm instance properties so that listProviders(), listConfigurableProviders(), and listModels(provider) return results in a stable order based on the saved sequence; entries not appearing in the order retain their relative positions. Default models declared by agent-default-model are forced back to their original positions when written back.

Persistence and Mirroring

On save, the plugin reorders the models array for that provider in the currently effective source-of-truth. Starting from the 0.1.7 line, the source-of-truth is ~/.dsh/profiles/<p>/cordis.patch.yml; for the 0.1.5 line it is ~/.dsh/settings.yaml. A backup is created before writing (e.g., cordis.patch.yml.bak-<ISO timestamp>); if the content has not changed, neither writing nor backup occurs. Additionally, a copy of ~/.dsh/model-order.json is updated each time “Save” is clicked; deleting it reverts to defaults.

Web↔desktop dual-end mirroring is enabled by default (when writing the active layer, it syncs to other profiles with llm-pi-ai); it can be disabled by setting config: { mirror: false }.

HTTP Routes (Local Access)

Routes are registered on ctx.webServer. The plugin determines the request origin itself (loopback / authoritative Host, non-cross-site, etc.) and returns 403 for cross-origin requests. Local curl is supported, for example:

Route Purpose
GET /dsh-model-priority/state.json Catalog snapshot, current order, hook status
GET /dsh-model-priority/provider-models?route=<route> Current model id order for a given route
PUT /dsh-model-priority/order.json Save order ({"reset":true} clears it)
POST /dsh-model-priority/settings-order Reorder the provider’s models in the source-of-truth according to the given order

Bundled Rotating Proxy (Disabled by Default)

The package also includes a local forwarding layer: pointing a provider’s baseURL to a rotate endpoint, it tries multiple keys in .credentials.yaml sequentially (switching only on 429 / quota exhaustion). There is no page entry; it must be enabled via HTTP by route. See the repo’s docs/rotate-proxy.md for details.

Installation and Activation

The following commands come from the repo’s README. Replace the paths with your local clone directory or the git address you are using:

dsh plugin --profile web add "<local repo directory, or git address>"
dsh plugin --profile web remove dsh-model-priority

After installation, you must restart dsh web: the server-side route registration, hooks, and browser-side boot bundle are all assembled at startup. Order-related files are read on each call, so modifying the files themselves does not require a restart.

If UI slots are unavailable, the settings page card grid may not mount; without dsh-better-sidebar installed, the sidebar page will warn and skip, but card extensions and the HTTP routes above remain available.

Typical Usage

  1. Install the plugin and restart dsh web.
  2. Open Settings → Models, click to expand the “Model order” area in the DeepSeek card, drag and then save; or install dsh-better-sidebar and enter the “Model order” page from the sidebar, select a provider, and drag.
  3. Confirm the list order has changed in the model selector of a conversation or Agent; to restore, click “Reset to default” or delete ~/.dsh/model-order.json.
  4. To check whether hooks succeeded: access GET /dsh-model-priority/state.json and look at hook.ok; when it is false, the reason is displayed at the top of the page, but the order file remains editable.

Developers can run self-tests in the plugin directory (does not start dsh or occupy port 3080):

npm test

Use Cases and Caveats

Suitable for: Users who develop agents long-term under the DSH web profile, have many models under the same provider, and want to push frequently used models to the top of selectors.

Boundaries and permissions:

  • The plugin reads and writes configurations under ~/.dsh/ with the current dsh process permissions; please review the source code and MIT license yourself before installing.
  • It only fully works on hosts where ctx.llm exposes the aforementioned list methods; when hooks cannot attach, hook.ok will be false.
  • Drag-and-drop write-back applies to self-configured providers like llm-pi-ai; within the built-in DeepSeek card, lists outside the source-of-truth are shown read-only.
  • If an adapter cannot list models, the list under that provider will be empty; this is an adapter capability boundary.
  • Sorting is not done by changing provider key order: the host sorts providers via registrationFacts, so simply reordering keys does not take effect immediately at runtime.

The DSH ecosystem philosophy is “everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-model-priority turns the “model list order” from a read-only registration order into a drag-and-drop, persistable behavior consistent with selectors, and backs up settings / cordis source-of-truth before writing. For further details on implementation contracts and test coverage, see the repo’s docs/internals.md and the GitHub README.

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

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

Xiaoye