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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicetrace-0.4.4.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.5.0-44-generic

File hashes

Hashes for nicetrace-0.4.4.tar.gz
Algorithm Hash digest
SHA256 c3c92e626b0f297035fcd81ffb853d5cfd8d8c664ff9de12f69b69c64f6fabba
MD5 ed799e8213fb38e7e9044949d2a097e6
BLAKE2b-256 f2bbe84a8ae39527e50378000618b12372b964fe2ee83ff32cac789d2f77271a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nicetrace-0.4.4-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.5.0-44-generic

File hashes

Hashes for nicetrace-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2ba57152b7af899cd2d15983d6d8cb02ff462474e4eb4eb4032d3ba2e5a0b8e
MD5 cd543651a7d98f5737a9840f14f4fd96
BLAKE2b-256 10257a616e408824aec2f1c174134a4d582460105372a4933d293131d30c62b1

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