DSH Custom Provider Reasoning: Completing Reasoning Levels for DSH Custom Providers

Preface

In DSH, the composer’s model selector relies on model-side inference metadata to display selectable thinking intensities. For custom providers, such models often lack the reasoningEfforts declaration, resulting in the inability to select inference levels in the interface.

dsh-custom-provider-reasoning is a DSH host plugin designed to fill this gap: it enables all models from custom providers to have selectable thinking intensity (reasoning effort) in the model selector and ensures that the selection is actually sent to the endpoint.

What This Is

dsh-custom-provider-reasoning is maintained by 534119219 and is licensed under MIT.

It targets DSH’s custom providers, addressing three categories of issues:

  • Models do not have selectable inference levels;
  • Handwritten routes lack maxTokens or contextWindow;
  • Route-level compat needs to be manually maintained across different protocols.

It depends on the following packages:

  • @deepseek-ai/schemastery ^3.18.1
  • @earendil-works/pi-ai ^0.82.1

Core Features

Below are the capabilities it currently supports.

  • Enables all models from custom providers to select thinking intensity, i.e., inference level, in the composer model selector.
  • The selection is actually sent to the endpoint through the native adapter.
  • Automatically writes reasoningEfforts for eligible model entries, with default levels being off / low / medium / high / xhigh / max.
  • Automatically fills in missing maxTokens and contextWindow, with default values of 384000 and 1000000, respectively.
  • Detects protocol types and manages route-level compat: under openai-completions, it can add thinkingFormat: deepseek for deepseek models and add supportsDeveloperRole: false for declared routes.
  • When switching between openai-completions, openai-responses, and anthropic-messages protocols, it automatically strips inapplicable thinkingFormat / supportsReasoningEffort.
  • Supports configuration via the profile’s cordis.patch.yml or plugin settings page for enabled, scope, verify, maxTokens, contextWindow, thinkingFormat, defaultEffort, supportsDeveloperRole, and levels.
  • Injection is idempotent: existing reasoningEfforts, or handwritten maxTokens / contextWindow, will not be overwritten.

Installation and Activation

The plugin needs to be added to the web profile, typically located at ~/.dsh/profiles/web.

First, add the dependency to the dependencies section of ~/.dsh/profiles/web/package.json:

"dsh-custom-provider-reasoning": "github:534119219/dsh-custom-provider-reasoning"

Then, ensure that dsh.profile.bundles includes the plugin name. When actually writing, append this item to the end of the existing bundles list:

{
  "dsh": {
    "profile": {
      "bundles": [
        "dsh-custom-provider-reasoning"
      ]
    }
  }

Execute the installation within the profile directory:

cd ~/.dsh/profiles/web
pnpm install

Restart the DSH web:

dsh web

After startup, the plugin will automatically write reasoningEfforts to the custom route model entries in ~/.dsh/settings.yaml.

Typical Usage

After startup, open the composer and select a model from a custom provider. You can then view the inference levels in the model selector, such as Default / Off / Low / Medium / High.

If the endpoint does not recognize reasoning_effort, you can change the model’s reasoningEfforts in settings.yaml to the spelling supported by the endpoint, or set it directly to false to disable:

llm-pi-ai:
  providers:
    scnet:
      models:
        - id: DeepSeek-V4-Pro
          reasoningEfforts:
            off:
            low: low
            medium: medium
            high: high

This example is only intended to illustrate the configuration format. The specific field names, model IDs, and endpoint capabilities should be based on your settings.yaml and what the endpoint actually supports.

Configuration

The plugin can be configured via the profile’s cordis.patch.yml or plugin settings page:

- id: dsh-custom-provider-reasoning
  name: 'dsh-custom-provider-reasoning'
  config:
    enabled: true
    scope: declared
    verify: false
    maxTokens: 384000
    contextWindow: 1000000
    thinkingFormat: false
    defaultEffort: max
    supportsDeveloperRole: false
    levels:
      off:
      low: low
      medium: medium
      high: high
      xhigh: xhigh
      max: max

A few key points:

  • enabled is the master switch, defaulting to true.
  • maxTokens and contextWindow are only backfilled when the corresponding fields are missing; existing handwritten values will not be overwritten.
  • defaultEffort manages the route-level default inference level, defaulting to max; it is written when the route does not declare it, existing values are not overwritten; setting it to false disables this management.
  • supportsDeveloperRole defaults to false, meaning it automatically adds compat.supportsDeveloperRole: false for declared routes; setting it to true instead adds true.
  • thinkingFormat defaults to false, meaning thinkingFormat is not automatically written; if the endpoint truly requires the DeepSeek dialect, you can change it to deepseek.
  • The keys of levels must be pi-ai thinking levels, and there must be at least one level other than off; otherwise, the plugin will refuse to start.

Applicable Scenarios and Considerations

It is suitable for scenarios where you use the DSH host, connect models through custom providers, and want to select inference levels directly in the composer.

Before installation, note: the plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before deciding to add it to the profile.

Additional considerations:

  • By default, it injects OpenAI-compatible reasoning_effort vocabulary; if the endpoint does not recognize reasoning_effort, requests may fail.
  • new-api / one-api gateway families reject the developer role; the plugin automatically adds compat.supportsDeveloperRole: false for declared routes.
  • maxTokens / contextWindow are only backfilled when fields are missing; existing handwritten values are not overwritten.
  • Existing handwritten reasoningEfforts values always take precedence; the only exception is when they exactly match the built-in default dictionary, which will be refreshed when levels changes.
  • Restarting the GUI is required to load the plugin itself; adding or editing custom providers does not require a restart.

Conclusion

The value of dsh-custom-provider-reasoning lies in consolidating the problems of missing inference levels for custom providers, missing token/context fields, and difficult compat maintenance during protocol switching, all handled uniformly within the DSH host plugin.

Repository address: https://github.com/534119219/dsh-custom-provider-reasoning

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

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

Xiaoye