Skip to main content
Trazo Banner

🧵 Trazo

Universal Execution Tracer & Semantic Diff Engine for LLM Agent Pipelines.

CI PyPI version Python versions License: MIT Downloads Platforms Stars Discord

Know exactly why your agent did what it did — and how it changed.

Quickstart • Key Features • CLI Reference • Architecture • Contributing


🧐 What is Trazo?

Building LLM agents is easy. Debugging them is hard. When your pipeline behavior shifts, Trazo tells you why.

Trazo is a local-first, zero-dependency tracing library that captures every step of your agent's execution, tracks costs, and allows you to semantically diff two runs to see exactly what changed in your prompts, models, or outputs.

Before Trazo:

  • print(response) spam in your terminal.
  • Grepping through 100MB log files.
  • Re-running expensive pipelines just to see a single intermediate output.
  • Paying $$$ for cloud observability tools just to debug a local script.

After Trazo:

  • 🔍 Visual DAGs: See your pipeline execution as a beautiful tree.
  • 🔀 Semantic Diffs: Instant comparison of two runs with similarity scores.
  • ⏮️ Time-Travel Replay: Re-run any specific step with original inputs.
  • 💰 Cost Tracking: Automated token counting and USD cost estimation.
  • 🔒 100% Local: No data ever leaves your machine. SQLite powered.

🚀 Quickstart

1. Install

pip install "trazo[ui]"

2. Instrument in 3 Lines

import trazo as tz

tz.init()  # Initialize storage
tz.instrument_ollama()  # Auto-instrument local models

@tz.trace  # Trace any function
def my_agent_step(query: str):
    # Your logic here...
    return "Result"

with tz.run("my_first_trace"):
    my_agent_step("How does transformers work?")

3. See the Magic

trazo view       # List recent runs
trazo ui         # Launch the visual DAG viewer at http://localhost:7432
Trazo UI Mockup

✨ Key Features

🔍 Automatic Instrumentation

Just call tz.instrument_openai() or tz.instrument_ollama() at the top of your script. Trazo handles the rest—capturing inputs, outputs, tokens, and latency without touching your code.

🔀 Semantic Diff Engine

Compare two versions of your pipeline. Trazo matches spans by name and calculates a similarity score using lightweight n-gram hashing (no ML needed) or real embeddings (optional).

trazo diff [baseline_id] [current_id]

⏮️ Time-Travel Debugging

Spotted a failure in a complex chain? Use trazo replay [span_id] to re-execute just that specific step with the exact same inputs, or override them to test a fix.

📊 Rich Terminal UI

No browser? No problem. Trazo provides a high-fidelity terminal interface using rich for inspecting traces, diffs, and logs directly in your shell.


🛠️ CLI Reference

Command Description
trazo view List runs or inspect a specific run/span tree
trazo diff Compare two runs and highlight semantic changes
trazo replay Re-run a span with original or modified inputs
trazo ui Start the local web dashboard (FastAPI + D3.js)
trazo clean Prune old traces to save disk space
trazo export Export traces to JSON or interactive HTML

🏗️ Architecture

Trazo is designed to be non-blocking and local-first.

graph TD
    A[Your Agent Code] -->|Event| B(TraceCollector)
    B -->|Background Thread| C[SQLite WAL Mode]
    C --> D[CLI Interface]
    C --> E[Web UI Dashboard]
    F[OpenAI / Ollama] -.->|Auto-patch| A
  • Storage: SQLite with WAL mode for high concurrency.
  • Context: contextvars ensures correct parent-child linking even in complex async/await flows.
  • Performance: The background flush worker ensures tracing overhead is negligible (< 1ms).

🏆 Why Trazo?

Feature Trazo LangSmith Weights & Biases
Local-first ✅ Yes ❌ No ❌ No
Zero Setup ✅ Yes ❌ No ❌ No
Semantic Diff ✅ Built-in ❌ Basic ❌ No
Cost 🆓 Free 💰 Paid 💰 Paid
Privacy 🔒 100% ☁️ Cloud ☁️ Cloud

🤝 Contributing

We love contributors! Whether it's fixing a bug, adding a new integration (Anthropic, Gemini, etc.), or improving the UI.

  1. Fork the repo.
  2. pip install -e ".[dev,ui]"
  3. Create your feature branch.
  4. Open a Pull Request.

Check out our Contributing Guide for more details.


🗺️ Roadmap

  • Core Tracing & SQLite Storage
  • Semantic Diff CLI
  • Interactive DAG Viewer
  • OpenAI & Ollama Integrations
  • Anthropic & Google Gemini Integration (Coming Soon)
  • GitHub Actions Integration: Fail PRs if semantic similarity drops!
  • MCP Server Support: Chat with your traces in Claude Desktop.

⭐ Star us on GitHub · 💬 Join the Discord

MIT License © 2026 Vikhram S

Metadata

Release files for trazo 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trazo 0.1.2
File Size Uploaded
trazo-0.1.2.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for trazo 0.1.2
File Interpreter ABI Platform
trazo-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / trazo-0.1.2.tar.gz

Download URL trazo-0.1.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1442b07deae63f161155fc5037918f337f427668b8fbfae2efdb67292b54c906
BLAKE2b-256 checksum
How to use checksums
42ab0c29d931ee38632d40ddfa813ae1d4b00bbcb1cc7f3ec5bb9411bf0333ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1

Release files / trazo-0.1.2-py3-none-any.whl

Download URL trazo-0.1.2-py3-none-any.whl
Size 50.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f31562cca88682d33aad7d653071ecfd8a7cabbddb686894cacf73434850426
BLAKE2b-256 checksum
How to use checksums
1b89a9886b3ceb109b5198dd071d34e5dba5caa984629adc785193c169600d9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page