Skip to main content

Local-first proxy for LLM spend visibility and control.

Project description

TokLog

CI PyPI License: TBFUL Made with KeCHe

htop for your LLM spend — proxy-only.

TokLog is a local-first HTTP proxy for LLM spend visibility and control.

Route OpenAI-, Anthropic-, and Gemini-compatible traffic through a local proxy. TokLog logs usage locally, attributes cost by model/provider/program/tag, and turns raw traffic into actionable waste reports.

No hosted backend. No account. No prompt egress by default.


Install

pip install toklog
tl proxy setup
tl proxy start --background

After setup, clients that support base URL overrides can route through TokLog with no app-specific SDK integration.


What it does

  • Proxy-based capture — intercepts LLM traffic at the HTTP layer
  • Cross-language — works with Python, TypeScript, Go, curl, and anything else that can point at a base URL
  • Cross-provider — OpenAI, Anthropic, Gemini
  • Local logs — normalized JSONL logs under ~/.toklog/logs/
  • Spend reports — model, provider, endpoint, program, and tag breakdowns
  • Waste detection — highlights expensive patterns worth fixing first
  • Shareable output — terminal and exported reports

Core commands

tl report

Full spend breakdown — models, processes, context composition, waste detectors.

tl report           # last 7 days
tl report --last 30d

tl report

tl gain

Cumulative savings opportunities — shows how much waste each detector has found since install.

tl gain

tl gain

tl doctor

Health check — verifies config, proxy, env vars, logging, and traffic.

tl doctor

tl doctor

tl share

Generate a self-contained HTML report you can share — no server needed.

tl share             # save to ~/.toklog/reports/
tl share --open      # save and open in browser

tl share

tl proxy status

Check if the proxy daemon is running and where it's listening.

tl proxy status

tl proxy status

Other commands

tl proxy setup          # interactive setup wizard
tl proxy start --background
tl proxy stop
tl tail                 # live stream of logged calls
tl categories           # list detected call categories
tl pricing              # show model pricing table
tl reset                # clear all logs and config

License

TBFUL-1.0 — free for non-commercial and small-scale use. Commercial license required above $10k annual LLM spend.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toklog-0.2.1.tar.gz (133.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toklog-0.2.1-py3-none-any.whl (152.3 kB view details)

Uploaded Python 3

File details

Details for the file toklog-0.2.1.tar.gz.

File metadata

  • Download URL: toklog-0.2.1.tar.gz
  • Upload date:
  • Size: 133.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for toklog-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4aec817b8940f548645df755676fb081f5af17e4f14b7544728cd24d8b3f5d9e
MD5 f79a491678eeaeed15ff3ff60d2eda96
BLAKE2b-256 706080a296444917d6542e1bca9a17627cf4adb8511ad1a82b3e676f956eacf4

See more details on using hashes here.

File details

Details for the file toklog-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: toklog-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 152.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for toklog-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 511eff7fa5c7ee7a223a5bf19b3c701e1f587c158cb3dddbbd70a2c1628e55e6
MD5 55028c0baa8dafae8d28939ed9c09265
BLAKE2b-256 abaf27d8ede8e39d6d97856fd29509193b9fb2a6dd9893345a5c7ff42295c508

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page