Tools & Capabilities

dsh-gateway-presets

menger-8/dsh-gateway-presets · ★ 5

menger-8

Third-party gateways in DeepSeek Harness, with thinking intensity that just works.

License
MIT
Added
2026-08-23
Maintenance
active
Install kind
github

No manifest check is available; listing does not imply compatibility or security review.

安装

dsh plugin --profile web add github:menger-8/dsh-gateway-presets

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: en · Read Chinese README

Table of contents
  1. The problem we solve
  2. Quick start
  3. How it works
  4. Configuration reference
  5. Contribute a gateway
  6. Requirements
  7. License

English | 中文

Third-party gateways in DeepSeek Harness, with thinking intensity that just works.

The problem we solve

When you connect a third-party gateway (Volcengine Ark, relays, self-hosted servers…) to DeepSeek Harness, two things go wrong:

  1. You cannot select thinking intensity — the picker has no reasoning-level option at all;
  2. If you configure it by hand to force the option on, every request fails with 400, for example:
    {"message":"... messages[0].role: unknown variant `developer`, expected one of `system`, `user`, `assistant`, `tool`"}
    

Why, in one sentence: every gateway speaks its own dialect (system role system vs developer, reasoning-parameter format, output-cap field, …), and the harness can only guess from the URL — a private gateway's URL says nothing, so it either withholds the option or sends the wrong parameters.

Our solution: one plugin with a hostname-keyed "gateway dialect table" plus per-model thinking-level declarations. Install it, mount it, write down your gateway — thinking intensity becomes selectable and works. Volcengine Ark is the first probe-verified entry; any other gateway joins as one line of data after a run of the bundled probe tool.

Quick start

pnpm add @menger-8/dsh-gateway-presets

Mount the plugin in your cordis.yml and declare your gateway:

- id: gateway-presets
  name: '@menger-8/dsh-gateway-presets'
  config:
    providers:
      my-gateway:
        baseURL: https://ark.cn-beijing.volces.com/api/coding/v3
        apiKeyEnv: MY_GATEWAY_API_KEY
        models:
          - id: deepseek-v4-flash-ga-260731
            reasoningEfforts:
              off: null
              high: high
              max: max

Start dsh web as usual — pick a model under your gateway and the reasoning levels (Off/High/Max) are right there.

How it works

  • Dialect table (presets): hostname-keyed facts over nine compat switches — supportsDeveloperRole (developer vs system role), thinkingFormat (reasoning parameter format), maxTokensField (output-cap field), and more. *.volces.com ships pre-verified (Ark rejects the developer role); config.presets extends or replaces entries.
  • Per-model levels (reasoningEfforts): you declare the levels a model offers, the plugin opens the picker, and requests go out in the correct dialect.
  • No core changes required: the plugin registers its own pi-ai adapter into the harness LLM seam, so stock DeepSeek Harness works as-is (see "Requirements").

Configuration reference

- id: gateway-presets
  name: '@menger-8/dsh-gateway-presets'
  config:
    presets:                 # add/replace dialect facts by hostname
      'gateway.example.com':
        supportsDeveloperRole: false
        thinkingFormat: deepseek
    providers:               # gateway routes this plugin owns
      my-gateway:
        displayName: My Gateway
        baseURL: https://gateway.example.com/v1
        apiKeyEnv: MY_GATEWAY_API_KEY      # credential reference, resolved via the credentials service
        models:
          - id: think-model
            name: Think Model
            reasoningEfforts:
              off: null
              high: high
              max: max

The nine dialect switches: thinkingFormat, supportsReasoningEffort, supportsStore, supportsDeveloperRole, maxTokensField, requiresToolResultName, requiresAssistantAfterToolResult, requiresThinkingAsText, requiresReasoningContentOnAssistantMessages.

Contribute a gateway

Three steps: one probe run, one data entry.

  1. Run the probe (the key lives in $DSH_HOME/.credentials.yaml; the script never prints it):
    powershell -File tools/probe-gateway.ps1 -BaseUrl https://<gateway>/v1 -KeyRef <KEY_NAME>
    
  2. Keep only what the probe proves: a 400 on the developer-role request means supportsDeveloperRole: false; the OpenAI dialect refused while thinking.type answers means thinkingFormat: deepseek; accepted efforts become the declarable levels.
  3. Add the entry to src/builtin.ts with the evidence named in its comment, and open a pull request.

The probe output doubles as the answer to "what does this gateway actually support?" — paste it into the PR description.

Requirements

The plugin ships its own adapter, so stock DeepSeek Harness works with no core patches. On builds that consume the llm-gateway-compat-presets service (such as the Menger-8 fork), it additionally provides that service and interoperates with the core preset mechanism; upstream adoption is tracked in Discussion #564.

License

MIT