Skip to main content

Local-first observability for LLM applications

Project description

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 ask(model, messages):
    return client.chat.completions.create(model=model, messages=messages)

ask(
    model="llama-3.1-8b-instant",
    messages=[{"role": "user", "content": "Explain black holes in one line"}]
)
...

Output on query:

 --- Trace ---
  Model: llama-3.1-8b-instant
  Prompt: Explain black holes in one line
  Response: A black hole is a region where gravity...
  Tokens: 43
  Latency: 0.847
  Status: success
  Timestamp: 2026-04-03 19:46:27
-------------
...

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracellm-0.2.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracellm-0.2.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file tracellm-0.2.1.tar.gz.

File metadata

  • Download URL: tracellm-0.2.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for tracellm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c6c72d9ab4943b437e712e02e94a51f3c7b99bef3aef415e4d6f5ea3d62a4107
MD5 9705c44875f5b72a0e0b31530d7dca55
BLAKE2b-256 198d02ed3ebd927c57f76d530885c60de391a1742e14cc9277fed3e42c477108

See more details on using hashes here.

File details

Details for the file tracellm-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tracellm-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for tracellm-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19adee5e54e4444b1412fb5ef983473b34d688e87a220991ad10de7a30063ba3
MD5 4da933eb9ec5d93e015b6b6aa4e304b7
BLAKE2b-256 b4f3609819c9420fdbb54b860b8dc435b50ded983ec2eee924cf2a6f1ca5e4a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page