Skip to main content

Local-first proxy for LLM spend visibility and control.

Project description

TokLog

CI PyPI License: TBFUL

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.

tl report --last 7d


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 proxy setup
tl proxy start --background
tl proxy status
tl proxy stop

tl report
tl gain
tl share --open
tl doctor

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.0.tar.gz (129.9 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.0-py3-none-any.whl (148.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toklog-0.2.0.tar.gz
  • Upload date:
  • Size: 129.9 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.0.tar.gz
Algorithm Hash digest
SHA256 0ddc0d4e055847bafc81217cd8ba7a0fdf06a2616b7e9b3b428422d5120a986c
MD5 c9ba656664047fedf4534d610a84c7b0
BLAKE2b-256 19bab177e98cca3af033bf7b141d8160293ef8a3a3cf445794958e9b96767348

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toklog-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 148.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af112ceeeb39c2e722c82e539d77bcd97a161c984add9b1a2ea84d8d0f88345f
MD5 c4e038e2a89d8e575bea60d65ca0c845
BLAKE2b-256 fac9d61998580d2583dc76d05a2569f50b5909879b36743ea8a677cbc1f8dc1f

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