tv - Local Trace Viewer for AI Agents
A fast, local trace viewer for AI agent development. Single binary, zero config, works with any OpenTelemetry-instrumented AI framework.
uvx trace-view
Why tv?
When building AI agents with tools like pydantic-ai, LangChain, or custom frameworks, you need to see what's happening:
- What prompts are being sent?
- What tools are being called and with what arguments?
- Where is the latency coming from?
- What's the token usage?
Production observability tools (Datadog, Jaeger) are overkill for local development. tv gives you a purpose-built viewer that understands AI agent traces.
Features
Dual Interface - Web UI for detailed analysis, TUI for quick terminal-based viewing
GenAI-Aware - Automatically classifies spans into user messages, assistant responses, tool calls, and thinking blocks (including Claude's extended thinking)
Zero Config - Point your OTEL exporter at localhost:4318 and spans appear automatically. Sessions are auto-grouped by process.
Real-time Updates - Spans stream in live via SSE as your agent runs
Token Tracking - See input/output token counts and totals per session
Timeline View - Visual representation of span timing for performance analysis
Search - Full-text search across span content
Export - Export sessions to JSON for analysis or sharing
Installation
# Run directly (no install)
uvx trace-view
# Or install globally
uv tool install trace-view
# Or add to project
uv add trace-view
# From source
cargo install traceview
Quick Start
import traceview
traceview.init() # starts server at http://localhost:4318, configures OTEL
# your traced code runs normally
run_my_agent()
uv add "trace-view[otel]"
python my_agent.py
Or run standalone: uvx trace-view
CLI Usage
# Default: Web UI + TUI together
tv
# Server only (background/headless)
tv serve
# TUI only (connect to existing db)
tv ui
# Custom port and database
tv --port 8080 --db my_traces.db
# Environment variables work too
TV_PORT=8080 TV_DB_PATH=my_traces.db tv serve
Keyboard Shortcuts (TUI)
| Key | Action |
|---|---|
j / k |
Move down / up |
gg / G |
Jump to first / last |
Ctrl+d / Ctrl+u |
Page down / up |
Enter / Space |
Expand span |
Tab |
Switch panel |
h / l |
Focus sessions / spans |
? |
Show help |
q |
Quit |
Web UI Features
- Filter tabs: All | Tools | Thoughts | Errors
- View modes: Conversation (default) | Timeline
- Search: Full-text search across spans
- Export: Download sessions as JSON
- Dark/Light mode toggle
- Real-time updates via SSE
- Token summary per session
How Sessions Work
tv automatically groups spans into sessions using this priority:
session.idattribute (explicit)gen_ai.conversation.id(OTEL GenAI convention)service.instance.id(auto-generated per process)- Falls back to
trace_id
This means all spans from a single script execution automatically group together without any configuration.
Span Classification
tv maps OTEL GenAI semantic conventions to span types:
| Span Kind | Source |
|---|---|
| User | gen_ai.user.message events |
| Assistant | gen_ai.assistant.message events |
| Thinking | gen_ai.thinking (Anthropic extended thinking) |
| Tool Call | gen_ai.tool.message with tool_calls |
| Tool Result | gen_ai.tool.message without tool_calls |
| System | gen_ai.system.message events |
Architecture
- Single binary - No external dependencies
- SQLite storage - WAL mode for concurrent read/write
- OTLP ingest - HTTP/JSON and HTTP/protobuf support
- Batch writer - Configurable batching for high-throughput ingest
- SSE streaming - Real-time updates without polling
Development
# Install dependencies (use --no-editable for binary)
uv sync --no-editable
# Run the binary
.venv/bin/tv
# Build Rust directly
cargo build
# Run tests
cargo test
# Before committing
cargo cl # strict clippy
cargo t # tests
cargo fmt --check
# Python checks
uv run ruff check python/
uv run pyright python/
License
MIT
Roadmap
- Full-text search
- Export to JSON
- Python package
- Pre-built binaries
- Cost tracking
- Span diff mode
Metadata
Release files for trace-view 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| trace_view-0.1.0.tar.gz | 142.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| trace_view-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| trace_view-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| trace_view-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| trace_view-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| trace_view-0.1.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 16.0 MB
Release files / trace_view-0.1.0.tar.gz
| Download URL | trace_view-0.1.0.tar.gz |
|---|---|
| Size | 142.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e8c879860cdd15a00a86ab60e3d7a69ff2636381f4f8a15abaaca09c7c1a096
|
|
BLAKE2b-256 checksum How to use checksums |
776a3a44e5ccb15fb86eb8ff1a78baf23a77a13b5cad392cd3ed3ebb052c3a94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency logRelease files / trace_view-0.1.0-py3-none-win_amd64.whl
| Download URL | trace_view-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
afe46828c23e0a36d0c9970d2c2b709a80b115741d47986c00c302c232b5a2ba
|
|
BLAKE2b-256 checksum How to use checksums |
4c7214b4efa338d5c992a11105c4ed26dcd7d12d5c5f1ee9977ad3ba36d14f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency logRelease files / trace_view-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | trace_view-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
b23947ec72d0ea06195a16a2a200ed2390e7c444193e1459b07cad941c5a42bc
|
|
BLAKE2b-256 checksum How to use checksums |
a36cc62df3f32d759e191eec57ff0ecedde5edeb644770968d875fb52a83cbef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency logRelease files / trace_view-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | trace_view-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
173a03914086b5a5a2765f49b26810b614ce4ff110f2a8fa639228ca930cdb4e
|
|
BLAKE2b-256 checksum How to use checksums |
be70a985d14ecf2f021aaa4c8a4b70726dab43cb074427f4eec8cadc078ed282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency logRelease files / trace_view-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | trace_view-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c1a213d4718d1a8f222f14034f2607f70e364853e0dff2bf559a3cdf228699cd
|
|
BLAKE2b-256 checksum How to use checksums |
3dc1d25de44718719145b7b0081c072f4fd99fbc0197de29870e5ea974775bd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency logRelease files / trace_view-0.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | trace_view-0.1.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
50d7480594b398f4d7ade1246420ca78707211ff833b0e2d1857bb8a4fbe7e32
|
|
BLAKE2b-256 checksum How to use checksums |
21664fd7d7c636d046b1ae49e9764e09dd48bb396899801f97f16f9a5cc89c17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 16, 2026.
Transparency log