Skip to main content

No project description provided

Project description

NiceTrace

NiceTrace is a Python module for user-friendly structured tracing and elegant display of resulting traces. Traces are stored as plain JSON files. NiceTrace support exploring traces of running processes. While designed for generic usage, it's particularly well-suited for tracing experiments with Large Language Models (LLMs).

Documentation

Installation

# For tracing only
pip install nicetrace

# For tracing & displaying traces
pip install nicetrace[server]

Getting started

Here's how to create a simple trace and write it to a JSON file:

from nicetrace import trace, FileWriter

with FileWriter("traces/my_trace.json"):
    with trace("Root node"):
        with trace("Child node", inputs={"x": 10, "y": 20}) as node:
            node.add_output("", "Hello world!")

To start a traceview server over the traces directory:

python3 -m nicetrace.server traces

Then, open your web browser and navigate to http://localhost:4090 to view your traces.

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

nicetrace-0.4.9.tar.gz (750.1 kB view details)

Uploaded Source

Built Distribution

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

nicetrace-0.4.9-py3-none-any.whl (120.2 kB view details)

Uploaded Python 3

File details

Details for the file nicetrace-0.4.9.tar.gz.

File metadata

  • Download URL: nicetrace-0.4.9.tar.gz
  • Upload date:
  • Size: 750.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for nicetrace-0.4.9.tar.gz
Algorithm Hash digest
SHA256 76571b76598f5d902a7b136e892381d6413f615e74104406bcf626b714d2f85b
MD5 ad1fac96215a0539b7e0e8caf8bc3527
BLAKE2b-256 f7c030e3ad460e4833a4e95d27850b49956a6cf21d0d08f1b9e7dd9fe9bddc13

See more details on using hashes here.

File details

Details for the file nicetrace-0.4.9-py3-none-any.whl.

File metadata

  • Download URL: nicetrace-0.4.9-py3-none-any.whl
  • Upload date:
  • Size: 120.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for nicetrace-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b9607c605c3852342b6c5d74420d09a426329ca443560f81e5229a44f6825b
MD5 beb757b69f099b4e2e78446c5ecee0ea
BLAKE2b-256 1c7017e601efdfd4812909058b24c3cb566adf3ee77ef2b1cafae3c3ebe5c792

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