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