← Back to home@tyql688

dsh-providers

Model providers for DeepSeek Harness: sign in with OAuth or an API key, and keep every provider's model catalog current

Stars
1
Language
TypeScript
Created
Aug 14, 2026
Updated
Sep 15, 2026

Introduction

dsh-providers

English · 简体中文

A DeepSeek Harness plugin that manages model providers: sign in, keep the model list current, see what you spend, and know how much plan quota is left. Built on @earendil-works/pi-ai and @lobehub/icons.

Features

Accounts (Settings → Accounts)

  • Sign in with OAuth or an API key. Signed-in providers' models appear in the model picker.
  • Keep several accounts of one provider signed in at once — OAuth logins, and for API-key providers the keys you replaced: an older key is kept as an account and can be made the default again. Re-logging a known account updates it in place; a new one joins the list. The default account serves requests, and switching takes effect on the next request.
  • Refresh a provider's model list from the curated catalog, or read an OpenAI-compatible /v1/models endpoint.
  • Import the OpenAI Codex CLI's existing login instead of signing in again.
  • Reveal a stored API key, sign out, and remove the route in one step.

Tokens today (sidebar card)

  • Today's tokens, estimated cost, the 14-day trend, and the input / output / cache mix.
  • One bar per account of a plan provider — the provider's name alone when it holds one — showing its fullest window (5-hour, weekly, monthly).
  • A one-time warning when a window reaches 90%.

Usage (conversation tab)

  • Windows: today, 7 / 30 / 90 days, all time, with change against the previous period.
  • Overview: tokens, cost, cache hit rate, daily trend by total / model / token kind / cost, mix donut.
  • Chips: active days, peak day, daily average, reasoning share, subagent share, failed turns.
  • Breakdown: per model (share, tokens, calls, first-token p50 · p95, cost), per provider, recent sessions, projects, tools with error rate. Click a row to list the sessions behind it.
  • Activity: GitHub-style calendar, hour-of-day heatmap, and a day table with failed turns and median first-token latency.
  • Enter a price for any model the catalog does not price; figures re-price immediately.

Quota (conversation tab)

  • One card per signed-in provider whose usage API the plugin can read — one per account when a provider holds several.
  • Subscription plans (OpenAI Codex, Kimi For Coding, OpenCode Go, Z.AI / GLM, MiniMax): each 5-hour / weekly / monthly window with a colored bar, reset countdown, and — once two readings exist — how long until it runs out at the current pace.
  • Pay-as-you-go accounts (OpenRouter, DeepSeek, Moonshot Open Platform): remaining balance.
  • Queries go from this machine to the provider's own API with the stored credential. Only percentages and balances reach the browser.

Stats (per-session tab)

  • The session's own tokens, cost, calls, tool calls, cache hit rate, context peak, and per-call timeline.
  • Subagents listed and rolled up separately.

Nothing polls in the background: the sidebar card refreshes on open and when the page becomes visible again; the tabs fetch when opened.

Providers

pi-ai 0.85.1:

  • OAuth: Anthropic, GitHub Copilot, Kimi For Coding, OpenAI Codex, OpenRouter, Radius, xAI
  • API key: Amazon Bedrock, Ant Ling, Azure OpenAI, Baseten, Cerebras, Cloudflare AI Gateway, Cloudflare Workers AI, DeepSeek, Fireworks, Google, Google Vertex AI, Groq, Hugging Face, MiniMax / MiniMax CN, Mistral, Moonshot AI / CN, NVIDIA, OpenAI, OpenCode Zen / Go, Qwen Token Plan (×3), Together, Vercel AI Gateway, Xiaomi (×4), Z.AI / Z.AI Coding CN

Install

dsh plugin --profile web add github:tyql688/dsh-providers

The first add usually fails with ERR_PNPM_IGNORED_BUILDS for @google/genai and protobufjs. Both come with pi-ai; this plugin never runs their install scripts. Deny both, then run the same add again:

dsh plugin --profile web approve-builds '!@google/genai' '!protobufjs'
dsh plugin --profile web add github:tyql688/dsh-providers

From a local clone:

git clone https://github.com/tyql688/dsh-providers.git
cd dsh-providers
pnpm install
dsh plugin --profile web add "$PWD"

Uninstall:

dsh plugin --profile web remove dsh-providers

Files

All under $DSH_HOME (default ~/.dsh):

FileHolds
auth.jsonOAuth tokens; the archived earlier keys of API-key providers
.credentials.yamlAPI keys
model-catalog.jsonCached model catalog, including prices
prices.jsonPrices you entered by hand
settings.yamlProvider routes

Keys from environment variables are never stored. Secrets never appear in logs. An API key reaches the browser only when you click reveal; OAuth tokens never do.

Verified against @deepseek-ai/dsh@0.1.6-alpha.1, Node 22+.

Development

pnpm install
pnpm build     # rebuild lib/ (committed) after any source change
pnpm check     # oxlint + tsc + knip