Px
pinexai.dev
docs
GitHub

tokenspy 🔥

cProfile for LLMs — find which function is burning your AI budget. Flame graphs, structured tracing, evaluations, prompt versioning, and a live dashboard.

v0.2.0Python 3.10+MITGitHub →
💡
One-line install: pip install tokenspy — zero dependencies.

The Problem

You get an OpenAI invoice — $800 this month. You have no idea which function caused it. Langfuse and Braintrust force you to reroute traffic through their cloud proxy.

tokenspy is your local alternative. One line. Runs on your machine. Forever free.

What's in v0.2.0

🔥 Cost Flame Graphs
See exactly which function is burning your budget.
🔍 Structured Tracing
Full trace + span tree with inputs, outputs, tokens.
📊 Evaluations
Run LLM functions against golden test sets.
📝 Prompt Versioning
Track every version. Diff when costs spike.
📺 Live Dashboard
Web UI with cost charts, trace explorer.
📡 OpenTelemetry
Export to Grafana, Jaeger, Datadog.