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

Uploaded Source

Built Distribution

nicetrace-0.4.5-py3-none-any.whl (119.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicetrace-0.4.5.tar.gz
  • Upload date:
  • Size: 115.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-40-generic

File hashes

Hashes for nicetrace-0.4.5.tar.gz
Algorithm Hash digest
SHA256 f577243ba11ddbf2f72ac8f94ec5254cdeef18b0bd088eba4d97d9995c15eef7
MD5 e7bef9996782179282e7b60288898aaf
BLAKE2b-256 5342b625edf705b95f81ba1f16633b41a98dd6af8ec14986c357617563694edf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nicetrace-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2e712e92d427270de0ae74df8d59da4978152fc4b408433bac0e54aaa121887d
MD5 8ce3b672e18837d805e482c84fdde053
BLAKE2b-256 ae1b7f545df094f0320e431b7cdb213409b4beab405dc927778bded62683f295

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