Back to directory

tokenbank

Maintenance: Active

wink-run/tokenbank

Token Bank — the local LLM gateway that sits between your AI agents and every provider. Know where tokens go · Spend less with smart routing to Ollama, Groq, GitHub Models · Earn by sharing idle quota on a community P2P network. One-click onboarding for Cursor, Claude Code, Codex CLI, Gemini CLI — no agent changes. Full trace, seamless model swap

View on GitHubHomepage
$ git clone https://github.com/wink-run/tokenbank.git

103

stars

17

forks

JavaScript

Language

Apache-2.0

License

2026-05-09

Created

2026-09-26

Last push

Apache-2.0 local LLM gateway — one-click agent onboarding, full token trace, smart local-first routing and community P2P sharing, with an OpenAI-compatible endpoint (localhost:11430) for any client. README does not mention DeepSeek Harness; dsh would connect via the OpenAI-compatible endpoint.

DSH integration

Ecosystem-related

Author-claimed

Safety audit

Unaudited

Last verified

2026-08-27

License

Apache-2.0

01What can it help you accomplish?

  • Track every token consumed by your AI usage and see exactly where the money goes

    Full-chain trace (live proxy + session import with auto-dedupe), multi-device analytics sliced by app · provider · model · device · time, subscriptions vs PAYG side by side

    Developers running multiple AI agents (Claude Code, Cursor, Codex, WorkBuddy) who want one local view of token consumption and cost

  • Switch your agents to cheaper or local models without changing the client

    Native model names unchanged, transparent protocol conversion (Anthropic Messages / OpenAI Chat / Codex Responses), per-app bindings, one-click Revert to official config

    AI agent users who want smart local-first routing and free quotas (Groq, GitHub Models) to cut spend while keeping their familiar clients

  • Turn idle compute and API quota into credits on a community P2P network

    Credits via the formula credits = (output_tokens / 1000) × contribute_rate × quality_multiplier (0.5–1.5); spend credits on shared models or hire remote agents

    Users with idle local GPUs or unused upstream quota who want to monetize them (README reminds users to comply with upstream terms)

02How to install into DeepSeek Harness

Prerequisites

  • A way to run Token Bank — macOS/Windows desktop app, Node.js CLI (Linux/servers), or Docker
  • The local gateway listens on port 11430 for LLM requests and 11431 for the Web UI

Installation steps

  1. 01

    Desktop (recommended): download the installer from Releases — macOS `.dmg` or Windows `.exe` — then open the app, go to **Config**, and enter your backend URL and relay API key

  2. 02

    CLI mode (Linux / servers): `git clone https://github.com/wink-run/tokenbank.git`, `cd tokenbank/client`, `npm install`, then `node cli/gateway.js start`

    $ git clone https://github.com/wink-run/tokenbank.git

  3. 03

    Docker: `git clone https://github.com/wink-run/tokenbank.git`, `cd tokenbank`, then `docker compose up gateway -d`

    $ git clone https://github.com/wink-run/tokenbank.git

  4. 04

    Create a local API key in the **Gateway** tab, or use an existing upstream key, then point any OpenAI-compatible client at `OPENAI_BASE_URL=http://localhost:11430/v1`

Verify the integration

  • Run the README's quick curl test against the local gateway: `curl http://localhost:11430/v1/chat/completions -H "Authorization: Bearer your-local-key" -H "Content-Type: application/json" -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}],"stream":true}'`

Rollback

  • In the Gateway tab, click **Revert** for a tracked app — the README says it restores the official config and stops tracking

03DSH integration and capability boundaries

DSH integrationEcosystem-related

OpenAI-compatible local gateway — any OpenAI-compatible client can connect via `OPENAI_BASE_URL=http://localhost:11430/v1`; the README does not describe a DeepSeek Harness-specific integration

  • One-click agent onboarding

    Installed agents — Claude Code / Codex CLI / OpenCode / Hermes / Kimi Code, Claude Desktop / Codex Desktop / OpenClaw / WorkBuddy, Cursor / Copilot / Qwen / Grok→CLI shim or config-file patch pointing each app at the local gateway, with Track / Revert states

    CLI shim injects BASE_URL (and related) env vars; config-file patch rewrites configs (Revert restores them)
  • Smart local-first routing

    Per-app route bindings or unbound requests; local sources and community sharing sources→Chain: local Ollama → free API (Groq / GitHub Models) → subscription / PAYG → community sharing → policy groups (fallback / round-robin / weighted / latency / direct)

    Egress guards clamp outbound max_tokens to upstream limits
  • Session trace & observability

    Live proxy traffic via localhost:11430 plus local session logs (~/.claude, ~/.codex, WorkBuddy Trace, …)→Dashboard sliced by app · provider · model · supply type · device · time; call log with route result and latency per request

    Auto-dedupe: the same call recorded by both gateway and session file is counted once
  • Lossless gateway compression

    Messages containing pretty-printed JSON (tool results, embedded data)→Minified JSON — fewer upstream input tokens, semantics unchanged; Dashboard shows compression count, tokens saved, and ratio

    Non-JSON content is left byte-for-byte untouched
  • Community sharing & remote agents

    Idle compute: local Ollama, unused upstream quota, private LAN models (outbound WebSocket — no inbound port)→Credits earned and spent on community-shared models; hire community agents whose jobs run on their device

    Upstream API keys never leave your machineRemote agents run without downloading their source — tasks run on their device
  • OpenAI-compatible endpoint

    Any OpenAI-compatible client or tool→A single local address OPENAI_BASE_URL=http://localhost:11430/v1; CLI shim can auto-inject ANTHROPIC_BASE_URL / OPENAI_BASE_URL for onboarded agents

04Who is it for? When not to use it?

Good for

  • Developers running multiple AI agents (Claude Code, Cursor, Codex, WorkBuddy) who want one local view of token consumption and cost
  • AI agent users who want smart local-first routing and free quotas (Groq, GitHub Models) to cut spend while keeping their familiar clients
  • Users with idle local GPUs or unused upstream quota who want to monetize them (README reminds users to comply with upstream terms)

Not for

  • The README does not mention DeepSeek Harness or the official dsh CLI at all. The only generic path is the OpenAI-compatible endpoint (`OPENAI_BASE_URL=http://localhost:11430/v1`); whether your dsh setup can use it depends on the harness's OpenAI-protocol support.

05Compatibility, maintenance and safety notes

  • The README does not mention DeepSeek Harness or the official dsh CLI at all. The only generic path is the OpenAI-compatible endpoint (`OPENAI_BASE_URL=http://localhost:11430/v1`); whether your dsh setup can use it depends on the harness's OpenAI-protocol support.
  • Desktop app installers ship for macOS (`.dmg`) and Windows (`.exe`) only; Linux and servers use the CLI mode (`git clone` + `npm install` + `node cli/gateway.js start`) or Docker.
  • The project is for educational and research purposes only; users are responsible for complying with applicable laws, regulations, and upstream service terms (including sharing quota or compute).
2026-05-092026-08-26v0.5.17

Apache-2.0 · actively maintained (latest release v0.5.17, 2026-08-26)

06Frequently asked questions

How do I connect DeepSeek Harness to Token Bank?

The README does not mention DeepSeek Harness or a dsh integration. Token Bank exposes an OpenAI-compatible endpoint — `OPENAI_BASE_URL=http://localhost:11430/v1` — and the README says it connects any OpenAI-compatible client, so use that endpoint if your harness speaks the OpenAI protocol.

Which AI tools get one-click onboarding?

Claude Code / Codex CLI / OpenCode / Hermes / Kimi Code via CLI shim (env injection), Claude Desktop / Codex Desktop / OpenClaw / WorkBuddy via config-file patch, Trae Work via session import, and Cursor / Copilot / Qwen / Grok via session stats or setting `OPENAI_BASE_URL`.

What install options does Token Bank offer?

A desktop app (macOS `.dmg`, Windows `.exe`) from Releases — open it, go to Config and enter backend URL + relay key; CLI mode for Linux/servers (`git clone`, `npm install`, `node cli/gateway.js start`); or Docker (`docker compose up gateway -d`).

How does it reduce token spend?

Smart routing automatically prefers local Ollama, then free APIs (Groq / GitHub Models), then subscriptions / PAYG, with community sharing as fallback; optional lossless compression (`TOKENBANK_COMPRESS=1`) trims upstream input tokens. Each app can bind its own route.

Does it modify my agent configs, and can I undo it?

Yes — CLI shims inject `BASE_URL` env vars and config-file patches rewrite configs, but the Gateway tab offers **Track** / **Revert**: clicking Revert restores the official config and stops tracking.

08Data and sources

  • Author-claimedgithub.comae678ec7b643…

    Connecting any OpenAI-compatible client

  • Author-claimedgithub.comae678ec7b643…

    OPENAI_BASE_URL=http://localhost:11430/v1

This page is generated from the project’s public documentation, repository metadata and a structured parse of DSH Plugins; last verified on 2026-08-27. Found an error? Submit a correction.

🏆

Best DeepSeek Harness Plugins

Twelve plugins worth installing first — picked from the whole catalog, across every category.

DSH Plugins is an independent community directory of DeepSeek Harness plugins. Not affiliated with or endorsed by DeepSeek. Third-party plugins are not security-audited — review the source before installing.

New DeepSeek Harness plugins, weekly. No spam.