Metadata-Version: 2.4
Name: loupe-sdk
Version: 0.1.0
Summary: Observability and replay for LLM agents
Author-email: Aditya Chauhan <adydelhi2003@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Adityachauhan12/Loupe
Project-URL: Repository, https://github.com/Adityachauhan12/Loupe
Keywords: llm,observability,tracing,replay,agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# loupe-sdk

Python SDK for [Loupe](https://github.com/Adityachauhan12/Loupe) — open-source observability and replay for LLM agents.

Instrument your agent with three lines, see every trace in the dashboard, then replay any run with a different prompt or model and diff the outputs side-by-side.

## Install

```bash
pip install loupe-sdk
```

## Quick start

```python
import loupe
from groq import Groq

loupe.init(api_key="lp_...", host="https://your-loupe-server.onrender.com")

client = Groq(api_key="...")
loupe.instrument_groq(client)          # also: instrument_openai, instrument_anthropic

@loupe.trace(name="my_agent")
def run_agent(query: str) -> str:
    with loupe.span("search", type="tool") as s:
        results = do_search(query)
        s.output = {"count": len(results)}
    ...
```

Every decorated call becomes a trace; every `loupe.span()` and auto-instrumented LLM call becomes a span under it.

## Self-host

See the [Loupe repo](https://github.com/Adityachauhan12/Loupe) for the full server + dashboard setup.
