Metadata-Version: 2.4
Name: tracellm
Version: 0.2.0
Summary: Local-first observability for LLM applications
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# tracellm

Lightweight tracing for LLM applications. One decorator —
every API interaction logged locally, queryable from your terminal.

No backend. No signup. Nothing leaves your machine.

## Install

pip install tracellm

## Usage

from tracellm import trace
import groq

client = groq.Groq(api_key="your-key")

@trace
def llm_call(model="llama-3.1-8b-instant", messages=[{"role": "user", "content": "hello"}]):
    return client.chat.completions.create(model=model, messages=messages)

llm_call()

That's it. Every call is traced automatically.

## Query traces from terminal

python -m tracellm.cli --Status failed
python -m tracellm.cli --Latency 2.0
python -m tracellm.cli --Model llama-3.1-8b-instant
python -m tracellm.cli --Status failed --Latency 1.5

## What gets captured

- Model, prompt, response
- Tokens used, latency, finish reason
- Error type and message on failures
- Timestamp for every call

## Limitations

Storage is append-only JSON lines. Latency query supports >=
for latency, exact match for everything else. Early days.

## Roadmap

- Binary storage for faster querying at scale
- Cost calculation per model
- Terminal dashboard
