dsh-model-reasoning-effort: Restoring reasoning effort editing for custom pi-ai models

Introduction

When using DSH to connect to third-party proxies or self-hosted gateways, it is usually necessary to manually add provider and model entries in the official “Models” page. The pi-ai adapter itself supports reasoningEfforts in models[], but the official “Models” settings page deliberately does not provide an editor for this field: reasoning intensity varies by model capability, and provider-level controls can only be set to a value that a model would reject. The result is that to see thinking levels like low / high in the Composer model selector, one must manually modify the configuration files.

The plugin introduced below is a patch for this gap. It is maintained by pwkazn, belongs to the “Model Reasoning” category in the community directory, has 0 stars currently, is licensed under MIT, and is version 0.1.0. The plugin does something narrow: it adds the editing interface for reasoningEfforts back to the Web GUI, without modifying the adapter or affecting other models.

What is this

One-sentence definition: A plugin for the DeepSeek Harness to declare reasoning intensity (thinking levels, and the actual values sent to the gateway for each level) for custom pi-ai model declarations.

  • Maintainer: pwkazn
  • Repository: https://github.com/pwkazn/dsh-model-reasoning-effort
  • License: MIT
  • Current Version: 0.1.0

The specific problem it solves is: The official settings page lacks the reasoningEfforts control, while custom models (like OpenAI-compatible or Anthropic Messages proxies) often need to declare which thinking levels they support per model. The plugin adds a “Reasoning Intensity (Custom Models)” panel at the bottom of the “Settings → Models” page, turning this into an interactive UI operation.

Core Features

The following capabilities are all from the README; no additional inferences were made.

  1. Panel Mounting: The panel is mounted at the bottom of the Models page. The plugin registers the settings.models.footer list slot, does not occupy the llm-pi-ai key of settings.models.provider-card, and can coexist with extensions from other providers.
  2. Per-Model Three-State: Corresponding to three declaration methods:
    - Inherit: Don’t declare, keeping built-in directory or provider capabilities.
    - No Reasoning: Write reasoningEfforts: false, the model selector no longer offers thinking levels.
    - Declare Levels: Check off / minimal / low / medium / high / xhigh / max, and fill in the actual value to send for each level.
  3. Level and Value Separation: For example, if high is filled with ultra, when Composer selects High, the gateway receives the parameter ultra; off left blank means “supported, but no reasoning parameters are sent”.
  4. Batch Application: Write the same set of levels to all models of a provider at once, suitable for gateways with unified levels.
  5. Pre-Write Validation: Validation rules are consistent with the adapter: declaration must include levels other than off; levels other than off must have non-empty sending values. When a draft is rejected, the reason is explained directly, rather than waiting for a runtime failure.
  6. Write via Official Route: It uses settings.mutate to replace the provider’s complete models array, preserving fields the plugin does not edit (id, name, context window, input modality, compat, etc.), and carries a revision to prevent concurrent overwrites.
  7. Bilingual Interface: The interface is bilingual (Chinese/English), switching according to the interface language.

Installation and Usage

Install from GitHub, no build required, pure ESM with hand-written client bundle:

dsh plugin --profile web add git+https://github.com/pwkazn/dsh-model-reasoning-effort.git

The README also gives an alternative method: copy to the profile’s node_modules, then select it via the plugin manager. This is marked as not recommended in the original text because it is easy to lose it during the next installation.

After restarting or hot reloading, open “Settings → Models”, and “Reasoning Intensity (Custom Models)” will appear at the bottom of the page.

Dependency constraints come from package.json:

{
  "dsh": { "engines": { "dsh": ">=0.2.0-rc.2" } },
  "peerDependencies": {
    "@deepseek-ai/dsh": ">=0.2.0-rc.2",
    "react": "^18.2.0"
  },
  "engines": {
    "node": "^22.19.0 || >=24.0.0"
  }
}

In other words, DSH needs at least 0.2.0-rc.2, and Node needs ^22.19.0 or >=24.0.0.

Typical Usage

The following is the 4-step process given in the README.

  1. First, configure custom model providers in the official “Models” page, such as OpenAI-compatible or Anthropic Messages proxies.
  2. Expand that provider in the bottom panel.
  3. Click “Edit” on a specific model, select “Declare Levels”, check the desired levels and fill in the sending values; or use the batch area to apply to all models at once.
  4. After saving, the Effort levels for that model can be seen in the Composer’s model selector.

A small example: A proxy gateway provides models according to the OpenAI-compatible protocol, with level mapping low → minimal, medium → medium, high → ultra. In the panel, check these three levels for that model, enter the corresponding sending values, and save.

The plugin’s pure logic validation command is:

npm test   # Three-state projection, sending value validation, full table write, hierarchical read

Applicable Scenarios and Notes

Suitable for this type of person: Already using DSH to connect custom pi-ai models, wants to see thinking levels in the model selector, but doesn’t want to manually edit config files or worry about declarations not matching adapter rules.

There are a few things you need to know in advance.

  • Declarations are assertions, not probes. When a gateway rejects a level, the request will fail at runtime. Refer to the endpoint documentation and only declare levels it actually supports.
  • Panel Scope: The panel only edits the llm-pi-ai.providers.<route>.models writable by user settings. If a route directly serves the built-in pi-ai directory and has no models array, the browser side cannot enumerate the directory. The panel will list these routes and prompt to add model rows first.
  • First Save Behavior: The first save will write the provider’s list of valid models entirely to the user layer, consistent with the behavior of the official model editor first materializing the directory. Subsequent changes to the composition layer will not automatically penetrate this layer to overwrite it.
  • Direct Adapter: The plugin does not touch the DeepSeek direct adapter (llm-deepseek). Its levels are determined by deployment strategy and reasoningEffort, and already exist in official settings.
  • Permissions: The plugin runs with the permissions of the current dsh process. The README and target page do not elaborate on the permission model, so you should read the source code and license (MIT) before installing to judge for yourself whether to trust it.

Conclusion

The value of this plugin lies not in adding new capabilities, but in filling the reasoningEfforts that pi-ai already supports but the official interface didn’t expose, into a usable editor, following the adapter’s write path, validation rules, and concurrency protection. If you just want to add levels to custom models, this is a more hassle-free path than modifying configuration files and easier to coexist with the official model editor.

Directory Page: https://www.skillhub.cn/plugins/pwkazn/dsh-model-reasoning-effort
GitHub: https://github.com/pwkazn/dsh-model-reasoning-effort

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

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

Xiaoye