Introduction

When developing agents, it is often necessary to compare results across several models: running the same task with the current model first, then switching models to compare the results; or adjusting the inference level based on task complexity. If you have to manually open the model selector, select a model, and adjust the level every time, it becomes tedious after a few iterations.

DSH’s philosophy is “everything is a plugin.” Such high-frequency, small operations are perfect for being made into plugins. The dsh-plugin-model-switcher introduced below is exactly such a plugin: it adds two sets of keyboard shortcuts to DSH’s web client—one set to switch models, and one to switch inference levels—with a toast notification to confirm after each switch.

What is it

dsh-plugin-model-switcher is maintained by Mrlilili, with the current version 0.1.0 and a license of MIT (indicated in both README and package.json). It solves a very specific problem: allowing model and inference level switching without leaving the keyboard.

The plugin consists of two parts: Host and Client:

  • Host (src/index.ts) is responsible for the actual switching logic and persistence;
  • Client (src/client/index.ts) is responsible for shortcut key listening, toast display, and updating the model selector UI.

In package.json, the client bundle’s platform is web. The injected dependencies are four: @deepseek-ai/dsh-client-runtime, @deepseek-ai/dsh-client-ui-slots, @deepseek-ai/dsh-client-ui-conversation, and @deepseek-ai/dsh-client-modules; the peerDependencies is @deepseek-ai/cordis.

Core Features

Two Sets of Shortcuts

Shortcut Function
Ctrl+Shift+M / Cmd+Shift+M Cycle through the model list of the current Provider
Ctrl+Shift+R / Cmd+Shift+R Cycle through inference levels: off → low → high → max → off

After each switch, a toast notification will pop up in the bottom right corner to confirm the currently switched model or inference level.

How Switching is Completed Internally

On the Host side (src/index.ts), it does three things:

  1. Read the current model selection from agentDefaultModel;
  2. Cycle through the model list of the current Provider via llm.listModels(), or cycle through inference levels via llm.resolveModelInfo();
  3. Persist the new selection using agentDefaultModel.saveSelection().

On the Client side (src/client/index.ts), it is responsible for the interaction layer:

  1. Register a toast overlay in the shell.overlay slot;
  2. Listen for Ctrl/Cmd+Shift+M and Ctrl/Cmd+Shift+R during the capture phase of the document;
  3. Call the Host handler via host.call(), and after obtaining the result, update the model selector UI through modelDirectories.directoryFor(sessionId).select().

In other words, the keyboard shortcut switching and the model selector on the interface share the same state: after switching with a shortcut, the selector UI will be updated synchronously.

Installation and Enablement

First, confirm that DSH is installed on your machine, then execute:

dsh plugin --profile web add https://github.com/Mrlilili/dsh-plugin-model-switcher.git

Note the --profile web in the command: The client bundle of this plugin targets the web platform. After installation, you need to restart DSH for the plugin to take effect.

Typical Usage

After restarting DSH, no additional configuration is needed; simply use the shortcuts:

  1. Press Ctrl+Shift+M (Cmd+Shift+M on macOS) to switch to the next model in the current Provider’s model list; the toast in the bottom right will indicate the current selection;
  2. Press Ctrl+Shift+R (Cmd+Shift+R on macOS) to cycle through inference levels in the order off → low → high → max → off. Each switch is confirmed with a toast;
  3. The switching result is persisted by the plugin, and the model selector on the interface displays the latest selection synchronously.

Suitable Scenarios and Notes

Suitable scenarios:

  • Developers who need to quickly compare outputs across multiple models;
  • People who want to adjust inference levels based on task complexity and don’t want to open the selector every time.

Points to note before installation:

  • The plugin runs with the permissions of the current dsh process. It is recommended to browse the source code (https://github.com/Mrlilili/dsh-plugin-model-switcher) before installing third-party plugins to ensure the logic meets your expectations;
  • This plugin uses the MIT license. Please confirm yourself that the license terms meet your scenario before installing and using;
  • The installation command uses --profile web. If your usage environment is not a web client, this plugin is not applicable.

Summary

dsh-plugin-model-switcher focuses on a specific task: binding model and inference level switching to two sets of keyboard shortcuts, accompanied by toast confirmation and selector synchronization, keeping high-frequency operations on the keyboard. You can complete installation and enablement by following the steps above. The plugin is lightweight, and the division of labor between Host and Client is clear. It is suitable to read as a reference implementation for “everything is a plugin.”

  • Community Plugin Directory: https://www.skillhub.cn/plugins/Mrlilili/dsh-plugin-model-switcher
  • GitHub Repository: https://github.com/Mrlilili/dsh-plugin-model-switcher

It should be noted that skillhub.cn is an independent community plugin directory site and has no official affiliation with DeepSeek or Xiaofang.