dsh-sensenova-suite:商汤多账号 Key 池与 DSH 接入套件

Introduction

In DSH, integrating SenseNova is a common hassle. The trouble isn’t usually about getting it to work once, but keeping it running: shared quotas for multiple sk- keys, 429 RPM and TPM limits, inconsistent client protocols, and the disconnect between console credits and conversation usage. Scattered scripts or single-key direct connections often only suffice for demos. As soon as rate limiting and quotas kick in, manual key swapping and configuration tweaking are required.

dsh-sensenova-suite (maintainer QZJ903, GitHub: QZJ903/dsh-sensenova-suite) puts console quota display, SenseNova vendor registration in DSH, multi-account key pool scheduling, three-protocol adaptation and degradation chains, and text-to-image / image editing / image description reading into one plugin. Below is a breakdown of installation, configuration, capabilities, reproducible usage, and boundaries.

What is this?

The plugin’s positioning is a suite-level integration of SenseNova under DSH: multi-account key pool and 429 rate limit scheduling, Anthropic / Responses / Chat Completions protocols and per-model degradation chains, credit and usage monitoring, plus multimodal tools. Categorically, it belongs to the “Model Inference” category in the DSH community directory; currently, the public repo has 0 stars, and the version follows package.json as 0.1.2.

Credentials are saved via DSH’s credential service; the panel and logs only display masked names, not plaintext keys.

Core Features

Credit Quota and Usage Capsule

After logging into the SenseNova console in the panel’s “Credit Quota” tab, you can view the credit pool (two rolling windows: 5 hours / week), 24-hour consumption trends per model (pseudo-multiple comparison, data marked as unofficial coefficient), and support multi-account switching. Token auto-renews upon login; failure shows the platform’s reason.

On the right side of the input box is the Usage Capsule: displays the corresponding credit pool when switching models within different pools; clicking expands the quota card (original usage and reset time). When the panel is closed, background refreshes provider-related status based on providerRefreshMinutes only if “Register with DSH” is enabled.

LLM Integration and Protocol Degradation

In the “Integrate API” tab, “Register with DSH” is off by default in the deployment config (registerProvider: false), but the panel switch can override it in real-time. Once enabled, the plugin registers the SenseNova LLM provider with DSH; the model list is probed via /v1/models, and new models appear automatically.

Each model can configure three non-overlapping protocol slots (anthropic / responses / chat-completions, chain can be truncated). The default degradation chain is just the single chat-completions line; if a model needs to go via Anthropic or Responses, you must add it manually to the slots. During runtime, if the Anthropic upstream is unstable, it can drop-tail degrade; if all on the chain fail, chat-completions acts as a fallback. Data note: Responses requests have passed the thinking level, but this parameter might not be effective on the upstream side; this is an upstream issue.

The panel can also set per-model push selection, thinking level, and “Can View Image” selection (directory auto-selects, manual uncheck enters “Tombstone” state where it won’t auto-restore), and override max output and context window in cordis.patch.yml.

Multi-Account Key Pool and 429 Scheduling

Saving one sk- Key on the “Integrate API” page adds it to the pool (no primary/secondary key privilege within the pool). accounts[] supports multiple accounts { id, label, apiKeyRef }; credential reference names are added to the pool on reload; when activeAccount is empty, it’s pure rotation, and a specific account id can be pinned.

Data emphasizes: Each Key should come from a different SenseNova account. Multiple keys from the same account share the same quota pool. When rate limiting occurs, switching to another key from the same account cannot bypass the bottleneck. The pool cannot automatically identify same-account relationships; you must ensure cross-account distribution yourself.

429 handling is divided into four layers (see repository docs/retry-policy.md for details), briefly:

  1. Categorization: Distinguish between TPM bucket and RPM bucket based on error.code in the response body (ignoring message wording).
  2. Key State Machine: TPM bucket can kick a Key into blocked state after 3 consecutive times; stays blocked for 10 minutes before the time gate returns it; the running state must retain at least 1 Key that is never kicked out to avoid an empty pool.
  3. Quota Ledger: All 429 shapes are logged. If a continuous segment lasts 30 minutes without success, a “pool cell” is stamped for (key, credit group) (30 min TTL); if the group cell is full, ACCOUNT_QUOTA is thrown.
  4. Request Orchestration: Single request 3 rounds of key rotation + jitter wait 5-10s + 4th round; SenseNova 6.8 Flash Lite model affinity locks the first Key, while other models and the general group rotate according to pool strategy.

401 permanently removes a Key. RPM-type 429 rotates Keys but doesn’t count TPM strikes; TPM-type 429 is handled via the state machine mentioned above.

globalConcurrency defaults to 2, controlling the global in-flight limit (1 fixed concurrency per Key; set to 0 to follow the number of Keys).

Multimodal: Image Generation and Vision Bridge

Deployment defaults to enabling text-to-image, image editing, and description (text2imgEnabled / img2imgEnabled / visionToolsEnabled default to true); the panel’s “Multimodal” tab can turn off tools one by one, and previously saved panel settings take precedence over deployment defaults.

  • Image Generation: sn_text2img text-to-image, sn_img2img image editing, default model sensenova-u1.5-lite, 30s cooldown on failure, requests go through the Key pool.
  • Vision Bridge (Image Description): When dragging an image into a pure text main model, the vision model (default sensenova-6.8-flash-lite) narrates the observation to the main model to continue answering; the original image in the interface remains static; if the main model is within the “Can View Image” set, the image passes through as is. The same image is only narrated once within the process (observation cache 200 FIFO).

Diagnosis

You can check disk-side status without opening the panel:

npm run doctor

Machine-readable:

npm run doctor:json

Installation and Enablement

  1. Install this plugin in the DSH Plugin Interface (source can be GitHub or npm package name), then restart DSH.

GitHub:

https://github.com/QZJ903/dsh-sensenova-suite

npm package name:

dsh-sensenova-suite
  1. Open the plugin panel “Credit Quota”, log in to SenseNova console to check quota (multi-account switching available).
  2. Save one sk- Key in “Integrate API” as the first Key in the pool.
  3. If you want to use SenseNova models in the DSH model list: open “Register with DSH” in “Integrate API”; turn on Image Generation and Vision Bridge in “Multimodal”.

Note: The community plugin directory entry on skillhub.cn has no official affiliation with DeepSeek / Hyperbolic; it is advisable to review the source code and LICENSE yourself before installing, as the plugin runs with the current DSH process permissions.

Configuration Essentials

There are two configuration aspects: Panel State (takes effect immediately) and cordis.patch.yml (deployment defaults, needs restart or reload after change; panel overrides real-time if names match). Common deployment key examples:

Key Default Description
accounts[] — Multi-account and apiKeyRef
activeAccount "" Pinned account; empty for rotation
globalConcurrency 2 Global in-flight limit
modelGroups — Model → Credit group mapping
registerProvider false Whether to register provider with DSH
text2imgModel / img2imgModel sensenova-u1.5-lite Image generation model
visionModel sensenova-6.8-flash-lite Description model
consoleBase / apiBase Platform default Modify only if mirroring or proxying

Code-side defaults are centralized in src/host/host-config.ts; cordis.patch.yml contains Chinese comments for each key.

Typical Usage Workflow

  1. After installing and restarting DSH, add at least one sk- Key from a different account to the pool first; for throughput, continue adding and adjusting global concurrency in “Integrate API”.
  2. For daily conversation if you only use SenseNova quota monitoring and don’t integrate LLM: keep registerProvider off; the plugin can still display credits and capsules.
  3. To select SenseNova models in the Cursor / DSH main flow: open “Register with DSH”, adjust the three slots of the degradation chain and thinking level according to model needs; high-frequency models can use SenseNova 6.8 Flash Lite combined with affinity Key strategy.
  4. When dragging an image and the main model doesn’t support images: keep the Vision Bridge on; if the main model is already in the “Can View Image” list, no narration is needed.
  5. Troubleshooting: run npm run doctor first, then combine the panel Key list phase badges (Running / Blocked / Not in pool) to judge if in TPM block or pool cell state.

Suitable Scenarios and Notes

More Suitable For: Holding multiple SenseNova accounts, needing stable rotation of SenseNova API in DSH; wishing to unify RPM/TPM 429 handling and credit group isolation; or needing to view console credits, integrate LLM, generate images, and use the Vision Bridge in the same environment.

Notes to Consider:

  • Multiple keys from the same account cannot replace cross-account pooling; plan accounts and modelGroups credit group mapping before deployment.
  • Model integration is off by default, multimodal is on by default; if all are off, the plugin degrades to a pure credit display.
  • Anthropic / Responses lines relate to SenseNova upstream behavior; on anomalies, fall back to chat-completions; check repository docs/sensenova-api-reference and retry-policy.md if necessary.
  • The plugin inherits from multiple MIT ecosystem projects (like token-plan, provider, freeapi, vision-aid, image, etc.); see THIRD_PARTY_NOTICES.md for lineage.

Conclusion

dsh-sensenova-suite stacks console credits, DSH vendor registration, multi-account Key pools and 429 strategies, three-protocol degradation chains, and multimodal tools into one plugin. It is suitable for developers who want to enable SenseNova step-by-step via the panel while running it long-term in DSH.

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

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

Xiaoye