Introduction¶
In DSH, the native way to switch models is to type /model and click in a popup menu. While this flow works fine on desktop, two scenarios interrupt the rhythm: first, using an IM bot on a mobile device where there is no panel to click; second, during a discussion, wanting to hand off the remaining task to another model without leaving the conversation interface.
dsh-nl-model-switch addresses this gap: simply say “switch to deepseek-v4-flash” in the chat. The current session’s model switches, context is preserved, and the new model continues processing your previous request.
What is this¶
dsh-nl-model-switch is a DSH host plugin created by passingby000, licensed under MIT, current version 0.1.1. In short, it switches the current DSH session model using natural language without leaving the conversation interface or memorizing commands.
DSH’s philosophy is “everything is a plugin”. This plugin is a pure host plugin with zero client UI dependency—it does not modify any client interface, and the switching happens at the session layer. Therefore, regardless of whether you use the Web panel, TUI, or chat interfaces via IM bridges like WeChat or Feishu, you can switch models directly within the conversation.
Core Features¶
- Natural language one-sentence switch of the current session model, e.g., “switch to deepseek-v4-flash”
- Cross-interface effectiveness: Works on Web panel, TUI, and IM bots (WeChat, Feishu, etc.)
- Switching is completed within the same session, preserving context and conversation history
- After switching, the new model confirms the switch and seamlessly continues processing the original request
- Complementary to the native
/modelcommand; both can coexist as they share the underlying session-level model selection interfacesessions.selectModel - Pure host plugin, zero client UI dependency, no modification of the client interface
How it works¶
The plugin’s operation is divided into three steps:
- Register a
switch_model(provider, model)tool with the model. The execution body calls the same public interface as the native/model,ctx.apiProxy.sessions.selectModel, to set the session-level model selection, which takes effect during the next prompt assembly. - Guide the model via system prompt: when the user requests to change the model in natural language, call
switch_model; after switching, explicitly confirm and continue the user’s request. - The
tools/resulthandler ends the current turn of the old model afterswitch_modelsucceeds, opening a new turn with the new model to send a confirmation and continue processing the original request. From the outside, it still looks like a normal Q&A pair.
Since the switching happens at the session layer rather than the interface layer, it naturally applies to Web, TUI, and various chat interfaces connected via IM bridges.
Installation and Enablement¶
dsh plugin add dsh-nl-model-switch
After installation, restart dsh web to load the new bundle; the plugin will only take effect after that.
The runtime environment requires Node >= 18 (from the engines field in package.json).
There are two prerequisites before use:
- The target model is already registered in DSH’s
settings.yaml, i.e., written in theproviders.*.modelslist of the corresponding provider. - The model needs to be able to recognize and call the
switch_modeltool; mainstream models all support this.
Typical Usage¶
In a conversation on any interface, directly speak in natural language:
切换到 deepseek-v4-flash 模型
切到 deepseek-v4-pro
换到 glm-5.3,帮我翻译这段文字
用 deepseek-v4-flash 模型重新回答
switch to deepseek-v4-flash model
After the model recognizes the intent to switch models, it will call the switch_model tool to complete the switch; after the new model confirms, it continues to process your previous request. For example, “换到 glm-5.3,帮我翻译这段文字” (Switch to glm-5.3, help me translate this text), the translation task will be continued by the switched model.
Suitable Scenarios and Notes¶
Suitable for two types of users:
- Users who mainly communicate with DSH via IM bots (WeChat, Feishu, etc.) and find it inconvenient to operate a panel; a single sentence allows switching models and continuing tasks.
- Users who need to switch models mid-long conversation; switching does not lose context.
Notes before installation and use:
- The plugin runs with the permissions of the current dsh process. It is recommended to read the source code to confirm its behavior before deciding whether to install it.
- The license is MIT, which is marked in both the README and package.json.
- The native
/modelcommand is still available; both can coexist without conflict.
Troubleshooting¶
- Switching command was said but the model didn’t actually switch: The current model might have just verbally answered “switched” without actually calling the
switch_modeltool. Try switching to a model with better tool support. - Prompt “Model not registered”: Confirm that the target model ID is written under the corresponding provider in
settings.yaml. - Not effective after installation: Restart
dsh webto load the new bundle.
Summary¶
The value of dsh-nl-model-switch lies in turning “switching models” from an interface operation into part of the conversation: one sentence, within the same session, context is preserved, and it coexists with the native /model. If you frequently use DSH in IMs or need to switch models without interrupting your current task, you can give it a try.
- Plugin Directory Page: https://www.skillhub.cn/plugins/passingby000/dsh-nl-model-switch
- GitHub Repository: https://github.com/passingby000/dsh-nl-model-switch
The directory page is maintained independently by the community and has no official affiliation with DeepSeek or Huanfang.