Introduction¶
DeepSeek Harness (DSH) extends model sources and invocation paths through plugins. If you are already running relay-hub (a self-hosted LLM relay/gateway installed via pip install hubrelay) on a local network or in a self-built environment, the common practice is to manually configure the base URL and API Key, or perform pairing on the gateway side and request a one-time code from the administrator. Global request logs on the relay station side also make it difficult to directly answer “how much a specific DSH plugin used or what it did”.
The following introduces the community plugin dsh-relayhub-bridge (Maintainer: bilibiliUID1480494301, Category: admin-security): it allows joining a site using a 6-digit dynamic code generated by RFC 6238 TOTP or a one-time enrollment ticket, registers a relayhub provider route within Harness, and tags traffic for this plugin, facilitating separate accounting logs per plugin on the site.
What is this¶
dsh-relayhub-bridge is a DSH plugin published on npm (current package version 0.3.0, license MIT). It does only one thing: connects the current Harness profile to a relay-hub site with TOIP enabled (hubrelay ≥ 0.3.0), and exposes the model list returned by the site as selectable models just like other providers. The request headers carry X-DSH-Plugin-Id, and the site writes to pluginlogs/dsh-relayhub-bridge/<date>.jsonl in addition to global logs.
The plugin declares the injected service as only llm, does not depend on Harness internal packages, and has peer dependencies @deepseek-ai/cordis ~4.0.4 and @deepseek-ai/schemastery ~3.18.4 (optional). Catalog page: https://www.skillhub.cn/plugins/bilibiliUID1480494301/dsh-relayhub-bridge; Source code: https://github.com/bilibiliUID1480494301/dsh-relayhub-bridge. SkillHub is a community plugin directory and has no official affiliation with DeepSeek / High-Flyer.
Core Features¶
Joining a site with URL + Dynamic Code¶
No need to run extra CLIs on the gateway, no pairing window required, and no need to ask administrators for one-time codes. The 6-digit code is a TOTP rolling every 30 seconds; enrollment tickets (rhe_…, printed only once by the site) are also supported.
Becoming a relayhub provider¶
After successful joining, the relayhub route is registered. Models on the site appear in Harness model settings, selectable in the same way as other providers.
Per-plugin accounting logs¶
Every request carries X-DSH-Plugin-Id, and the site generates plugin-specific JSONL logs, facilitating auditing of “what this plugin did” without grepping through large chunks of API logs.
Model Invocation and Streaming Adaptation (Since 0.2.0)¶
The adapter implements the complete invocation chain: resolveModel, prepareCall, stream (cancellable POST /v1/messages, stream:true). Anthropic SSE is mapped to Harness StreamChunk; various failure modes are mapped to finish chunks understood by the harness. If the site ignores stream:true, it can still simulate streaming using the full message object. DeepSeek DSML tags leaked in the content are cleaned in the streaming path.
End-to-End Envelope Encryption (0.3.0)¶
When the site provides the capability, Messages requests can be wrapped in an x25519-hkdf-sha256-aesgcm envelope. Configuration item e2e:
auto(default): ProbesGET /v1/e2e/paramsevery turn; encrypts if supported, falls back to plaintext on 404/501.off: No probing, no encryption.require: Errors out if envelope is not supported; no downgrade to plaintext.
The site needs to install the hubrelay[e2e] extra; key rotation is automatically refreshed and resealed by the plugin upon receiving a 400 with a named key_id.
LAN Discovery¶
bridge.discover({ timeoutMs: 3000 }) broadcasts RELAYHUB-DISCOVER-v2 to obtain the site URL and TOIP status in one go. Broadcasts do not cross subnets; remote sites require manual URL entry.
Environment and Dependencies¶
- DeepSeek Harness: 0.2.0-rc.2 or newer, and still on the 0.2.x line (README marks
verifiedAgainst: 0.2.0-rc.2). The plugin targets the 0.2.x contract (ctx.llm.registerAdapter/registerConfigurableProviders,dsh.bundle.patch); 0.3.x may require corresponding plugin upgrades, please pin Harness versions when stability is required. - relay-hub site: hubrelay ≥ 0.3.0 (TOIP introduced since this version; cross-test marks
verifiedAgainst: hubrelay 0.3.1). - Node.js ≥ 18 (Uses
fetch,AbortSignal.timeout,node:dgram, etc.).
Installation and Activation¶
The plugin runs with the permissions of the current DSH process; please review the source code and MIT license before installation.
npm preferred (README explains dsh plugin add dsh-relayhub-bridge resolves npm registry first):
# <profile> is your Harness profile name, e.g., desktop, web
dsh plugin --profile <profile> add dsh-relayhub-bridge
dsh plugin --profile desktop add dsh-relayhub-bridge
dsh plugin --profile web add dsh-relayhub-bridge
Install from GitHub (bypassing registry):
dsh plugin --profile <profile> add github:bilibiliUID1480494301/dsh-relayhub-bridge
Local path (absolute path required):
dsh plugin --profile <profile> add /absolute/path/to/dsh-relayhub-bridge
Inside the repository, the following commands can be used to self-check packaging and protocol tests (essential for maintainers/advanced users, not necessarily for DSH users):
node scripts/check-package.cjs
node --test test/
Typical Usage¶
1. On the relay-hub site (One-time)¶
Execute on a machine with hubrelay ≥ 0.3.0 installed:
hubrelay toip station --name lab-hub
hubrelay toip ticket --name dsh-laptop --plugins dsh-relayhub-bridge
The first command prints current TOTP related codes and otpauth:// URI; the second prints the enrollment secret (rhe_…) which appears only once.
2. Joining in Harness Plugin Settings¶
Open Settings → relay-hub:
- Paste the site address and click Check station to confirm the site offers TOIP.
- Paste the current 6-digit dynamic code, or paste the enrollment ticket.
- Click Join station. The page will display the current site, the number of registered models, and offer Disconnect to clear the local token.
This UI and the underlying layer write to the same configuration namespace (baseURL, apiKey, stationID, models); the provider reads directly from it, generally no need to manually modify JSON.
Programmatic joining example (relayhubBridge on the Cordis context):
const joined = await bridge.join({
stationURL: 'http://192.168.1.10:8799',
ticket: 'rhe_…',
name: 'dsh-laptop',
})
const again = await bridge.join({
stationURL: 'http://192.168.1.10:8799',
code: '123456',
})
The structure returned on success contains fields required by the provider (baseURL always ends with /v1 to avoid the Messages adapter duplicating the path):
{
root: 'http://192.168.1.10:8799',
baseURL: 'http://192.168.1.10:8799/v1',
apiKey: 'rht_…',
stationID: 'rst_…',
models: [{ id: 'deepseek-v4-pro', contextWindow: 1000000 }],
}
After persisting the above values to the plugin configuration, select the corresponding model in Harness to start a conversation. apiKey is a session credential and should be treated as a secret.
3. LAN Discovery (Optional)¶
const stations = await bridge.discover({ timeoutMs: 3000 })
// [{ name: 'lab-hub', url: 'http://192.168.1.10:8799', toipEnabled: true, models: 3 }]
Use Cases and Notes¶
Who it is for: Teams or individuals who already have or plan to deploy relay-hub, wish to route DSH through a self-built gateway using standard provider methods, and need to split logs and audit by plugin on the site side; the admin-security category also corresponds to the combination of “Access Control (TOIP) + Traceable Plugin Identity”.
Notes:
- Harness is still in Developer Preview; the 0.2.x plugin API may change; please pin versions in production environments and watch the plugin repository releases.
- TOIP and per-plugin logging depend on the site’s hubrelay version and TOIP/ticket configuration; the plugin cannot replace site-side security policies.
- E2E encryption requires site
hubrelay[e2e]; the defaulte2e: autofalls back to plaintext for unsupported sites. If policy requires full-path encryption, set it torequire. - The plugin does not introduce dependencies on Harness internal packages, aiming to reduce upgrade breakage; when forking or patching yourself, keep consistency with the cordis peer range.
Conclusion¶
Through the steps above, DSH can connect to relay-hub via dynamic codes or tickets, complete the join at the UI or API layer, and use relay station models as the relayhub provider; the site side can also save logs by plugin ID. For complete instructions on installation commands, TOIP flow, and encryption options, refer to the GitHub README.