dsh-plugin-model-provider: Append the platform to the model name

Introduction

In DSH’s chat interface, the model selector only displays the model name. When connecting to multiple platforms simultaneously (e.g., DeepSeek account, Trae Enterprise), it is difficult to distinguish at a glance which platform a model like DeepSeek-V4-Flash belongs to when they share the same name. If called incorrectly, one can only trace back the conversation history.

Below, I will introduce dsh-plugin-model-provider, maintained by Menpengpeng. It appends the name of the model’s platform to the model name in the “Model” row of the model selection popup and the model button above the input box. It is purely a UI decoration: the dropdown candidate list remains unchanged, and it does not modify the actual requests.

What is this

One-sentence positioning: A DSH client plugin that renders the “Model → Platform” mapping onto the interface, without participating in model routing.

  • Repository: https://github.com/Menpengpeng/dsh-plugin-model-provider
  • Directory Page: https://www.skillhub.cn/plugins/Menpengpeng/dsh-plugin-model-provider
  • Maintainer: Menpengpeng
  • Category: Model Inference
  • License: MIT

Core Features

The README states that the scope of effect covers three locations:

Location Effect
Model button above the input box DeepSeek-V4.1-Flash (DeepSeek Account)
“Model” row in the popup DeepSeek-V4.1-Flash (DeepSeek Account)
Each item in the dropdown candidate list Remains unchanged, without the platform name

The platform name is displayed in a secondary text color and slightly smaller font size, which does not affect the primary visual focus of the model name itself.

The README also states that starting from version 0.0.2, it has been changed to pure DOM decoration, no longer replicating the official 1017 badge logic, as this badge has been removed in newer DSH hosts.

Implementation Details

Key points described in the README:

  • Does not register any slots. Reason: Plugins like dsh-codex-subscription occupy the conversation.input.model single slot without declaring the conversation.input.model.label child slot, causing registrations based on slots.inject to not execute at all; moreover, this child slot is single, so multiple connectors will compete with each other.
  • Wraps Response.prototype.json/text to learn the “Model → Platform” mapping from the host’s own /api/session/modelCatalog response. The host connection layer caches the fetch reference, so wrapping fetch is ineffective.
  • When opening the model menu, it supplements learning from group titles and candidate text as a fallback.
  • Uses CSS ::after and the data-mp-platform attribute to append the platform name, without modifying React child nodes, so it won’t be cleared by re-renders.
  • Automatically removes trailing bracket qualifiers from the platform name to avoid double brackets; compatible with suffixes like Hy4 · x0.29 during matching.

Cost: Relies on the DOM class name group .codexModelSelect*, selectors need to be adjusted synchronously when the host undergoes major updates.

Installation and Activation

The README provides two methods. Method 1 is file dependency, suitable for local development:

  1. Place this directory in the workspace or any location.
  2. Edit package.json in the profile directory (usually ~/.dsh/profiles/desktop/):
{
  "dependencies": {
    "dsh-plugin-model-provider": "file:/path/to/dsh-plugin-model-provider"
  },
  "dsh": {
    "profile": {
      "bundles": ["dsh-plugin-model-provider"]
    }
  }
}
  1. Append to the end of cordis.patch.yml in the profile:
# Local plugin: Append platform name to model name in the "Model" row and the model button above the input box.
- insert:
    - id: ui-model-provider-label
      name: 'dsh-plugin-model-provider'
  1. Copy the plugin to ~/.dsh/profiles/desktop/node_modules/dsh-plugin-model-provider/.
  2. Restart DeepSeek Harness.

Method 2 is dsh plugin add:

dsh plugin add /path/to/dsh-plugin-model-provider

The README suggests that certain versions of DSH’s dsh plugin add have file lock issues (reporting EPERM on package.json.lock); in this case, please use Method 1 for manual installation.

Typical Effects

The screenshot examples given in the README:

Popup:
  Model    DeepSeek-V4-Flash (Trae Enterprise) ›
  Reasoning Level  high ›

Model button above input box:
  [DeepSeek-V4-Flash (Trae Enterprise) ▾]

Dropdown candidate list:
  DeepSeek-V4-Flash          ← No platform name
  gpt-6-sol
  kimi-k3

Compatibility

  • DeepSeek Harness >= 0.2.1-rc.3
  • React ^18.2.0
  • Web platform only (dsh.client.platform: "web")

In package.json, version is 0.0.2, private: true. The file structure is package.json (plugin manifest), cordis.patch.yml (bundle patch declaration), lib/index.js (server entry, empty apply), and lib/client.js (browser-side component).

The README also mentions encoding constraints: all files must use UTF-8 without BOM. DSH’s resolveMeta() reads package.json using JSON.parse(readFileSync(path, "utf8")) without removing BOM; if BOM is present, it throws a SyntaxError: Unexpected token '\uFEFF'. This is consistent with all official plugins.

Rollback

Delete node_modules/dsh-plugin-model-provider/, remove this plugin from dependencies and dsh.profile.bundles in the profile’s package.json, delete the insert segment at the end of cordis.patch.yml, and restart to restore.

Applicable Scenarios and Notes

Suitable for: DSH users who connect to multiple model platforms simultaneously and wish to see the current model’s platform directly on the interface; and plugin developers who want to reference an implementation path like “bypassing slot occupation and using DOM decoration”.

Note: The plugin runs with the permissions of the current DSH process. You should check the source code and license (MIT) yourself before installing. It only affects the interface display and does not change model routing; the accuracy of the platform name depends on the content returned by the host’s /api/session/modelCatalog. Additionally, it relies on the .codexModelSelect* class name, so adjustments are needed if the host undergoes major structural updates.

DSH’s philosophy is “Everything is a plugin”. The directory page mentioned above is an independent community site with no official affiliation with DeepSeek or Hyperbolic.

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

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

Xiaoye