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
maxTokensorcontextWindow; - Route-level
compatneeds 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
reasoningEffortsfor eligible model entries, with default levels beingoff / low / medium / high / xhigh / max. - Automatically fills in missing
maxTokensandcontextWindow, with default values of384000and1000000, respectively. - Detects protocol types and manages route-level
compat: underopenai-completions, it can addthinkingFormat: deepseekfordeepseekmodels and addsupportsDeveloperRole: falsefordeclaredroutes. - When switching between
openai-completions,openai-responses, andanthropic-messagesprotocols, it automatically strips inapplicablethinkingFormat/supportsReasoningEffort. - Supports configuration via the profile’s
cordis.patch.ymlor plugin settings page forenabled,scope,verify,maxTokens,contextWindow,thinkingFormat,defaultEffort,supportsDeveloperRole, andlevels. - Injection is idempotent: existing
reasoningEfforts, or handwrittenmaxTokens/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:
enabledis the master switch, defaulting totrue.maxTokensandcontextWindoware only backfilled when the corresponding fields are missing; existing handwritten values will not be overwritten.defaultEffortmanages the route-level default inference level, defaulting tomax; it is written when the route does not declare it, existing values are not overwritten; setting it tofalsedisables this management.supportsDeveloperRoledefaults tofalse, meaning it automatically addscompat.supportsDeveloperRole: falsefordeclaredroutes; setting it totrueinstead addstrue.thinkingFormatdefaults tofalse, meaningthinkingFormatis not automatically written; if the endpoint truly requires the DeepSeek dialect, you can change it todeepseek.- The keys of
levelsmust bepi-aithinking levels, and there must be at least one level other thanoff; 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_effortvocabulary; if the endpoint does not recognizereasoning_effort, requests may fail. new-api/one-apigateway families reject thedeveloperrole; the plugin automatically addscompat.supportsDeveloperRole: falsefordeclaredroutes.maxTokens/contextWindoware only backfilled when fields are missing; existing handwritten values are not overwritten.- Existing handwritten
reasoningEffortsvalues always take precedence; the only exception is when they exactly match the built-in default dictionary, which will be refreshed whenlevelschanges. - 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