
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-multiprovider
Advanced tools
Provider-neutral multi-account scheduling, affinity, health, and Settings UI for DeepSeek Harness
Provider-neutral multi-account scheduling for DeepSeek Harness
One provider identity, many credentials, explicit leases, and operator-visible health.
dsh-multiprovider lets concrete provider plugins expose several OAuth, API-key, service-account, or custom credentials behind one stable provider/model identity. It owns account selection, affinity, health, cooldowns, and operator preferences. Provider plugins continue to own authentication, credential storage, transport, and provider-specific error interpretation.
The package is a native Cordis service and DSH bundle, not a second model router. Callers lease one account for a complete operation, settle the outcome exactly once, and explicitly reacquire when provider semantics make failover safe.
| Capability | What it unlocks | |
|---|---|---|
| 🔁 | Deterministic selection | Round-robin, weighted, least-in-flight, and priority policies behind one provider route. |
| 📌 | Session affinity | Stable account reuse for related requests while the selected account remains eligible. |
| 🩺 | Visible health | Cooldowns, failure classes, and in-flight counts without exposing credential material. |
| 🔐 | Provider-owned secrets | Opaque credential references stay on the host and never enter browser snapshots. |
| 🎛️ | Live preferences | Operators enable, weight, prioritize, and reset accounts from DSH Settings. |
| 🧩 | Native composition | Cordis lifecycle, DSH settings, and the Web host remain the only runtime authorities. |
flowchart LR
Request[Provider operation] --> Pool[ctx.multiprovider]
Pool --> Policy[Selection + affinity]
Policy --> Lease[Account lease]
Lease --> Provider[Concrete provider plugin]
Provider --> Outcome[Success / failure / cancel]
Outcome --> Health[Health + cooldown]
Health --> Pool
Pool --> Settings[Accounts settings]
The logical provider identity stays unchanged. Internal account IDs and credential references are not model routes and must never be persisted as session provider IDs.
ctx.multiproviderThe logical provider identity stays unchanged. Internal account IDs and credential references are not model routes and should never be persisted as session provider IDs.
Requirements: Node.js ^22.19.0 || >=24, pnpm 11 for this checkout, and DeepSeek Harness ^0.1.1.
The package is included in the tested DSH distribution. To add it to another profile explicitly:
pnpm dlx @monotykamary/dsh@latest plugin --profile web add dsh-multiprovider
For local development, build this checkout and add its absolute path:
pnpm install --frozen-lockfile
pnpm run check
pnpm dsh plugin --profile web add link:/absolute/path/to/dsh-multiprovider
The bundle patch installs the multiprovider service. Concrete provider integrations inject that service and retain ownership of enrollment, refresh, storage, and transport.
Credential references are opaque to this package. They can be DSH CredentialRef values, credential record keys, provider-owned file handles, or another non-secret locator.
import type { Context } from '@monotykamary/cordis'
import type {} from 'dsh-multiprovider'
export function installAccounts(ctx: Context) {
ctx.inject(['multiprovider'], (mctx) => {
mctx.effect(() => mctx.multiprovider.registerProvider({
id: 'anthropic',
label: 'Anthropic',
managementHint: 'Add and remove keys in the Anthropic provider settings.',
accounts: async () => [
{
id: 'work',
label: 'Work key',
authKind: 'api-key',
credentialRef: { kind: 'record', key: 'anthropic/work' },
weight: 3,
metadata: { organization: 'Work' },
},
{
id: 'personal',
label: 'Personal key',
authKind: 'api-key',
credentialRef: { kind: 'record', key: 'anthropic/personal' },
},
],
classifyFailure: (error) => {
const status = (error as { status?: number }).status
if (status === 429) return { kind: 'rate-limit', retryable: true }
if (status === 401 || status === 403) return { kind: 'auth', retryable: true }
if (status !== undefined && status >= 500) return { kind: 'transient', retryable: true }
return { kind: 'fatal', retryable: false }
},
}), 'anthropic: multiprovider accounts')
})
}
Do not put API keys, access tokens, refresh tokens, or raw provider diagnostics in metadata, labels, account IDs, or credential references. A reference must be a locator, not the secret itself.
const attempted = new Set<string>()
for (;;) {
const lease = await ctx.multiprovider.acquire<MyCredentialRef>({
providerId: 'anthropic',
affinityKey: session.id,
excludeAccountIds: attempted,
})
attempted.add(lease.accountId)
try {
const credential = await resolveCredential(lease.credentialRef)
const result = await runCompleteProviderOperation(credential)
lease.release({ status: 'success' })
return result
} catch (error) {
const disposition = lease.release({ status: 'failure', error })
if (!disposition?.retryable || !isSafeToReplay(error)) throw error
// Reacquiring with excludeAccountIds selects another eligible account.
}
}
For streaming LLM requests, hold the lease until the stream has completed or failed—not merely until an async iterable is created. Never replay automatically after user-visible output has started unless the provider integration can prove replay is safe.
Related search, image, usage, and tool operations should pass the same session/workload affinity key when one is available.
The browser plugin contributes a standalone settings.section named Accounts. It shows:
Secrets are never returned by GET /plugins/dsh-multiprovider/state. Mutation endpoints enforce loopback and same-origin checks, capped JSON bodies, method allowlists, no-store responses, and strict field validation.
| Layer | Owns |
|---|---|
dsh-multiprovider | Account pools, leases, selection, affinity, health, cooldowns, failover primitives, operator policy UI |
| Provider plugin | OAuth/API-key enrollment, credential persistence and refresh, transport, complete stream lifetime, error classification |
| DSH core | Request/session lifecycle, credential and authorization services, provider/model identity |
Health, leases, and affinity are process-local. Preferences are durable through DSH settings. This version does not queue for account capacity, impose per-account concurrency limits, or perform hidden retries. Those are deliberate future extensions; explicit reacquisition keeps replay safety in the provider integration where protocol semantics are known.
pnpm install --frozen-lockfile
pnpm run check
pnpm pack --dry-run
pnpm run check type-checks the host and browser faces, runs the complete Vitest suite, and builds the ESM service plus browser client bundle. prepack repeats that check before npm creates a release payload.
MIT © Tom Nguyen.
FAQs
Provider-neutral multi-account scheduling, affinity, health, and Settings UI for DeepSeek Harness
The npm package dsh-multiprovider receives a total of 39 weekly downloads. As such, dsh-multiprovider popularity was classified as not popular.
We found that dsh-multiprovider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.