Introduction

DSH’s extensibility emphasizes “everything is a plugin.” In actual use of model APIs, common issues involve different network paths: some model APIs require proxy access, while others can remain direct; meanwhile, rate limiting or server errors can also interrupt requests.

@superfish058/dsh-llm-proxy is a DSH model proxy plugin used to configure proxies for specific models within DSH and automatically retry failed requests. It does not require a global proxy to be enabled; instead, it directs selected models through the proxy while unselected models remain direct.

The DSH Community Directory is an independent site with no official affiliation to DeepSeek or Huafang, and it is not an official app store.

What is this

One-sentence positioning: DSH Model Proxy Plugin, routing by model (Clash, etc.) + automatic retry on failure, real-time settings in the configuration page.

The maintainer is superfish058, and the license is MIT. The package.json declares engines.node as >=24.

It primarily solves the following types of problems:

  • Only want some models to use the proxy, without affecting other models via a global proxy;
  • When encountering disconnects, HTTP 429, 5xx errors, etc., want automatic retries;
  • Want to adjust, verify, and view model proxy status directly in the DSH settings page.

Core Features

Routing by Model / Target Domain

The plugin applies routing based on the model API address (baseURL host):

  • Selected models are forwarded via proxyHost:proxyPort;
  • Unselected models connect directly;
  • Models under the same API address share proxy settings.

In other words, the routing granularity is the “API address corresponding to the model,” not just a simple model name. Once a model is selected, all models under the same address will use the proxy.

Automatic Retry on Failure

The plugin supports automatic retry for the following types of errors:

  • Disconnect;
  • HTTP 429;
  • 5xx errors.

It retries by default 3 times with an interval of 1s. The retries / retryIntervalMs on the settings card mirror into the selected provider’s official retryPolicy.

Model List Synchronization

The model list is synchronized with DSH’s official model selector. For providers that do not specify models, the plugin can fall back to the pi-ai built-in directory or the official directory.

Multimodal Model Mirroring

The plugin can supplement image input declarations for models that “support image recognition but are not declared/UI entry points in the official statement.”

Note: This capability is only meaningful for models that truly support image input. If a pure text model is checked, DSH may allow it, but the actual request may still fail because the model does not support images.

Test Connection

The “Test Connection” provided on each line of the settings page can display:

  • HTTP status;
  • Latency;
  • Proxy/Direct;
  • Multimodal status;
  • Or the provider’s error body.

The test connection uses the saved configuration and only validates a non-streaming probe once. For streaming or long conversations, it is still recommended to use a real session to confirm.

Technical Implementation

The plugin uses undici global Dispatcher injection:

  • RoutingDispatcher routes by hostname;
  • RetryAgent handles retries.

At the same time, the plugin registers the llm-proxy settings namespace via the Cordis plugin and provides browser-side settings cards.

After saving, the configuration is written to the llm-proxy namespace, and the dispatcher is replaced at runtime, without modifying the vendor configuration in settings.yaml.

Installation and Activation

It is recommended to install the npm package:

dsh plugin --profile web add @superfish058/dsh-llm-proxy

If doing local source code debugging, you can use:

dsh plugin --profile web add C:/path/to/dsh-llm-proxy

After modifying the source code, a rebuild is required:

npm run build

If prompted for build authorization, you need to add @superfish058/dsh-llm-proxy to the profile’s pnpm-workspace.yamlonlyBuiltDependencies.

After installation is complete, you need to restart dsh web: exit via the tray, then restart.

Typical Usage

  1. Go to the DSH settings page “Plugins → Configurable Plugins → Model Proxy”.

  2. Check the models that need to use the proxy. The default proxy address is 127.0.0.1:7897, and you can configure proxyHost / proxyPort.

  3. After modifying the proxy selection or proxy address, click “Save” first, then use “Test Connection” in the settings page to verify.

  4. After restarting, confirm the appearance of the following in the logs:

dsh-llm-proxy: global dispatcher → RetryAgent(RoutingDispatcher) (proxy=127.0.0.1:7897, ...)

Afterwards, you can use the checked models to initiate real requests to confirm that selected models go through the proxy and unselected models connect directly.

Use Cases and Notes

Suitable for the following situations:

  • Need some model APIs to go through the proxy, while the rest remain direct;
  • Requests might be interrupted by disconnects, 429, 5xx, and require automatic retries;
  • Want to configure proxies by model granularity rather than globally enabling the proxy.

Notes to be aware of:

  • Routing takes effect based on the model API address (baseURL host), and models under the same address share proxy settings;
  • Multimodal model mirroring is only meaningful for models that truly support image input;
  • “Test Connection” uses the saved configuration and only validates once for a non-streaming probe;
  • The plugin runs with the permissions of the current dsh process; source code and license should be checked before installation. This plugin is under the MIT license.

Links

Directory Page:

https://www.skillhub.cn/plugins/superfish058/dsh-llm-proxy

GitHub:

https://github.com/superfish058/dsh-llm-proxy