Metadata-Version: 2.4
Name: tracelense
Version: 0.0.1
Summary: Local-first agent tracing — opens in your browser in 5 seconds. No Docker, no signup, no cloud.
Project-URL: Homepage, https://github.com/TusharKarkera22/tracelense
Project-URL: Repository, https://github.com/TusharKarkera22/tracelense
Project-URL: Issues, https://github.com/TusharKarkera22/tracelense/issues
Project-URL: Changelog, https://github.com/TusharKarkera22/tracelense/blob/main/CHANGELOG.md
Author: Tushar Karkera
License: MIT
License-File: LICENSE
Keywords: agent,anthropic,langchain,llm,observability,openai,opentelemetry,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Requires-Dist: aiosqlite>=0.20
Requires-Dist: fastapi>=0.115
Requires-Dist: keyring>=25.0
Requires-Dist: mcp>=1.0
Requires-Dist: opentelemetry-proto>=1.27
Requires-Dist: pydantic>=2.9
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.13
Requires-Dist: uvicorn[standard]>=0.32
Provides-Extra: all
Requires-Dist: anthropic>=0.40; extra == 'all'
Requires-Dist: langchain-core>=0.3; extra == 'all'
Requires-Dist: llama-index-core>=0.11; extra == 'all'
Requires-Dist: openai>=1.50; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Provides-Extra: llamaindex
Requires-Dist: llama-index-core>=0.11; extra == 'llamaindex'
Provides-Extra: openai
Requires-Dist: openai>=1.50; extra == 'openai'
Description-Content-Type: text/markdown

# tracelense

**Local-first agent tracing. Open in your browser in 5 seconds. No Docker, no signup, no cloud.**

[See screenshots, comparison table, and full docs on GitHub →](https://github.com/TusharKarkera22/tracelense)

```bash
pipx install tracelense && tracelense
```

That's it. Browser opens. Traces appear as your agent runs. SQLite at `~/.tracelense/db.sqlite`. Nothing leaves your machine.

## Why this exists

Every agent tracer either makes you stand up Docker (Phoenix), funnel your prompts through a cloud service (Langfuse, LangSmith, Helicone), or look at a UI that feels like 2014 enterprise software. tracelense is what you reach for when you want to see your traces _now_, on your laptop, the same way you reach for `console.log`.

## Install

```bash
pipx install tracelense          # recommended
uv tool install tracelense
pip install tracelense
```

Python 3.10 – 3.13.

## Trace your agent in one line

**OpenAI**

```python
from openai import OpenAI
from tracelense import trace

client = OpenAI()
trace(client)
```

**Anthropic**

```python
from anthropic import Anthropic
from tracelense import trace

client = Anthropic()
trace(client)
```

**LangChain / LangGraph**

```python
from tracelense.adapters.langchain import TracelenseCallbackHandler

agent.invoke({"input": "..."}, config={"callbacks": [TracelenseCallbackHandler()]})
```

**LlamaIndex**

```python
from tracelense.adapters.llamaindex import install
install()
```

**Anything OpenTelemetry-instrumented**

```bash
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
python your_agent.py
```

## Killer features

1. **A trace detail view that looks like 2026, not 2014.** Span tree, prompts, tool calls, costs. One-click *Copy as curl* / *Copy as Python*.
2. **Trace diff — the moat.** Pick two runs. tracelense diffs the output text, tool-call sequence, request params, and cost/latency/token deltas.
3. **Replay with overrides.** Click *Replay* on any LLM span. Edit the model or prompt. tracelense re-issues against the same provider and renders the diff inline. API keys live in your OS keychain.
4. **Your AI coding assistant can read your traces.** A read-only MCP server (`tracelense mcp`) lets Claude Code / Cursor / Windsurf call `find_failing_spans`, `get_trace`, `diff_traces` while debugging the agent it's helping you write.
5. **Cost dashboard.** Today vs yesterday. Top models. Top agents. One page.

## How tracelense compares

|                                 | tracelense  | Phoenix       | Langfuse           | Helicone        |
|---------------------------------|-------------|---------------|--------------------|-----------------|
| Time to first trace             | **5 sec**   | ~3 min        | ~10 min            | signup          |
| Runs without containers         | yes         | no (Docker)   | no (Docker)        | no (proxy)      |
| Trace diff                      | yes         | no            | partial            | no              |
| Replay with overrides           | yes         | no            | playground only    | no              |
| AI-assistant readable (MCP)     | yes         | no            | no                 | no              |
| Data leaves your machine        | never       | never         | depends on deploy  | always          |
| Export to bigger tools          | yes (OTLP)  | n/a           | n/a                | n/a             |

This is an honest comparison written by an honest competitor. Phoenix and Langfuse are great when your team grows past one laptop. tracelense is the thing you reach for first. When you outgrow it, `tracelense export phoenix` ships your data over. No lock-in.

## Wire your AI assistant (MCP)

Claude Code (`~/.claude.json` or project `.claude/settings.json`):

```jsonc
{
  "mcpServers": {
    "tracelense": { "command": "tracelense", "args": ["mcp"] }
  }
}
```

Cursor (`~/.cursor/mcp.json`): same shape.

Then ask your AI: *"Find the latest failing trace and tell me which tool call broke it."* It will. Read-only — it can't burn money behind your back.

## License

MIT. See [LICENSE on GitHub](https://github.com/TusharKarkera22/tracelense/blob/main/LICENSE).
