GitHubBook a demoStart routing
Browse docs

Installation

Build the single CGO-free binary, run the container image, or grab a release — TokenTriage ships as one static file with its pricing table compiled in.

Last updated

On this page

TokenTriage is a single source-available (FSL) Go binary — no CGO, no sidecar runtime, no data files to ship. The pricing table is compiled in via go:embed, and the dashboard SPA is embedded too, so the whole product is one file.

Build from source

You need a Go toolchain (built and benchmarked on Go 1.25.x). No C compiler is required:

git clone https://github.com/inferops/tokentriage.git
cd tokentriage

# CGO_ENABLED=0 keeps it a single static binary.
CGO_ENABLED=0 go build -o dist/tokentriage ./cmd/tokentriage

The binary cross-compiles to linux/amd64, windows/amd64, and darwin/arm64 without a C toolchain. Verify the build and the embedded pricing snapshot:

$ tokentriage version
tokentriage dev (commit none, built unknown)
pricing snapshot: litellm@2026-07-14#179affb

Run the container

The image is FROM scratch — only the static binary, the vendored license files, CA certs, and a non-root user (UID/GID 65532). The static binary measures ≈10.7 MB (linux/amd64, -s -w, CGO_ENABLED=0); the image is ≈11 MB (estimated) per arch.

docker build -t tokentriage:latest .

docker run --rm \
  -p 8787:8787 -p 9090:9090 \
  -e ANTHROPIC_API_KEY \
  -v "$HOME/.tokentriage:/data" \
  tokentriage:latest

The default container command runs ledger mode from a baked-in config that binds 0.0.0.0 (the --anthropic quickstart binds loopback, which a container can’t publish). A ready-made docker-compose.yml brings up the proxy plus an example Ollama service so a local --simple ollama/… tier works out of the box:

docker compose up

Configure

For anything beyond a quickstart, use a YAML config. Validate it strictly before you run — an unknown field is an error, not a silent ignore:

$ tokentriage validate --config configs/tokentriage.example.yaml
mode:      ledger
listen:    127.0.0.1:8787   admin: 127.0.0.1:9090
upstreams: 3
tiers:     4 (cheapest -> most capable)
rules:     3
OK: configuration is valid

The full schema is the Configuration reference; the commented configs/tokentriage.example.yaml in the repo is the annotated source of truth.

What’s next

  • Quickstart — the base-URL swap to a costed request.
  • Deployment & infrastructure — the canonical Helm chart, Kustomize, Compose (incl. air-gap), and Terraform for a real self-host.