About

Built to make prompt token usage visible, debuggable and cheap.

Why it exists

When a prompt contains tools, RAG chunks and a long chat history, the token bill becomes a black box. prompt-flamegraph turns that black box into a picture you can reason about.

Design principles

  • No required dependencies
  • No server, no telemetry, no proxy
  • One function call, one output file
  • Pluggable tokenizers
  • Open source under LGPL-3.0-or-later

When to use it

  • Your prompts keep growing and you do not know why
  • You want to compare two prompt versions
  • You suspect duplicate context or too many tools
  • You need to explain token cost to a teammate

Author & license

prompt-flamegraph is maintained by Fjjjuv and released under the GNU Lesser General Public License v3.0 or later.

Changelog

Latest changes from the repository.

VersionHighlights
0.4.1Windows console and redirected-stream robustness, BOM-tolerant JSON input, CI matrix and trusted PyPI publishing.
0.4.0Dark mode: theme="auto|light|dark" and --theme CLI flag, CSS custom properties, persisted sun/moon toggle.
0.3.3Hardening release: token-accuracy fixes, error handling, security.
0.3.2OpenAI Responses API payloads, top-level exports, Markdown waste report, accessible tooltips, token-accuracy and CLI fixes.
0.3.1README redesign, PyPI/GitHub version alignment.
0.3.0API payload adapters, model presets and dynamic pricing, CI budget gate, framework adapters, JSON export, aggregation buckets, LGPL-3.0-or-later license.
0.2.4Website link in README and PyPI metadata.
0.2.3Version sync, README updates with PyPI and Dev.to links.
0.2.2README badges, waste detection example, copyright year updates.
0.2.1Demo screenshot in README.
0.2.0Initial release with HTML/SVG/Markdown flamegraphs, waste detection, diff, terminal output and CLI.