Skip to main content
K

dsh-unthrottle

koopmannleon19977-cmyk/dsh-unthrottle

Adds model provider routes to DSH from your API keys or existing subscription plans, plus a pool route that fails over to the next model when one is rate limited or out of quota.

Install

dsh plugin --profile web add github:koopmannleon19977-cmyk/dsh-unthrottle

README

Unthrottle

Unthrottle turns the subscription plans and API keys you already pay for into native routes for DeepSeek Harness, with a pool route that fails over to the next model when one is rate limited, out of quota or down.

SuperGrok / X Premium and Google Antigravity become ordinary DSH model routes, paid for by the plan you already have, without an API key and without a second subscription client per account. API keys, coding plans and local servers are added through provider descriptors.

Unthrottle cockpit: one tile per provider with its route state, and a failover pool of two local test servers

Status: 1.7.0, public edition. It ships the BYOK hub, the pool route and the Grok, ChatGPT-plan and Antigravity subscription routes. The Claude subscription route and its Claude Code identity are not part of this build: Claude models run through the anthropic descriptor with an ANTHROPIC_API_KEY. The full edition adds the Claude subscription route and documents its live checks.

Public edition. This build has no Claude subscription sign-in and sends no Claude-Code identity. Use an Anthropic API key for Claude models; commands for anthropic logins or probes do not apply here.

Install it with dsh plugin --profile <profile> add dsh-unthrottle.

Quickstart

  1. Install. Pick one way from Install. The shortest is the npm package, which puts the dsh-unthrottle command on the PATH, plus the plugin line that adds it to a DSH profile:

    npm install -g dsh-unthrottle
    dsh-unthrottle --help
    dsh plugin --profile <profile> add dsh-unthrottle
    
  2. Sign in or store a key. A subscription provider signs in through the browser or a device code; an API-key provider takes its key without echo. The CLI writes into the DSH credential store, never into a file in this package:

    dsh-unthrottle login xai
    dsh-unthrottle providers key set <provider>
    dsh-unthrottle status
    
  3. Restart DSH and choose a model. The plugin loads when DSH starts. After that, a sign-in or key set from the CLI registers its route without another restart. Pick the route in the model picker, for example xai/grok-4.7, or pool/auto to let the failover pool choose.

Features

  • Failover pool. The pool route holds ordered members (provider/model) and hands a request to the next member when one is rate limited, out of quota, unauthorised, down, silent for 60 s or empty before its first chunk. A pool sets routing to balanced (default), fastest, cheapest, quota or cheapest-adequate; cheapest has no cost signal wired yet. A conversation sticks to the member that served it last (60 min, at most 500 sessions) unless that member is cooling or its plan is nearly spent. See Pool (failover).

  • Multi-account. login <provider> --account <name> stores another grant per provider; accounts lists them and switch activates one. The cockpit shows the same list; a pool member uses the provider's active account unless it pins one as provider@slot/model.

  • Cockpit. The plugin page in DSH shows one tile per provider with its state (live, signed in, key, reachable, needs approval, acknowledgement needed, sign in, no key, blocked, unreachable), the pool chain with its last attempt order, and an ROI card: calls, tokens and priced value per provider and month, prompt cache hit rate (this month and over the last 50 calls, warning below 70 %), time to first token p50 and p95 over the last 100 calls, and health per tile (p95, failure rate, plan share) once data exists. See Cockpit.

  • Quota windows. Plan windows come from the vendor's rate-limit headers (standard rate-limit headers for xAI and the ChatGPT plan). An Anthropic plan window at 90 % or more logs a warning in the harness log, the cockpit forecasts "full in ~n min" from the last 12 readings, and a spent window moves a pool member to the back.

  • Plan rate. The plan headers say how full a window is, never what a call cost. Unthrottle learns it: between two readings of an account the window grew by the calls that finished in between, whose list-price value is known, so many such intervals give list-price dollars per percent of each window (resets, idle gaps over 15 min, growth while no own call is open, calls without a list price, per-minute budgets and overage readings are not counted; growth seen while an own call is still open is carried to the interval in which that call's cost arrives). Once 3 % of a window and 5 intervals were observed, the cockpit quota card shows "1 % ≈ $0.83 list price · ≈ 120 calls left" (calls of the recent average size), unthrottle_status says the same, and the turn tag shows the share of the plan window a turn used. It assumes the plan weighs calls by list price. Learned intervals (counts and dollars only) are kept 14 days in $DSH_HOME/unthrottle-plan-rates.json, and the token classes of the same intervals in $DSH_HOME/unthrottle-plan-features.json, joined on the interval timestamp; the plan-rate file keeps the format 1.5.0 writes, so a process on that release neither loses a rate nor sees anything new. The pool uses both too: a plan with fewer than 10 calls of the recent size left takes no more background work, one with fewer than 2 no more conversation turns, even when its share alone is below the 80 % and 95 % marks; the routing policies keep such a plan behind the others whatever its scores. The call size is the average of recent conversation calls (titles and compaction count toward the rate, not toward the size), and a reading older than 30 minutes no longer parks a plan.

  • Meter calibration belongs to the full edition. It learns what the Claude plan meter weighs per token class from the plan own window headers. This build has no Claude subscription route, so nothing calibrates here and every plan figure is the API list price.

  • Twin (offline replay). dsh-unthrottle twin reads the harness's own session logs (read-only, no model call, no network) and replays every Claude request under eight prompt-cache and context policies: the current behaviour, all-1h, all-5m, retention while a subagent is live, an earlier compaction at 300k or 400k prompt tokens, and a frozen toolset two ways (with the union tool cost as the upper bound, without it as the lower bound). A repeated message id is dropped and counted, so one message is never replayed twice. It reports each policy's weighted cost delta against today's policy overall and per week, and only recommends one after the current policy reproduced the measured cache reads and writes within 5 %. See Twin.

  • Provider hub. 21 declarative descriptors across four protocol families; a user descriptor in $DSH_HOME/providers.d replaces a bundled one. See Provider hub (BYOK).

  • Zero dependencies. package.json declares no runtime dependencies, only the harness peer dependencies. The YAML reader is a small subset reader in lib/hub/yaml.js, and the lock-and-replace file write is a verbatim copy of @deepseek-ai/dsh-atomic-write 0.2.2-rc.5 (MIT) under lib/vendor/.

What it is

One Cordis plugin that registers an LLM adapter on the harness seam:

ctx.llm.registerAdapter(ids, adapter)   // hub: every available descriptor id, plus 'pool'

routes: legacy registers only the enabled subscription providers that carry a grant. Exactly one tool is registered on ctx.tools: unthrottle_status, which reads the same snapshot and runs the same repairs as the cockpit page and keeps its schema small, because that schema rides along with every request. Once a route is registered, the provider behaves like any other: selectable per session, per agent, and per subagent, and visible in the model picker with its own context window, image policy, retry policy, and reasoning levels.

Status

ProviderRouteProtocolLive catalog (checked 2026-11-29)Multi-turn + toolsImages
SuperGrok / X PremiumxaiResponses API (/v1/responses)live, 7 chat models (filters imagine-*)verified (encrypted_content replay)input_image
ChatGPT planopenaiResponses API via Sign in with ChatGPTno live request answered; a live sign-in on 2026-12-01 failed on a Free planoffline-verified (stream contract), fake-server end to end in ui-check.ps1input_image
Google AntigravityantigravityCloud Code Assist (Gemini-only)implemented (fetchAvailableModels)offline-verified (thoughtSignature)inlineData

Claude models are BYOK in this build: the anthropic descriptor sends the documented Messages API request with x-api-key and anthropic-version, native image blocks and the thinking settings its catalog entry names, without a Claude Code identity and without subscription OAuth. The subscription route, its adaptive-thinking replay and its cache behaviour belong to the full edition. Grok runs on xAI's primary Responses API (/v1/responses), preserving reasoning.encrypted_content across multi-turn agent loops, supporting xhigh effort from Grok 4.6 on, filtering imagine-*, image, video and embed models out of the chat picker, enriching catalog metadata from cli-chat-proxy.grok.com, and routing with a stable prompt_cache_key.

ChatGPT plan usage is the one subscription route a vendor documents for open-source and locally hosted apps. login openai registers this host as an agent through the browser: the authorize request carries client_id= dynamic_agent_client, this host's opaque ext_agent_host_id (a UUIDv5 of the machine id, never a user identity) and the plan scope chatgpt.tokens.use.direct; the loopback callback returns the issued client id, which the grant keeps for every later sign-in and refresh. The ID token is verified against OpenAI's published JWKS (RS256, issuer, audience, nonce, expiry) before anything is stored, and a grant without the plan scope is refused. The route posts to POST /v1/responses with the preview contract the docs require — store: false, stream: true, system text through instructions, no sampler fields, no max_output_tokens, no previous_response_id — sends tools as function tools and falls back once to additional_tools input items if the route rejects them, and maps the subscription_sharing_* error vocabulary onto harness codes (usage limit → QUOTA, unavailable → retryable SERVER, unsupported capability → MALFORMED_RESPONSE).

The cockpit's ChatGPT tile starts the same sign-in in the app ("Sign in with browser"): the host opens the loopback listener and hands the authorize URL to the page, which opens it in a new tab and polls until the redirect lands; the grant goes straight into the store. Because the redirect targets 127.0.0.1 on the host, the panel is offered only to a page loaded over a loopback address, and a start whose Origin names another host is refused (remote); from another device use login openai on the host. A returning in-app sign-in reuses the issued client id and host id but sends no id_token_hint, so OpenAI shows its account picker once more.

A new registration exists as soon as the callback names its issued client id, before the code exchange. Both sign-in paths keep that id in $DSH_HOME/unthrottle-openai-registrations.json (client and host ids only, no tokens), so an attempt whose exchange fails reuses it instead of adding another app to the ChatGPT account, as OpenAI's guide asks after invalid_grant. A grant's own client id wins over the kept one. Ids are kept per account name (--account or the tile's account field; no name is the default entry). After removing the app in ChatGPT's settings, start over with login openai --new-registration (add --account <name> for a named account); the tile then reuses the new registration too. An invalid_grant on the exchange reaches the tile as "ChatGPT rejected the sign-in code"; OpenAI's answer carries no reason. Observed on a Free account (2026-12-01): a first registration passed the browser step, the callback listed chatgpt.tokens.use.direct, and the exchange still answered 400 invalid_grant (as in anomalyco/opencode#55211). The retry with the kept registration stopped on OpenAI's own consent page instead: "a required permission is not available; you cannot continue with this workspace and plan", with an upgrade button. So on that account the plan was the cause; the tile names it as a possible one, since OpenAI documents plan ineligibility differently (a grant without the plan scope, or 403 subscription_sharing_user_not_eligible).

Install

# Quit DSH Desktop from the tray, then add the package to a profile:
dsh plugin --profile <profile> add dsh-unthrottle

The bundle patch inserts one row (xai and openai enabled, antigravity disabled by default).

Grants & CLI

A grant is the record unthrottle/<provider> in $DSH_HOME/.credentials.yaml ({ kind: grant, payload: { type: oauth, access, refresh, expires, … } }). The running harness and the CLI both write it only under the document's writer lock (.credentials.yaml.lock), re-read it inside the lock, and refresh a token there: whoever comes second finds the renewed grant and uses it instead of spending the rotated refresh token again. A CLI sign-in reaches the running app on its next request; a provider that was missing gets its route without a restart.

The bin entry installs one dispatcher command, dsh-unthrottle (bin/unthrottle.mjs), which forwards to these scripts with the same arguments and exit code: dsh-unthrottle <login|providers|twin|smoke|status> means login.mjs login <provider>, providers.mjs, twin.mjs, smoke.mjs and login.mjs status. It forwards the other subcommands too (accounts, switch, test, doctor, usage, migrate, and ack in the full edition); an unknown subcommand prints the usage and exits 2.

node bin/login.mjs status                 # records, expiry, blocks, leftover 0.2–0.4 copies
node bin/login.mjs login xai              # xAI RFC 8628 device-code login
node bin/login.mjs login openai           # Sign in with ChatGPT (loopback + dynamic client)
node bin/login.mjs login openai --new-registration  # forget a kept app registration first
node bin/login.mjs login antigravity      # loopback OAuth + PKCE + CSRF state check
node bin/login.mjs doctor                 # per provider: token state, refresh, live catalog
node bin/login.mjs migrate                # move 0.2–0.4 copies into records (DSH closed)
node bin/twin.mjs --since 2026-11-26     # offline replay: which cache policy would have cost least
node bin/twin.mjs --json                   # the same report, machine-readable
node bin/smoke.mjs xai grok-4.7

On startup the plugin moves grants that 0.2–0.4 kept in the ABO_PROVIDERS_* refs or in $DSH_HOME/abo-providers.json into records, without overwriting an existing record, and then removes those copies. A refresh token the provider rejects ends in an AUTH error naming the login command; when the token endpoint names invalid_grant or refresh_token_reused, the dead grant is blocked in its record, so the plugin sends nothing for it until a new sign-in replaces the record. A transient refresh failure keeps a still valid access token and waits 30 s before the next attempt. A refresh that gets no complete token response within 25 s counts as transient and frees the lock. A 403 TOS_VIOLATION from Antigravity blocks the provider in its record until the next login antigravity.

Antigravity sign-in needs an OAuth client pair, resolved in order: UNTHROTTLE_ANTIGRAVITY_CLIENT_ID / UNTHROTTLE_ANTIGRAVITY_CLIENT_SECRET (the 0.8 names DSH_ABO_ANTIGRAVITY_CLIENT_ID / ..._SECRET still work), clientId/clientSecret in the stored grant, or $DSH_HOME/unthrottle-client.json ({"antigravity": {"clientId": "…", "clientSecret": "…"}}, never inside the repository). The plugin only reads this file and does not set its permissions; on Windows restrict it yourself, for example icacls "$env:USERPROFILE\.dsh\unthrottle-client.json" /inheritance:r /grant:r "$($env:USERNAME):F". Set DSH_ABO_OAUTH_TIMEOUT_MS to change the 5-minute callback timeout.

For the Sign in with ChatGPT checks, DSH_ABO_OPENAI_AUTH_BASE and DSH_ABO_OPENAI_API_BASE replace the auth and API origins; only a plain http://127.0.0.1:<port> or http://localhost:<port> is accepted, anything else is ignored with one warning. This is the test hook for the fake server in scripts/ui-check.ps1 (maintainer's checkout), not a setting for normal use. The public build ignores both variables, and refreshes and API calls use them only with a grant that stand-in issued, never with one from auth.openai.com.

Named accounts: node bin/login.mjs login xai --account work stores a second grant at unthrottle/xai-work; node bin/login.mjs accounts lists the accounts and node bin/login.mjs switch xai work makes one active. The cockpit shows the same list on the provider tile and can switch without the CLI. A plain pool member uses the active account of a provider; a member written provider@slot/model pins one account (see Pool).

One client per account. A refresh token rotates when it is used. Do not run this plugin and another subscription client on the same grant at the same time.

Configuration

Exported as a @deepseek-ai/schemastery Config schema:

- id: unthrottle
  name: dsh-unthrottle
  config:
    routes: hub                         # hub (default) | legacy direct routes
    providers:                          # legacy-mode toggles; hub routes follow their descriptor's policy
      xai: { enabled: true }
      openai: { enabled: true }
      antigravity: { enabled: false }
    hub:
      enabled: true
      providers: []      # optional allowlist of descriptor ids
      presets: true      # false turns every OAuth preset off
      optIn: []          # tos-risk/manual key plans and native ids, e.g. [zai-coding]
      dirs: []           # extra descriptor dirs; $DSH_HOME/providers.d is always read
      localProbe: true   # register Ollama / LM Studio only while they answer
      prepaid: [deepseek-account]  # routes paid outside the API: $0 for cheapest-adequate, never under the cap
    pool:
      enabled: true
      continuation: true # keep a cut answer: whole tool calls, the next member goes on
    pools:               # failover pools under the "pool" route
      - id: auto
        name: Auto (Claude, Grok, Kimi, GLM, DeepSeek)
        members: [anthropic/claude-opus-5-5, xai/grok-4.7, kimi-code/kimi-for-coding, zai-coding/glm-5.4, deepseek-account/deepseek-v4-pro]
      - id: fast
        name: Fast (Claude Haiku, Grok, Kimi, DeepSeek)
        members: [anthropic/claude-haiku-5-5, xai/grok-4.7, kimi-code/kimi-for-coding, deepseek-account/deepseek-flash]
    presets:             # per-provider preset override; absent = policy default
      xai: true
      openai: true
      antigravity: false
    claudeThinkingDisplay: summarized  # summarized | omitted
    claudeCacheTtl: auto               # auto | 5m | 1h
    claudeMeterRouting: auto           # auto | off: whether the learned plan meter steers the plan share
    claudeSecondBreakpoint: true       # a fourth marker for tool loops; off after a cache_control 400
    planPrices: { anthropic: 0, xai: 0, openai: 0 }  # USD per month; 0 shows the list price without a ratio
    roiExtraProviders: []  # further route ids counted on the ROI card

A pool may set routing to balanced (default), fastest, cheapest, quota or cheapest-adequate: once health, latency or forecast data exists, the listed policy orders the members; without data the configured order stays. cheapest has no cost signal wired yet. cheapest-adequate needs no signals: among the members that are not cooling and whose plan is below the kept-back limit it orders by the estimated list price of one call (20k input plus 2k output tokens at the prices.js rates), members without a list price after the priced ones in configured order; a subscription member whose plan window has room counts as $0, since the plan is prepaid. monthlyCapUsd: 20 sets a monthly budget for members billed to an API key: once the list-price value of their calls this month reaches it, they are tried only as the last resort, after every other member. The agent status line shows the policy and cap $<spent> of $<cap>. Calls on other adapters' routes are not counted toward the cap. A plain member uses the active account of its provider; a pinned member (provider@slot/model) always uses that account. Routes named in hub.prepaid (default [deepseek-account], the harness's own DeepSeek route) are already paid for outside the API: their members count as $0 in cheapest-adequate, are never counted toward monthlyCapUsd and are never moved behind it as an API last resort; an explicit list replaces the default.

With routes: hub a descriptor registers when its key resolves (harness credential store first, then the environment), when a keyless loopback server answers, or when its policy-enabled preset has a grant record. presets overrides the preset policy default (standard on; consumer-oauth, tos-risk and manual off, with consumer-oauth also waiting for the acknowledgement below). A key-based plan whose descriptor policy is not standard, and a descriptor marked native (the harness serves that id itself, e.g. deepseek), registers only when listed in hub.optIn. An id that another adapter already owns is never claimed.

Keys

node bin/providers.mjs key set kimi-code     # prompts without echo, or reads stdin
opa read "op://Vault/Item/credential" | node bin/providers.mjs key set kimi-code
node bin/providers.mjs key unset kimi-code
node bin/providers.mjs list                  # store | env | local | oauth grant | missing

key set writes the descriptor's auth.env ref into $DSH_HOME/.credentials.yaml under the store's lock and never prints the key. The running harness reports the change as credentials/reference-updated; the plugin then re-selects its routes, so a new key registers its route and a removed one unregisters it without a restart.

Pool (failover)

The pool route exposes one model per configured pool. A call goes to the first available member; members are provider/model and may name any registered harness route, including routes of other adapters (for example the native DeepSeek route). Members without a credential or route are skipped, and a pool without any available member is not listed.

Chunks are held back until the first text, reasoning or tool delta. A member that fails before that with a rate limit, exhausted quota, auth error, server error, timeout, transport error, empty response, a missing route or HTTP 404 hands the same request to the next member; a malformed request (for example HTTP 400) returns at once. A failure after output has started is continued (pool.continuation, on by default): tool calls reach the harness only as a whole, so a call cut in the middle never shows; when complete tool calls are already visible the step ends with them, the harness runs them and the cut member keeps the call's usage; otherwise the next member that is not cooling receives the same messages plus the shown partial answer and a short reminder to go on from its last character (never an assistant prefill), and its text is merged into the open block. A repeated tail is trimmed, also a long one: text that restarts inside the shown tail is held while it matches and only what follows the end of the shown text is shown; a restart that turns into other words before that end was no repeat, and the held text is shown in full. The continuing member's reasoning and replayState are dropped and its usage replaces the cut member's. A continuation that adds nothing (only reasoning or only a repeat), or that a member refuses (even as malformed, since it is not the request the harness made), goes to the next member; at most two continuations run per call. When nobody can go on, the harness gets the shown text and the original failure as a finish chunk, never a thrown error, and the plugin's own repair hook does not re-run that step, which would answer a second time. With pool.continuation: false a failure after output is the call's failure and the repair hook may re-run the step, as before. A failed member cools down: the provider's Retry-After when given (capped at 6 h), otherwise 60 s for rate limits, 15 min for quota, 5 min for auth, 1 h for an unknown model, 30 s for transient errors and 15 s for an overloaded model (HTTP 529 or an in-stream overloaded_error, which cools only that model). A member that fails again after its cooldown ended waits twice as long, with up to 20 % jitter, until 15 quiet minutes reset the streak; failures while it is still cooling count as one episode. Account-level failures cool the whole provider. When every member is cooling, the one that recovers first is tried. The pool's model metadata is the conservative merge of its members (smallest context window and output limit); a capability the members do not all share is not claimed, so a pool reports toolUpdate only when every member reports the same mode, while image input is the union: the pool advertises images when at least one available member accepts them, and only an all-text-only pool lists text alone. Hub members receive the nearest reasoning effort they support and image placeholders when they are text-only; members on other harness routes run with their route's default effort, and the harness projects images for them from that route's metadata. Failovers are logged as [unthrottle] pool auto: <member> <code>, cooling <n> s; trying <next>.

A member may pin one of your named accounts as provider@slot/model, for example members: [xai@work/grok-4.7, xai/grok-4.7]: the first member signs requests with the grant at unthrottle/xai-work without switching the active account, the second uses whichever account is active. The slot follows the --account rule (lower-case letters, digits and -, at most 24 characters); an invalid slot is reported as a config issue and the member is dropped. Cooldowns, stickiness, failure rates and plan readings are kept per account, so one account hitting its window does not pause the other; a pinned member needs a subscription route of this plugin and is skipped on routes of other adapters. This is meant for separate accounts you own yourself, not for spreading one person's use over extra accounts: provider terms (Anthropic's usage policy among them) may treat that as abuse, and pinning multiplies no quota.

Use it anywhere a model is chosen, for example as the subagent model pool/auto, so a rate-limited plan does not stop a running agent.

The harness logger keeps its lines in memory, so the running plugin also writes $DSH_HOME/unthrottle-pool.json: the member that served each pool last, the number of calls since start and the last 20 failovers (ids, codes and times only, never a key or a message body). A change of serving member is written at once and logged as [unthrottle] pool auto: served by <member>.

node bin/providers.mjs pool          # pool/auto: served by anthropic/claude-opus-5-5 at …
node bin/providers.mjs pool --json

Alerts

Optional push alerts when a route locks, off by default. Five events exist: quota (a subscription plan window is spent, the same condition that raises the harness QUOTA notice), overage (the plan headers report representative-claim: overage, so calls draw from billed extra usage; sent once per billing boundary, not once per call), blocked (an account-level block was recorded on a grant), auth (a refresh failed terminally, for example invalid_grant, and a new sign-in is needed) and pool-exhausted (no pool member could serve a call). Each is one ntfy-compatible HTTP POST: a short plain-text body plus the headers Title, Priority (high for blocked, auth, overage and pool-exhausted, default for quota) and Tags, and Authorization: Bearer <token> when a token is set. A generic webhook receives the same POST.

- id: unthrottle
  name: dsh-unthrottle
  config:
    alerts:
      url: https://ntfy.sh/my-unthrottle-topic
      token: NTFY_TOKEN        # credential ref name, resolved like API key refs; empty = no header
      minIntervalMinutes: 30   # per (event, provider/pool)
      events: [quota, overage, blocked, auth, pool-exhausted]

The token is looked up like an API key ref: the DSH credential store first, then an environment variable of that name. The config only names the ref, never the token itself. While alerts.url is empty, DSH_NTFY_URL and DSH_NTFY_TOKEN from the environment apply, the same convention as dsh-superagent. A POST times out after 5 s, is retried at most once and never reaches the request path; a failure is logged once as [unthrottle] alert delivery to <host> failed: <code>. Messages carry the provider or pool id, model id, window name, reset time and error code only, never prompt text, tokens, grant fields, account ids or e-mail addresses. The cockpit status shows alerts: { enabled, host, lastSentAt, lastError }, with the target host only.

Provider hub (BYOK)

providers.d/*.yml is the declarative registry for ordinary API-key providers. A descriptor names the provider, one of four protocol families (openai-chat, openai-responses, anthropic-messages, gemini), the base URL, where the key comes from, and the endpoint's chat-completions quirks. Descriptors are data only: no secret, no code. 21 ship: fourteen BYOK providers (OpenAI, xAI, Anthropic, Google Gemini, DeepSeek, Mistral, Groq, OpenRouter, Together, Fireworks, Perplexity, Cerebras, plus the uncensored yeta and abliteratedllm endpoints), four coding plans (kimi-code, zai-coding, zhipu-coding, minimax-coding), two local servers (ollama, lmstudio, auth.type: none, loopback only) and the OAuth-only Antigravity descriptor. Coding-plan model ids come from vendor docs and are not checked against a live endpoint here; a user descriptor in $DSH_HOME/providers.d with the same id replaces the bundled one (for example to add a header).

All 21 descriptors, with the key variable each one reads. The last column says whether the route answered a live request in the maintainer's checkout (state of 2026-11-29): three routes did (xai, yeta, abliteratedllm), the other 18 have no live check on record. The openai row adds later evidence: a live sign-in on 2026-12-01 reached OpenAI and failed on a Free account, and the fake server in scripts/ui-check.ps1 now drives the same flow end to end.

IdProviderProtocolKey variableNotesLive in this checkout
anthropicAnthropicanthropic-messagesANTHROPIC_API_KEYAPI key route; plan sign-in not in this editionno
xaixAIopenai-responsesXAI_API_KEYOAuth plan preset (SuperGrok / X Premium)yes (subscription sign-in, /v1/responses)
openaiOpenAIopenai-responsesOPENAI_API_KEYOAuth plan preset (Sign in with ChatGPT, preview)no live request answered; the live sign-in (2026-12-01) failed on a Free plan; fake end to end in ui-check.ps1
antigravityGoogle Antigravitygemininone (OAuth only)policy tos-risk, off by defaultno
yetaYetaopenai-chatYETA_API_KEYuncensored, text only, one modelyes (6 models listed, streamed a reply)
abliteratedllmAbliteratedLLMopenai-chatABLITERATEDLLM_API_KEYuncensored, GLM 5.3 Flash/Cyber and Kimi K3.1 Propartly: key, route and catalog work; inference answered HTTP 503 at check time (provider outage)
googleGoogle GeminigeminiGEMINI_API_KEYx-goog-api-key headerno
deepseekDeepSeekopenai-chatDEEPSEEK_API_KEYnative: the harness serves this id itself, opt in with hub.optInno
mistralMistral AIopenai-chatMISTRAL_API_KEYno
groqGroqopenai-chatGROQ_API_KEYno
openrouterOpenRouteropenai-chatOPENROUTER_API_KEYno
togetherTogether AIopenai-chatTOGETHER_API_KEYno
fireworksFireworks AIopenai-chatFIREWORKS_API_KEYno
perplexityPerplexityopenai-chatPERPLEXITY_API_KEYstatic model list, text onlyno
cerebrasCerebrasopenai-chatCEREBRAS_API_KEYtext onlyno
kimi-codeKimi Codeanthropic-messagesKIMI_API_KEYcoding plan, static model listno
zai-codingZ.ai GLM Coding Planopenai-chatZAI_API_KEYcoding plan, policy tos-risk, needs hub.optInno
zhipu-codingZhipu GLM Coding Plan (CN)openai-chatZHIPU_API_KEYcoding plan, policy tos-risk, needs hub.optInno
minimax-codingMiniMax Coding Plananthropic-messagesMINIMAX_API_KEYcoding plan, static model listno
ollamaOllama (local)openai-chatnoneloopback, registers while the server answersno
lmstudioLM Studio (local)openai-chatnoneloopback, registers while the server answersno

The two uncensored routes (yeta, abliteratedllm) are plain API-key endpoints. The plugin adds no filter of its own; the provider's terms and the law of your jurisdiction apply.

id: acme
name: Acme
protocol: openai-chat
baseUrl: https://api.acme.test/v1
auth:
  type: api-key
  env: ACME_API_KEY
chat:
  maxTokensField: max_completion_tokens
  streamUsage: false
  reasoningEffort: true
  temperature: false
  images: false
models:
  - acme-1
  - acme-2

Validation is strict: unknown fields, duplicate ids, a file name that does not match the id, remote plain HTTP, URL credentials, a bad environment-variable name and credential-looking static headers are refused with the file and the field. One broken file never hides the valid ones.

node bin/providers.mjs list
node bin/providers.mjs list --json
node bin/providers.mjs test openai   # GET /models with $env:OPENAI_API_KEY

list never reaches the network and never prints a key, only whether the descriptor's environment variable is set. test exits 3 when that variable is missing, 2 when the provider or the protocol is unknown, and 1 when the provider rejects the request.

The four protocol modules share the request/stream mechanics but keep their wire rules local. openai-chat sends system text as the first message, image data URIs as image_url parts, tools as function declarations, and answers every assistant tool call before the next turn. openai-responses sends store: false, flat function tools and encrypted reasoning when an effort is set, and reuses the harness Responses item translation. anthropic-messages sends the documented developer request without the subscription identity: x-api-key plus anthropic-version, native image blocks, and a tool_result at the start of the user turn that answers a tool_use, with an interrupted result filling a gap in the history. gemini sends contents with parts (inlineData for images, functionCall / functionResponse matched by function name), maps thought parts to reasoning blocks and synthesises stable call ids. All four translate text, reasoning, tool arguments, usage and finish reasons onto harness stream chunks. anthropic-messages retries once with a lower max_tokens ceiling when a 400 names one. A later system message on a route that does not declare systemPromptUpdate: 'in-history' waits for the next user turn and travels there as <system-reminder> text, so the leading prompt and its cache stay stable; the subscription transports use the same fallback. These are the BYOK request shapes; a preset with transport: subscription hands the call to the verified module instead, which adds the vendor's OAuth context.

Registration: with routes: hub (the default) index.js reads the registry at startup and registers one hub route per available descriptor: a BYOK route when its key resolves (the harness credential store first, then the environment), otherwise a policy-enabled preset with a stored grant. The preset keeps the provider id (anthropic, xai, openai, antigravity), so the model picker and existing sessions are unchanged. A grant or key written or removed later by the CLI updates its route without a restart. hub.providers restricts the hub to an allowlist and hub.presets: false disables every preset. routes: legacy restores the direct subscription routes and leaves the hub with BYOK only. The key is resolved on every call, so rotating it needs no restart either.

The model picker shows a live badge on the routes and pools it lists. A subscription route reports its fullest plan window (5h 82 %, warning tone from 80 %), overage (Überzug) while the plan draws on extra usage; a pool row shows paused (Pause) when every member is cooling, otherwise its routing policy. The listing is refreshed when a reading crosses a band (under 80 %, 80–94 %, 95 % and overage) or a pool's cooling state changes, at most once per 30 seconds per provider.

OAuth presets

A descriptor may carry an OAuth preset next to its BYOK auth:

preset:
  type: oauth
  provider: xai             # GrantStore record id (unthrottle/<provider>)
  policy: standard          # standard | consumer-oauth | tos-risk | manual
  transport: subscription   # hub (generic protocol, the default) | subscription (verified module)

transport: subscription is what makes H4 a migration rather than a rewrite: the hub route resolves the grant and then calls the same verified provider module the direct route used (lib/providers/anthropic.js, xai.js, openai.js, antigravity.js), including the ChatGPT-plan preview body rules and the Cloud Code envelope. A subscription preset may omit auth entirely (Antigravity does), because no BYOK key exists for it. The default transport, hub, uses the generic protocol modules and is the right choice for an OAuth endpoint that follows its documented wire format.

Activation follows the policy class: standard presets register by default; consumer-oauth (the Claude plan route) additionally needs the row's acknowledgement, and tos-risk (account-level block risk, for example Antigravity) and manual never register by default. presets.<id>: false turns one off, presets.<id>: true forces a preset on except consumer-oauth, which only the acknowledgement enables, and hub.presets: false turns every preset off. Credentials are resolved BYOK-first: a resolved key wins (the store first, then the environment); otherwise the adapter reads the grant's access token. Missing grants and refresh failures become AUTH errors that name node bin/login.mjs login <provider>; a 401 retries once with a forced refresh, and a block reason from the vendor is recorded through the store.

routes: hub
hub: { enabled: true, presets: true }
presets:
  xai: true
  openai: true
  antigravity: false

The subscription transports are the modules from 0.6.0. The hub wrapper is verified offline (bridge dispatch, 401 refresh, block recording, catalog metadata). routes: legacy is the escape hatch if the direct registration path is needed.

Architecture

How the pieces fit: every grant is one record in the harness credential store, refreshed under the store's cross-process lock, and the CLI writes through the same lock. The provider hub is the declarative registry plus four protocol families (openai-chat, openai-responses, anthropic-messages, gemini) and an OAuth-preset layer that carries the subscription routes themselves. A preset with transport: subscription reuses the provider modules (anthropic, xai, openai, antigravity), so the Cloud Code envelope and the ChatGPT-plan preview contract stay with the code that implements them; routes: legacy keeps the direct subscription routes as an escape hatch. API keys come from the harness credential store (then the environment), routes appear and disappear live, coding plans and local servers ship as descriptors, and the pool route fails over between members when one is rate limited, out of quota or down. 21 descriptors ship, including two uncensored BYOK routes (yeta, abliteratedllm). The Anthropic route takes an API key.

index.js                      Config schema, record backend over ctx.credentials, migration, hub/legacy route registration, selfcheck
lib/adapter.js                LlmAdapter factory, retryPolicy, per-route image limits and hydration, 401 retry, TOS block, cache TTL, rate-limit warning
lib/accounts.js               account index: slots, labels, active account, under the credential store's file lock
lib/body.js                   capped reads of untrusted response bodies
lib/credentials.js            GrantStore over records: refresh under the record lock, backoff, block, legacy migration
lib/record-file.js            CLI record backend: .credentials.yaml under the harness writer lock
lib/vendor/dsh-atomic-write.js  verbatim @deepseek-ai/dsh-atomic-write 0.2.2-rc.5 (MIT): lock + atomic replace
lib/catalog.js                context windows, output ceilings, reasoning defaults, systemPromptUpdate
lib/compliance.js             consumer-plan acknowledgement gate (compliance.acknowledged)
lib/edition.js                build-time edition, narrowed by the row but never widened
lib/errors.js                 typed error taxonomy, secret sanitization, request-id & Retry-After parsing
lib/effort.js                 maps a requested reasoning effort onto the nearest one a route accepts
lib/http.js                   bounded fetch timeouts distinguishing TimeoutError from AbortError
lib/sse.js                    SSE framing with per-chunk idle timeout and abort handling
lib/tools.js                  MCP/tool name sanitization (<=64 chars) + JSON Schema hygiene + reverse map
lib/unicode.js                lone-surrogate removal for outgoing text
lib/oauth.js                  PKCE, random CSRF state, loopback server, form/JSON exchange, device flow
lib/openai-auth.js            Sign in with ChatGPT: host id, dynamic client, loopback callback, JWKS-verified ID token
lib/openai-endpoints.js       auth and API origins, with the loopback-only override for the UI check
lib/openai-registration.js    kept issued client ids per account slot (client and host ids only)
lib/system-reminder.js        <system-reminder> frame for mid-conversation system text
lib/provider-auth.js          standalone Claude PKCE and xAI device-code CLI sign-in flows
lib/antigravity-auth.js       Antigravity loopback consent with CSRF verification & client resolution
lib/responses.js              shared Responses API translation (items, streaming blocks, usage, replay state)
lib/probe.js                  harness-shaped Claude request probe (plan vs third-party classification)
lib/latency.js                time to first token p50/p95 over the last 100 calls per provider
lib/repair.js                 mid-stream repair on agent/request-error: one grant renewal or pool walk
lib/usage.js                  plan windows from the rate-limit headers, burn forecast
lib/alerts.js                 optional ntfy/webhook alerts on quota, overage, block, auth and a spent pool
lib/hub/yaml.js               dependency-free YAML subset reader for provider descriptors
lib/hub/descriptor.js         strict descriptor schema, defaults and validation
lib/hub/registry.js           providers.d loader with per-file error reporting
lib/hub/policy.js             preset policy classes: risk, default activation, explicit override, acknowledgement
lib/hub/adapter.js            hub adapter: route selection, BYOK/OAuth credentials, subscription transport, catalog, model metadata, error translation
lib/hub/keys.js               key source: harness credential store first, then the environment
lib/hub/pool.js               pool route: member parsing, failover rules, cooldowns, metadata merge
lib/hub/pool-status.js        unthrottle-pool.json: serving member, calls, the last 20 failovers
lib/hub/breaker.js            windowed failure health per route
lib/hub/protocols/index.js    protocol registry (listModels + stream per family)
lib/hub/protocols/common.js   shared auth headers, HTTP errors and catalog parsing
lib/hub/protocols/openai-chat.js      OpenAI-compatible chat completions (request, SSE, catalog)
lib/hub/protocols/openai-responses.js Responses API for BYOK (stateless request, shared translation)
lib/hub/protocols/anthropic-messages.js Messages API for BYOK (tool_result ordering, thinking, cache usage)
lib/hub/protocols/gemini.js   Gemini contents/parts, function calls by name, thought parts, catalog limits
providers.d/                  BYOK, coding-plan, local and OAuth-only descriptors (21)
lib/providers/anthropic.js    Messages API (OAuth identity, adaptive thinking, prefix-bound replay, in-history system, cache TTL)
lib/providers/xai.js          Responses API (/v1/responses, encrypted_content replay, cli-chat-proxy enrich)
lib/providers/openai.js       Responses API via ChatGPT plan (preview contract, subscription_sharing_* mapping)
lib/providers/antigravity.js  Cloud Code Assist (Gemini-only, thoughtSignature replay, parallel tool merge, TOS block flag)
lib/cockpit/                  status snapshot, ROI ledger and prices, turn ledger, sign-in route, provider actions, client reports, Web UI (lib/cockpit/ui, built into client.js)
bin/                          status, accounts, sign-in, live catalog test, doctor, migrate, smoke probes, provider registry, pool status
scripts/                      build-client, build-public, ui-check (throwaway DSH home), fake-llm and fake-openai-auth servers, typecheck, coverage
test/                         node:test suites

scripts/ and test/ live in the maintainer's checkout only: neither the npm package nor the public repository ships them, so the ui-check and test commands below run there and not from an installed package.

DSH 0.2.3

DSH 0.2.3 moves the tool registries and raises its own Node floor to ^24.22.3 || >=26.13.1. Check the plugin against that build without touching the installed app or the real profile:

pwsh -NoProfile -File scripts/ui-check.ps1 `
  -DshCli <path to node_modules\@deepseek-ai\dsh\lib\bin.js> `
  -Node <path to node.exe>

The script boots a throwaway DSH_HOME of its own for such a build, refuses the real one, reads the target package's engines.node and refuses to boot on an older Node. The ui-check run on 2026-12-01 against 0.2.3-alpha.3 with Node 24.23.0 was green: the plugin loads, the pool fails over, the quota notice and the ROI card show, unthrottle_status reaches the model and the page reports no errors. The same script on the installed rc.5 gave the same result. The run covers the CLI web host, not the alpha.3 Electron app. Tool registration is honest too: unthrottle_status needs the host's tools.register, and a host that exposes no such hook no longer looks healthy. The cockpit action result carries selfcheck.host.problems: ["tool-not-registered"] and the log one tool-not-registered WARN, so the page and the CLI can say the tool is missing.

Tests

npm test

Offline suites cover SSE framing, idle/fetch timeouts, secret redaction, tool name/schema sanitization, all four provider protocols, prefix-bound thinking replay, mid-conversation system messages (including the <system-reminder> fallback), per-route image limits, cache TTL, surrogate removal, the record backend under the harness lock (including a second process), grant refresh races, legacy migration and the exact harness LlmError/retryPolicy contracts. The ChatGPT-plan suite covers the authorize request, the host id, a real RS256 ID-token check against a generated JWKS, the code exchange with the issued client id and resource, the preview request body, the subscription_sharing_* mapping, the additional_tools fallback and the refresh that keeps the id token. The endpoint tests cover the loopback-only override (a remote value is ignored, unset means the real origins), and the fake auth/API server is exercised through the real validator and in the ui-check. The hub suite covers the YAML subset reader, descriptor and registry validation, the four protocol modules (request shaping, tool-result ordering, images, SSE translation, usage, finish reasons and catalog fallbacks), the hub adapter (route selection, BYOK/OAuth credential resolution, the subscription-transport bridge with 401 refresh and block recording, model metadata, LlmError translation), the preset policy classes and the providers.mjs exit codes. No network; yaml is resolved from the installed DSH profile for the record-file tests and they skip without it.

Limits

  • Claude models are BYOK in this build. The anthropic descriptor takes an ANTHROPIC_API_KEY and sends no Claude Code identity. The subscription route and its terms analysis belong to the full edition.
  • Antigravity carries an account-level 403 TOS_VIOLATION risk on third-party clients, Google staff advised against DSH plugins on consumer sign-in (2026-11-11), and the route stays disabled by default.
  • The ChatGPT-plan route is a preview capability with documented limits: store: false and stream: true are mandatory, previous_response_id does not work over HTTP (history is sent in input), image generation, file search, Code Interpreter, hosted MCP and tool_search are unsupported, and a Plus five-hour limit is shared across every app that uses the plan. Limits are set per app in ChatGPT settings → Usage. Nothing is stored server-side, so a context that does not fit the model's window fails rather than truncating.
  • No live OpenAI request has been answered yet. A live sign-in on 2026-12-01 reached OpenAI and failed on a Free account: the callback listed chatgpt.tokens.use.direct, the code exchange answered 400 invalid_grant, and the retry with the kept registration stopped on OpenAI's consent page. The openai API-key descriptor and the plan route are checked offline against the documented preview contract (authorize request, ID-token check, request body, error mapping), and a fake auth/API server (scripts/fake-openai-auth.mjs) now drives the in-app sign-in end to end in scripts/ui-check.ps1: a fake sign-in reaches a live openai route, and the invalid-grant mode reaches the tile as the code-rejected text. The /v1/models catalog call is not live-tested, and a live sign-in with a paid plan plus one real turn is open.
  • abliteratedllm currently answers 503. At the last check (2026-11-29) the key authenticated and the catalog listed 17 models, but inference returned HTTP 503 safety_unavailable on every model tried, including the control model. That is an outage on the provider's side, not a plugin fault, and it has not been re-tested since. yeta is the uncensored route that streamed a reply.
  • Uncensored routes carry no filter from this plugin. yeta and abliteratedllm are plain API-key endpoints; the provider's terms and your jurisdiction decide what is allowed.
  • Coding-plan descriptors (kimi-code, zai-coding, zhipu-coding, minimax-coding) use model ids from vendor documentation and are not checked against a live endpoint. The Z.ai and Zhipu plans restrict use to tools they list, so they stay off until you opt in with hub.optIn.
  • Local routes (ollama, lmstudio) register only while their server answers on loopback.
  • Images are held to each route's documented limits. The attachment service downscales to 1568 px and 5 MB per image, 2576 px on Claude 4.7+/5.x. An image that carries its own bytes is replaced only when the route documents a per-image ceiling (Claude 10 MB base64, Mistral 10 MB, xAI 25 MiB; a route that documents none is bounded by its request budget alone). Per request the documented ceilings apply: Anthropic 8000 px and 128 MB of base64 (100 images, 600 above a 200k-token window, 3000 px above 20 images), Google and Antigravity 20 MB and 3600 images, Groq 3 images and 20 MB, Mistral 8 images and 10000 px, Fireworks 120 images and 10 MB, OpenAI 1500 images and 512 MB. 1 MB of every request budget is kept for the prompt text, images a route serializes as text (such as the screenshots in a tool message on a chat wire) count towards neither the image count nor the byte budget, and every pool member hydrates the request with its own limits. An image over a limit becomes a short text placeholder instead of a rejected request (lib/adapter.js IMAGE_POLICIES).

Troubleshooting

SymptomLikely causeWhat to do
Error <id> has no API key; set <ENV> … or the route is missing from the pickerNo key in the DSH credential store or the environmentdsh-unthrottle providers key set <id> (reads stdin or prompts without echo), then dsh-unthrottle providers list: it shows store, env, local, oauth grant or missing and never the key. A new key registers its route without a restart
AUTH error naming a login command, or HTTP 401A subscription grant is missing or its refresh token was rejected; for a key route, the provider refused the keyThe adapter retries a 401 once with a forced refresh. If it persists, run dsh-unthrottle login <provider> for a plan route, or set the key again and check it with dsh-unthrottle providers test <id> (exit 1 means the provider rejected it, 3 means no key). dsh-unthrottle doctor shows token state, refresh and live catalog per provider. Never run two clients on the same grant: a refresh token rotates on use
HTTP 429 or a spent plan windowRate limit or plan window used upA pool route moves to the next member and cools the failed one (the provider's Retry-After, else 60 s for a rate limit and 15 min for exhausted quota). Wait for the reset or add a member to the pool
HTTP 503 or other 5xxProvider outage or overload (abliteratedllm is the known case)Nothing to fix locally. A pool route treats it as a server error and tries the next member (30 s cooldown for transient errors); a direct route fails the call. Retry later, or switch route
Antigravity 403 TOS_VIOLATIONGoogle blocked third-party use of the accountThe provider is blocked in its record until the next login antigravity; see Limits before signing in again
dsh-unthrottle doctor warns that .credentials.yaml is readable by Everyone, Users or Authenticated Users (Windows)The credential file inherited a broad ACL; the plugin does not set an ACL itselfRun the fix: line doctor prints, for example icacls "%USERPROFILE%\.dsh\.credentials.yaml" /inheritance:r /grant:r "%USERNAME%:F"
Routes missing after installDSH loads the plugin at startRestart DSH; for a CLI-only change use Recheck in the cockpit

Cockpit

The bundle's page in the Plugins view carries a cockpit: one card per provider with its state (live, signed in, key, reachable, needs approval, acknowledgement needed, sign in, no key, blocked, unreachable), the pool chain with each member's pause and the recent failovers, and the plan windows of the subscription routes. Two buttons repair without a restart: Recheck re-reads routes, keys and local endpoints, Clear pauses drops the in-memory cooldowns.

Everything the page and the tiles show comes from six owner-only host routes, all registered through ctx.connection.fetch.register — the route kind DSH serves to owner peers only, so an agent or a foreign page cannot call them: GET /api/unthrottle/status (the snapshot), POST /api/unthrottle/action (recheck, reset-cooldowns), GET/POST /api/unthrottle/client-report (slot reports), POST /api/unthrottle/provider (test, save or remove a key, opt in), POST /api/unthrottle/signin (in-app sign-in) and GET /api/unthrottle/turns (the turn ledger). The snapshot carries route ids, state names, expiries, counts and plan utilizations; never a token, a key or an upstream body.

docs/preview.svg is the picture the plugin list may show.

Provider tiles

Every tile on the cockpit is a button. A click opens the provider's panel right below its row (Escape or × closes it and gives focus back to the tile):

  • API-key providers: where the key comes from (DSH store or an environment variable), a password field, Test and save, Remove key. A key is first shown to the provider's model list; only a key the provider accepts is stored, unless you choose Save anyway. Providers without a live model list save the key marked as untested. Remove key only removes a key the DSH store holds.
  • Opt-in routes (coding plans with a ToS note, routes DSH ships itself): a switch that writes hub.optIn through DSH's profile editor; the plugin reloads.
  • Subscriptions without a grant: the exact sign-in command with a copy button.
  • Every provider: Test connection reloads the live catalog and lists the first 12 models, or shows why it failed.

All of this goes through POST /api/unthrottle/provider, an owner-only route. A key never comes back in an answer, a log line or the status snapshot; upstream error text has the key cut out by value before it is shortened. The agent tool cannot store, remove or approve anything.

Twin

dsh-unthrottle twin (also node bin/twin.mjs) answers a question no vendor report answers: which prompt-cache and context policy would have cost the least on the sessions that already ran. It reads the harness's own logs under $DSH_HOME/sessions — read-only, no model call, no network — decodes the zstd frame chain of every session.v4.jsonl.zstd and turns each measured assistant/message into a request: its prompt tokens (uncached input + cache read + cache write), the tokens it really read and wrote, the events that break a cached prefix (a changed tool list, a compaction, a model switch, a shrunken prompt, the idle gap) and the digest of its static prefix (tool schemas plus system prompt), so two sessions can share it. Compaction summaries are replayed where the log carries their usage; other background calls (title generation, web-search planning) are counted with and without usage but cannot be replayed.

Usage: dsh-unthrottle twin [--sessions <dir>] [--since <iso>] [--until <iso>] [--weights <file>] [--json], plus --input-price and --percent-rate for the plan share. --until is the snapshot time (default: the start of the run): files and events after it are ignored, so two runs with the same snapshot agree.

The replay models Anthropic's prefix cache: the cached entry is the cacheable part of the previous request's prompt (everything except the uncached input, which is never written and is priced at the input weight in every policy); a request reads the smaller of the two entries while it is alive and writes the rest; an entry dies after its TTL (5 minutes or 1 hour) and every read and write refreshes it; compaction, a model switch, a rewritten (shrunken) prompt and — unless frozen — a toolset change break it. Two effects are learned from the logs on one half of the sessions and applied to the other: a first request reads the static prefix another session wrote within the TTL, and the first request after a compaction reads the share of the prompt DSH retained (a compaction without a measured read counts as zero). A background call with a purpose is a fresh prompt; a simulated compaction summary reads the measured share of its own prompt, learned from the real summary calls. Sessions are split by id hash. Every policy carries a learn delta and a holdout delta against P0; the table ranks by the holdout delta. A policy is recommended only when it saves on both halves and by at least two percentage points on the holdout, the holdout replay is calibrated, and neither half is empty; otherwise the table prints the reason. The report also prints how the P4 deltas move when the summary read share is 0 or 1, and how the P0 calibration moves when the retained share is 0 or 1. Policy P0 is the router as it runs today: one hour for turns, five minutes for a background call with a purpose, matching resolveCacheTtl('auto', purpose).

PolicyLevers
P0current: 1h for turns, 5m for background calls with a purpose
P11h for every call
P25m for every call
P3the request directly before a child start (within 5 minutes) gets 1h, else P0
P4a / P4bP0 plus an earlier compaction at 300k / 400k prompt tokens, dropping to the median measured post-compaction size; each simulated compaction pays one summary call (the measured share of its prompt is read, the rest is written at the 5m weight, plus the median measured summary output)
P5P0 without the breaks a toolset change causes, plus the union tool cost learned from the static prefixes (a proxy for tool tokens; an upper bound when no size could be learned)
P5bthe same freeze without the union cost: the later tools are simply dropped (the lower bound of the span; a tool policy is never recommended, because dropping tools mid-session costs capability)

Cost is a weighted token sum in input-token equivalents. The defaults are the API list multipliers (read 0.1, 5-minute write 1.25, 1-hour write 2, output 5, input 1); --weights <file> takes them from a JSON document, flat or under multipliers/classes, and --input-price plus --percent-rate add the plan share. --weights live belongs to the full edition: it prices the replay with the per-class multiples the Claude plan meter learned, and a build without that route has no meter to read. The list multipliers above or a weights file are the only weights here. Calibration compares P0's simulated reads and writes with the measured ones only; more than 5 % error on either marks the holdout replay "not calibrated" and suppresses the recommendation — the numbers are still printed. The table shows each policy's overall delta, its learn and holdout deltas, the simulated compaction count and the priced summary cost; the attribution block splits the residual by origin (main/subagent/fork) and names the modeled causes.

dsh-unthrottle twin --since 2026-11-26
dsh-unthrottle twin --sessions "$env:USERPROFILE\.dsh\sessions" --json
dsh-unthrottle twin --until 2026-11-27T00:00:00Z --json
dsh-unthrottle twin --weights meter.json --input-price 3 --percent-rate 0.08

Routes other than anthropic and pool members served by anthropic are not replayed. Eval sessions are skipped: a cwd below C:\dsh-eval, the old eval/bench cwds, and a header origin that names an eval. The frame decoder resynchronises at the next zstd magic after a corrupt frame (a skipped frame is counted) and treats only a failure at the end of the file as a torn tail.

The log names a route, not its cache TTL, and it carries tokens, not content blocks: the Anthropic cache looks back at most 20 blocks before a breakpoint and writes only at the breakpoint (https://docs.claude.com/en/docs/build-with-claude/prompt-caching), so a breakpoint that lags the prompt cannot be modelled. The report therefore prints the residual per cause and origin instead of explaining it away. An uncalibrated run prints "not calibrated" and no recommendation.

Renamed from dsh-abo-providers

Unthrottle was published as dsh-abo-providers before 0.9.0. Since 0.9.0 the package is dsh-unthrottle, the plugin entry id is unthrottle and grants live under unthrottle/<provider>. The first start moves abo-providers/<provider> grant records to unthrottle/<provider> and removes the old copies; abo-providers-pool.json and abo-providers-client.json stay where they are and are read only as a fallback until the new name exists. node bin/login.mjs migrate moves the records too with DSH closed.

License

MIT, see LICENSE.

Related plugins