dsh-upstream-model-audit: Display the actual upstream-returned model name under each assistant message

Preface

In DeepSeek Harness (DSH), the model id you select in the UI or configuration does not always match the model name declared by the relay or upstream in the HTTP response. A common scenario is requesting mimo-v2.6-pro but receiving xiaomi/mimo-v2.6-pro from the upstream. Previously, the chat interface did not expose such differences, making troubleshooting routing, relaying, or billing issues impossible without digging through logs or packet captures.

The following introduces the community plugin dsh-upstream-model-audit (Maintainer: QuanhuZeYu, Category: Client). It lists below every assistant message: the request model selected by DSH routing for that turn, the model name declared in the upstream response, and an objective classification of the difference. If necessary, it supplements this with facts observed by the host-side bypass, such as the “actually sent” model name, service tier, or instances where upstream declarations were inconsistent across multiple attempts.

What is this

dsh-upstream-model-audit is a DSH web plugin: it explicitly displays the model name actually returned/declared by the upstream under the assistant message corresponding to each model invocation (step), contrasting it with the model name from the request side.

The plugin is divided into a host half (Node: fetch bypass observation + rewriting replay metadata) and a browser half (reads durable events and renders). The display path introduces no new event types; it continues to use DSH’s existing assistant/message and replayState.

Core Features

Interface Display

One row per step (one model invocation), immediately following the assistant message for that step. Both names are displayed verbatim: no normalization, no stripping of suffixes (-latest, date snapshots are retained), and no severity judgment.

Differences are only classified objectively:

  • Vendor prefix difference only
  • Model name difference

If they are identical character-by-character, nothing is displayed (there is no factual difference to present). If the upstream does not declare a model name, nothing is displayed (no guessing or filling in).

Example form (from README):

(Assistant message)
Upstream returned xiaomi/mimo-v2.6-pro   Requested mimo-v2.6-pro · Vendor prefix difference only

When the host half observes additional facts via bypass, a supplementary line of information may appear:

  • The actually sent model name (only displayed if different from the requested name)
  • Tier (OpenAI service_tier normalized value / Anthropic usage.speed)
  • Multiple names declared by upstream successively (listed as-is if the upstream contradicts itself; no single “correct” one is chosen)

Data Fields

The display primarily uses fields from the durable assistant/message event:

Field Meaning
message.source.model Model id selected by DSH routing and requested for this turn
message.source.replayState.response.responseModel Model name declared in the upstream response

The writing of responseModel by various channels is incomplete (see next section). Without modifying DSH source code, the plugin uses the host-side bypass to complete missing fields. The supplemented values are still persisted by DSH, and the browser half continues to read replayState.response.responseModel.

Host-Side Bypass Completion (Overview)

  1. Fetch observation point: Only clones the response body (Response.clone()) within the invocation scope established by this plugin, parsing SSE / JSON frames with semantics similar to sub2api. If observation fails, times out, or the format is unrecognized, it silently degrades without affecting the model invocation.
  2. Observation content: Model name declared by upstream, service tier, model name actually sent in the request body, and response body shape. Reads response headers (x-upstream-model / openai-model / x-model / upstream-model) as a fallback if necessary.
  3. llm/stream middleware: On the finish chunk, only writes response.responseModel and response.upstreamAudit if missing; native values always take precedence.
  4. Cleanup: Cancels the bypass reading when the invocation ends or is aborted, avoiding dangling tee branches.

Invariants: Observation failures or non-SSE/JSON responses uniformly result in silent degradation, never affecting the model invocation.

Installation and Activation

In the DSH ecosystem, plugins are installed via CLI; this plugin targets the web profile. The official installation command is as follows:

dsh plugin --profile web add github:QuanhuZeYu/dsh-upstream-model-audit

Restart DSH once after installation. The README explains that the host half needs to install observation points within the Node process, and hot reload does not cover this. After restarting, simply change configurations or refresh the page to see the interface effects.

The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to read the source code and MIT license on GitHub to ensure it meets your security and compliance requirements.

Typical Usage and Display Rules

After installation and restart, simply use DSH chat normally: no additional configuration items are needed (no independent configuration file fields are listed in the documentation).

When the requested model for a specific step is inconsistent with the upstream declaration, a line of audit information will appear below the corresponding assistant message; if they are completely consistent or the upstream does not declare a model, that line will not appear.

One point to understand: Coverage depends on the channel and replay metadata. The adaptation status provided in the README includes:

Channel Native responseModel Available? Description
openai-completions Only when response name ≠ request name pi-ai only writes when names differ
openai-responses / azure / codex Never These branches do not write this field
anthropic-messages Only when upstream changes the name Replay layer takes value based on inequality condition
Proprietary deepseek-messages Never Envelope only contains request model

Bypass observation is effective for providers going through globalThis.fetch; invocations without replayState (such as interruptions or abnormal endings) cannot be supplemented, and the plugin does not fake carriers.

Use Cases and Notes

Who it is for

  • Users using relays, aggregations, or multi-vendor routing who need to confirm whether the “model selected in the UI” matches the “model returned by the upstream”.
  • Troubleshooting prefix differences (e.g., vendor slugs), model name rewrites, or upstream declaration inconsistencies.
  • Users who need to compare service tier fields from OpenAI / Anthropic, etc.

Known Boundaries (excerpted from README)

  • Host observation points only take effect after restarting DSH once.
  • The native Trajectory tab does not display these records.
  • If the upstream or relay rewrites the response model to the request name, resulting in identical names on both sides, the plugin is only responsible for facts visible on the DSH side.
  • The node anchor anchorSeq = Message seq + 0.01 depends on the ui-chat semantics for obtaining assistant message sequences; this needs to be re-checked after major DSH version upgrades.

The community directory SkillHub and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer; stars and versions are subject to the display at the time on respective sites.

Conclusion

dsh-upstream-model-audit moves the “model name actually returned by the upstream” from logs to below each assistant message, and attempts to complete the responseModel not written by pi-ai through bypass observation. It is very practical for debugging routing and relay behavior. See above for installation commands; see the GitHub README for details and development notes, and the SkillHub Directory for the entry page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye