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.3.tar.gz (114.5 kB view details)

Uploaded Source

Built Distribution

nicetrace-0.4.3-py3-none-any.whl (119.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicetrace-0.4.3.tar.gz
  • Upload date:
  • Size: 114.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for nicetrace-0.4.3.tar.gz
Algorithm Hash digest
SHA256 0e63055db60ea95c47a3934b660b039533b0e834f6817f2f2bacfcc788f9af48
MD5 76914a4e7d7720d8c660640bcf3be08b
BLAKE2b-256 2e61b0171e4fdcf1df4b85b00961ffce2096a51c5c098dd78cf3492ad117235a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nicetrace-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 119.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for nicetrace-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e7f06c34162fde590464b0f10c9e913758d96d11afced8a01bfd515dee72191
MD5 856105052dcb39f1050ef3f6c0038320
BLAKE2b-256 dcda2b0047f94246d94997bc3f0c4f17448fab306c67acb0dfaa2ad9f9f28367

See more details on using hashes here.

Supported by

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