TokenPak

TokenPak — local LLM proxy

Local proxy. Request records.

TokenPak is a local LLM proxy with request records and explicit context tools. The default proxy preserves conversation turns; a forwarded request can correctly report zero tokens saved.

TokenPak doesn't replace your AI stack.

It adds the missing logistics layer: packing, routing, reusable context, guardrails, orchestration, and per-request records.

Six capabilities

Pack

Explicit context tools can reduce eligible content. The default proxy preserves conversation turns and can report zero tokens saved.

Route

Configure routing policies and inspect observe-mode records. Automatic model changes and fallback enforcement are not active by default.

Reuse

Use local vault recall and read-only Pak inspection. Broader Pak reuse is a separate capability with its own availability requirements.

Guard

Spend and safety guardrails run as a side-channel gatehouse across every request.

Dispatch

Coordinate scoped, multi-step and multi-agent work. Preview (alpha) — not yet in a published release.

Record

Inspect locally recorded requests, observed usage and available cost attribution. Missing coverage remains visible; records do not guarantee savings.

How a request flows

The default path forwards conversation turns without shortening them. Explicit context tools and configured guards have separate roles.

Conceptual request flow — packing is optional; default conversation turns remain intact
  1. Raw context
  2. Packing Station
  3. Route
  4. Send
  5. Provider
  6. Record

Reuse feed: Today the companion path uses BM25 vault recall; the planned Pak reuse path feeds the Packing Station so context can be reused instead of rebuilt.

Gatehouse (Guard): spend and safety guardrails run as a side-channel overlay before Send.

Where TokenPak fits

TokenPak overlaps with tools you may already run — and adds a layer they don't. Run them together.

How it sits alongside gateways, observability tools, and MCP
Where it fits
  1. Your agent

    Claude Code

    Cursor · Cline

  2. TokenPak (local)

    proxy · measure

    guard · record

  3. Your gateway

    LiteLLM /

    OpenRouter / …

  4. Model provider

    Anthropic · OpenAI

    Google Gemini

Dispatch Center dashboard (preview) — orchestration for multi-step and multi-agent work, around the flow.

Tool type Overlaps on TokenPak adds Together?
Gateways / routers routing explicit context tools + local request records Run both.
Observability tools measurement explicit context tools + local attribution records Run both.
MCP-based workflows ecosystem coordination a semantic contract (TIP) for packing, routing, cost, telemetry Composes.

Full comparison

Savings

The default proxy preserves conversation turns and does not promise token savings. Explicit compression tools can reduce eligible content. Provider cache reuse is measured separately from product-attributed reduction; inspect your recorded usage and its coverage before drawing conclusions.

Open source & Pro

TokenPak's core is open source (Apache-2.0). Pro adds team dashboards, advanced routing, and enterprise controls.

Pro is delivered as the tokenpak-paid package via a separate index.

Latest release

Documentation

starter

Getting Started

Set up TokenPak and inspect your first request receipt, including zero savings.

starter

Installation

pip install options, OS notes, troubleshooting install failures.

starter

Claude Code guide

Route Claude Code through TokenPak with one environment variable.

More at docs.tokenpak.ai.

Try it locally.

pip install tokenpak && tokenpak setup — then point your AI client at the local proxy. No cloud component; credentials stay in your environment and provider flow.