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.10.tar.gz (750.2 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.10-py3-none-any.whl (120.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicetrace-0.4.10.tar.gz
  • Upload date:
  • Size: 750.2 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.10.tar.gz
Algorithm Hash digest
SHA256 7d9d2fbe03375f8f01fc4f077a6f5f802c74756b58422ae932a6bfbad5849fde
MD5 5664fed876b8ac0ab4c6c45837f6eeee
BLAKE2b-256 0b7c8c19aef6a348a284cae7e948b53d923d1efee0ea443623f8d3143e1efc54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nicetrace-0.4.10-py3-none-any.whl
  • Upload date:
  • Size: 120.3 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 8d8fcc147898d30b625f63b15897491563442cf5e285f8197e97e076e46c1163
MD5 505e1174b46e9e38f3c26174b5ee4f62
BLAKE2b-256 6e7765f952b126b75d18d5293b281e599c521e03a102ed787f0a40bbd0435372

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