AI Agent Hub
Back to plugins
🤖

dsh-llm-gateway-compat

Model Inference Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install snowshadow/dsh-llm-gateway-compat

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install snowshadow/dsh-llm-gateway-compat in your DeepSeek Harness terminal to install the plugin; the full source repository is at https://github.com/snowshadow/dsh-llm-gateway-compat .

About this plugin

When wiring DeepSeek Harness to third-party or compatibility gateways, two failure modes keep surfacing: stray SSE fragments carrying empty id or name fields silently overwrite the identity a tool call already established, and dialect mismatches around developer-role or max_completion_tokens trigger 400 rejections that force manual config edits and re-sends. dsh-llm-gateway-compat is a community bundle that targets exactly these pain points.

The plugin works in three layers. The stream guard wraps llm/stream so that once a non-empty tool-call id or name has been received, later fragments with blanks cannot clobber it; if no id ever arrives, a compat placeholder is synthesized. The 400 recovery hook classifies the two most common refusal patterns, persists the matching llm-pi-ai compat field, retries the same step exactly once, and logs a visible notice, while generic 400s are left alone. The optional Chat Completions adapter lets you define direct /chat/completions routes to gateways such as DashScope, with gateway-safe defaults for the system prompt role, max_tokens output cap, extra request headers, and a pluggable thinking dialect (reasoning_content, thinking, think-tags, or none).

This project is intended for DSH users who run multi-model workflows alongside compatibility gateways, who battle intermittent tool-call identity loss during streaming, or who want a single settings block to keep dialect differences from breaking their pipelines. It does not replace any official DeepSeek package and leaves already-stable streams untouched; it only intervenes where a compatibility gap actually exists.

Use Cases

  • Streamed SSE fragments with empty id or name overwrite tool-call identity and break downstream matching
  • Compatibility gateways like DashScope return 400s due to developer-role or max_completion_tokens dialect gaps
  • Need independent Chat Completions routes for multiple gateways inside a single DSH instance

Best For

  • AI engineers wiring DSH to third-party compatibility gateways
  • Multi-model workflow developers blocked by streamed tool-call identity loss
  • Teams that must manage multiple Chat Completions compatible routes within DSH