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 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

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.0.tar.gz (3.0 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.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tracellm-0.2.0.tar.gz
  • Upload date:
  • Size: 3.0 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.0.tar.gz
Algorithm Hash digest
SHA256 5050bce52586b08754032eb6a2b0d60fb97064c45d691d34754035c173f98ff5
MD5 3942cee75c2975296a221ecb017d1793
BLAKE2b-256 0d3703619a1ccae1fc918350ab672adec055d0ddb80392a239dd01bfce5f95d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tracellm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6b917218f8025850af7c95f15eaf504c3abc577e1874421cbd8451232e0481
MD5 e4976d7f7610799d6c542fea49bebe3a
BLAKE2b-256 7377eed00e4ae859b9057c584ea61305be9be4c342e15cac1cc4cca4122370dd

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