Skip to main content

Local-first observability for LLM applications

Project description

tracellm

Lightweight tracing for LLM applications. One import, three calls — 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 Tracer

tracer = Tracer() tracer.start_trace(model="llama-3.1-8b-instant", prompt="your prompt")

try: response = client.chat.completions.create(...) tracer.end_trace(response) except Exception as e: tracer.record_error(type(e).name, str(e))

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. 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.1.0.tar.gz (2.6 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.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tracellm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 367026ab616f481ecf93650e8dce360c2cd28302a9ae6436fee42d69395078d9
MD5 aab9e00f571eafe75f63ec967aeab174
BLAKE2b-256 bf62d3094449aaccff261f127ad529ec6ebb7187aecb6d19f842afdde4259de5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tracellm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83d1c0213b83480a8685d56fe70bde699fcb9c1030928664f3ecf4ea76c416ec
MD5 d540625f9d403f552e0cf0ae7afc6cb1
BLAKE2b-256 a3f7b40c79a277dcbfb694ff9e9bf4be8c30a01435e739d389e01e99b6363d43

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