Introduction¶
When routing through Portara or similar gateways in DeepSeek Harness (DSH), model replies often go through load balancing: they land on a specific channel, a specific upstream account, or may only succeed after triggering a failover due to quota limits. This information usually doesn’t appear in the chat interface, so troubleshooting “which path was actually taken this time” can only be done by checking the gateway or logs.
dsh-plugin-portara is maintained by Dynesshely and belongs to the “Model Inference” category of plugins. Its goal is to write the gateway routing results into the conversation flow next to every assistant reply, and to provide the same set of facts in the Turn status line and the /portara route command, without affecting normal conversation due to gateway unreachability.
What is this¶
In short: When model routing goes through the Portara gateway, it displays load-balanced routing (channel, account, upstream model, failover history) for every Turn in the chat stream. It is collapsible and does not consume extra model calls.
- Repository: Dynesshely/dsh-plugin-portara
- Community Directory: skillhub plugin page
- Current package version: 0.1.1 (MIT License)
Core Features¶
The following capabilities come from the repository README. The Host and Client share the same package and do not modify kernel files.
Route Cards in Chat¶
Each conversation Turn renders a line at the beginning of the assistant content (located above the completion title and process line, at the same level as tool-call cards; collapsing the process does not hide the routing). Without failover, it is a single-line summary; with failover, it can be expanded to view each attempt, for example:
Attempt 1 · CommandCode / ACP-002 · quota cooldown · HTTP 429 · 00:22:31
Attempt 2 · OpenDesign / ACP-003 · failover succeeded · 00:22:39
At the same time, the Turn status line at the end will append ⚡ <channel> / <account> · <full model id>, consistent with the card information, and the tooltip can reveal fields that the gateway does not expose in the body.
How Host Gets Routing¶
| Interface | Purpose |
|---|---|
llm-pi-ai/request-headers |
Writes the session ID into x-portara-client-session, facilitating session-based partitioning by the gateway |
llm/stream |
Requests GET <baseURL>/route-info after every conversation call ends (success or failure); can be polled during the streaming process according to configuration |
appendPluginRecord() |
Writes a plugin:portara/route record (can be ignored, for logs only) to locate the card based on the Turn’s prompt sequence |
/portara command |
The route subcommand prints the current session routing and refreshes the card, responding directly to the UI without consuming model calls |
The Client updates the same line via uiConversation.events.register() based on the gateway session and Turn number, supporting both Chinese and English.
Behavior Conventions¶
When the gateway is unreachable, times out, returns a non-200 status, the response is too large, JSON is malformed, or the session is missing, the plugin does not write any content, and does not slow down or cause model call failures. Records are only written to plugin: prefixed events via appendPluginRecord() to avoid destroying readability when reloading the session. The API Key remains in the Host process, and the record only contains the routing facts exposed by the gateway selection.
Installation and Enablement¶
Environment Requirements: DeepSeek Harness 0.2.x, enable the llm-pi-ai adapter, and ensure the gateway can provide /v1/route-info.
The installation method provided in the official README is local bundle (not dsh plugin add github:... concatenation):
git clone https://github.com/Dynesshely/dsh-plugin-portara.git
dsh plugin install ./dsh-plugin-portara
You can also use Plugin manager → install a local bundle in the Web UI. New bundles can be activated via hot reload by the loader; changes take effect on the browser side with the next page load, generally without needing to restart dsh.
See Releases for tagged versions, and CHANGELOG.md for changes.
Gateway Prerequisites¶
The gateway does not expose upstream topology by default. It needs to be enabled in an environment where information exposure is acceptable:
exposeRoutingInfo: true
exposeRoutingDetail: channel # off | alias | channel
If disclosure is turned off, /route-info returns an empty structure, and the plugin does not draw cards, does not report errors, and does not poll during the streaming process.
Optional Configuration¶
The portara-route item inserted into the profile has optional keys and works by default:
- insert:
- id: portara-route
name: dsh-plugin-portara
config:
enabled: true # false disables observation entirely
timeoutMs: 1500 # route-info timeout, limit between 100...10000
pollIntervalMs: 2000 # polling interval for streaming failover; 0 disables
injectSessionHeader: true # only inject session header for confirmed gateway endpoints
gateways: # explicit gateway list (skips auto-discovery)
- baseURL: https://portara.example/v1
apiKeyEnv: GATEWAY_API_KEY
When gateways is not configured, it reads providers with baseURL and apiKeyEnv from the current model-provider configuration, probes endpoints that can return route.info data plane, and parses credentials via the Host credential service, falling back to process environment variables.
Typical Usage¶
The README suggests the following steps for self-testing:
- Send a message routed through the gateway.
- A
⚡ Routed to …line appears next to the reply; if there is failover, this line can be collapsed to view the attempt history. - The Turn status line at the end displays
⚡ <channel> / <account> · <full model id>. - Execute
/portara route: output channel, account, upstream model, and failover history; if the gateway’s 15-minute live cache has expired, it will fall back to the last recorded routing in the session and explain why. - The session log should contain
plugin:portara/routewithignorable: true. - Retry after disabling gateway disclosure: no records, no errors, and the command will explain the reason.
Applicable Scenarios and Notes¶
Suitable for: Developers and operators who have implemented multi-channel/account scheduling via Portara (or compatible gateways with /v1/route-info and disclosure switches) in DSH, and need to verify “which route was actually taken this round” in the conversation.
Notes:
- The plugin runs with the current dsh process permissions. Please read the source code and MIT license before installing to confirm that the gateway disclosure policy and API Key environment variables meet your security requirements.
- The community directory skillhub.cn is an independent ecosystem site with no official affiliation with DeepSeek / Hypothesis; DSH itself follows an extension philosophy of “everything is a plugin”.
- Node.js requires
>=20; the repository has no build steps, no runtime npm dependencies, the Host is ESM, and the Client is loaded viawindow.__ModuleLoader__.load().
Conclusion¶
When routing through the Portara gateway, dsh-plugin-portara places load-balanced selection and failover history next to the reply and in /portara route, with silent failure by default and no data leakage. For further information, please check the GitHub repository and the skillhub directory page.