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

Uploaded Source

Built Distribution

nicetrace-0.4.6-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicetrace-0.4.6.tar.gz
  • Upload date:
  • Size: 19.0 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.6.tar.gz
Algorithm Hash digest
SHA256 a6ec9e973208002aa37cc90dcb8a72d5252af641ddbb0d0d07f1ddf128dc289f
MD5 cb481eeea6cecd7b447a1015fcf8c90c
BLAKE2b-256 a01b2390e07ef352b677abfe738157dd11ae4407d1b61133f268018c60eef027

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nicetrace-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 344aef0e3beda2b01a2611c70883cca4fda5d2e8f12896c78af3bcb8d8e030d6
MD5 3072d47d22335bb7a5749f7647f73862
BLAKE2b-256 5539c147cc6e66b72f2188a9a34a36fabcbb598cfc081715a5e233abf9a86d4f

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