explaingit

tommytranx/traceburn

Analysis updated 2026-05-18

2PythonAudience · developerComplexity · 3/5Setup · easy

TLDR

A local-first Python tracer that watches your OpenAI or Anthropic agent calls, flags wasted spend with dollar figures, and suggests fixes.

Mindmap

mindmap
  root((repo))
    What it does
      Traces LLM API calls
      Finds wasted spend
      Suggests fixes
    Tech stack
      Python
      SQLite
      Starlette
    Use cases
      Cost debugging
      CI cost gate
      Trace replay
    Audience
      AI agent developers
    License
      Not specified

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Trace an AI agent's OpenAI or Anthropic API calls to see where money is being wasted.

USE CASE 2

Get a literal code patch for missed prompt caching or model overkill issues.

USE CASE 3

Gate a CI pipeline on cost regressions using the check command.

USE CASE 4

Replay recorded LLM calls for testing without spending new tokens.

What is it built with?

PythonSQLiteStarletteOpenAI SDKAnthropic SDK

How does it compare?

tommytranx/traceburn0-bingwu-0/live-interpreter0cm-labs/tokenizer-benchmark
Stars222
LanguagePythonPythonPython
Setup difficultyeasymoderatemoderate
Complexity3/52/52/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

The optional web viewer binds to localhost only and has no authentication by design.

The README doesn't mention a license, so terms of use are unclear.

In plain English

traceburn is a Python tool for tracking down wasted spending when you build AI agents on top of the OpenAI or Anthropic APIs. The README opens with a concrete story: a small support ticket triage agent sent the same roughly 4,700 token prompt fresh on every call. traceburn's waste report looked at the recorded run, spotted that repeated prompt prefix, and estimated that about 82 percent of the spend was avoidable. Adding the single caching fix the tool suggested cut the real cost from about 5 cents to about 1.7 cents, a 69 percent measured saving, with the tool's original estimate landing within 18 percent of what actually happened. You use it by adding one line, traceburn.install(), near the top of your existing agent code, or by running your script with an environment variable set instead of touching the source at all. From then on, every call your agent makes to the OpenAI or Anthropic SDKs, including streaming responses, tool calls, and cache hits, gets recorded as a trace in a single SQLite file on your own machine. There's no account to create and no server to run for basic tracing, and nothing is sent off your computer. Once you have a trace, a set of commands let you inspect it: list recorded traces, view one in detail, run the waste report, and for a couple of common problems, ask the tool to print the exact code patch that would fix it. A check command meant for continuous integration can fail a build if a traced run costs too much or looks too wasteful, and a diff command compares two traces to see whether a prompt change actually helped. An optional local web viewer shows the same information visually: a trace tree, a cost or time based flamegraph, a timeline, and the waste report, all served from your own machine with no outside connection and no login, since it's built to only be reachable locally. Today the automatic instrumentation covers the raw OpenAI and Anthropic Python SDKs plus litellm, other frameworks like LangChain aren't wired in yet, though a manual API works with any framework in the meantime. The waste checks look for five patterns: duplicate calls, missed prompt caching, bloated prompts, using an expensive model for trivial work, and retry loops.

Copy-paste prompts

Prompt 1
Help me add traceburn.install() to my existing OpenAI agent and view the waste report.
Prompt 2
Explain what the waste report in traceburn found in my agent's traces.
Prompt 3
Show me how to use traceburn check to add a cost regression gate to my CI pipeline.
Prompt 4
Walk me through running the offline demo included in this repo to see a sample trace.

Frequently asked questions

What is traceburn?

A local-first Python tracer that watches your OpenAI or Anthropic agent calls, flags wasted spend with dollar figures, and suggests fixes.

What language is traceburn written in?

Mainly Python. The stack also includes Python, SQLite, Starlette.

What license does traceburn use?

The README doesn't mention a license, so terms of use are unclear.

How hard is traceburn to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is traceburn for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.