rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:titor-jz/dsh-dumate-gateway
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Bring locally running OpenAI-compatible model services into DeepSeek Harness — starting with the DuMate desktop app — without hand-editing a provider profile for every restart.
Unofficial and not affiliated with Baidu. It only talks to services already running on your own machine.
What works today:
models.mode: all to see everything;tools go upstream and a tool_calls reply is folded back into
one call per tool, even though DuMate splits a call over several SSE fragments with drifting
indices (see docs/DETAIL.md);image_url part, so a vision model really sees the picture
(the harness otherwise only hands adapters an opaque id, and images used to reach DuMate as
[image attachment] text);/api/dumate-gateway/status
route (no CORS or CSP surprises), refreshed every 15 seconds;~/.dsh/dumate-gateway/usage.json for seven days, never sent anywhere. The latency sparkline
lives in the page's localStorage, not in that file;
The test message and the Probe are the only things in the panel that spend quota, and only when a person presses Send or Probe; everything else is local bookkeeping.
The first install needs one restart of DSH. After that, the panel picks up client-side changes on a page refresh, and host-side changes by toggling the plugin off and on in Plugins.
This plugin is built to look exactly like you typing in DuMate, and to add no hidden traffic:
127.0.0.1 only and is never exposed to the network;429/quota error is surfaced to you as-is, never retried);baseURL and the model table from opencode.json,
where the key is the literal nokey, and it never echoes a key.Do not point batch jobs or unattended automation at http://127.0.0.1:7321: that is what turns
ordinary personal usage into the traffic pattern that gets an account flagged.
DSH ships no central plugin index: Plugins → Discover lists only the index sources a person adds.
This repository publishes one, so the plugin shows up there with its icon, description and version:
https://raw.githubusercontent.com/titor-jz/dsh-dumate-gateway/main/market/index.json
Plugins → Experimental plugins → switch on Custom plugin indexes.dsh-dumate-gateway@0.0.2 from npm.Without an index you can still install it directly: Plugins → Add plugin → paste
dsh-dumate-gateway (npm), or git+https://github.com/titor-jz/dsh-dumate-gateway.git, or point the
dialog at a local checkout.
DeepSeek Harness → Plugins → Add plugin → paste dsh-dumate-gateway (npm) or pick this
directory. Host-only bundle: no build step, no dependencies, no install scripts. The HTTP gateway
starts with the plugin on http://127.0.0.1:7321.
curl -s http://127.0.0.1:7321/health
curl -s http://127.0.0.1:7321/v1/models
curl -N http://127.0.0.1:7321/v1/chat/completions \
-H 'content-type: application/json' \
-d '{"model":"deepseek-v4-flash-0731","messages":[{"role":"user","content":"hi"}],"stream":true}'
Anthropic-shaped clients (for example Claude Code pointed at the gateway) can call
POST /v1/messages; thinking blocks are not forwarded, text and stop reasons are.
That page lists providers that need an API key or a base URL, and it only renders rows backed by a
settings namespace (llm-deepseek or llm-pi-ai); a plain adapter route such as this plugin's
gateway provider is filtered out, and a third-party namespace would render read-only anyway. So
the supported way to get an editable row there is the page's own custom-provider flow:
http://127.0.0.1:7321/v1, protocol openai-completions.nokey — the loopback gateway does not check it unless
http.token is configured.GET /v1/models.Trade-off: DSH then talks to the gateway through its own pi-ai adapter, not through this plugin's adapter, so the model selector shows both groups — the "DuMate gateway" group (curated, no key needed) and the custom provider you added. Use the plugin group for everyday work; the custom row is there when you want the gateway managed from that page.
Set http.token in the plugin config to require Authorization: Bearer <token> (or x-api-key)
on every route except CORS preflight. The gateway only listens on 127.0.0.1, and only echoes CORS
for loopback origins, so the DSH web UI can read it without opening the port to the network.
The desktop app is an Electron shell around two binaries that do the real work. This gateway needs only those two, so it can start them itself — 2 processes and about 59 MB instead of 14 processes and about a gigabyte — with the window never opening. Streaming behaves exactly the same.
headless:
enabled: true # offer the panel's Start button, and start on load
autoStart: false # true → start it on plugin load; false → only the button does
baseProxyPort: 53231 # any two free loopback ports
mainServerPort: 53232
stopOnUnload: false # true → unloading the plugin also stops the backend
What it does, and what it deliberately does not:
auth.json — it never asks for
credentials and cannot work on a machine that never signed in to DuMate;dumate-base-proxy.exe and dumate-main-server.exe from the installed app, with the
working directory the backend expects; nothing is downloaded, patched or modified;Start or stop it from the panel card; nothing is launched on page load or on the first chat request unless autoStart is set to true. The two log files
land in ~/.dsh/dumate-gateway/logs; errors from a failed start are shown in the panel verbatim.
http:
enabled: true # the loopback gateway on 127.0.0.1:7321
port: 7321
token: null # non-null → require Bearer / x-api-key
requireReachable: true # false → forward even when the TCP probe fails
models:
mode: curated # curated (chat models only) | all (raw table, DuMate internals included)
exclude: [] # extra keys to hide, case-insensitive substring match
headless:
enabled: false # true → the panel can start DuMate's two background binaries
autoStart: false
baseProxyPort: 53231
mainServerPort: 53232
stopOnUnload: false
DuMate mixes its public chat models with internal plumbing (routing helpers, validators, embeddings,
an OCR endpoint, six auto-router levels). curated hides those; hiding a model never disables it —
an id you type or configure still forwards.
The plugin registers a provider route (gateway) on the host's LLM service. The route advertises
its catalog, resolves per-model capacity, and streams chunks in the harness StreamChunk protocol,
so nothing outside this package needs to know how a given local service spells its wire format.
/v1beta.429 RATE_LIMIT from the gateway.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm-gateway、deepseek-harness、openai-compatible。