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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nicetrace-0.4.2.tar.gz
.
File metadata
- Download URL: nicetrace-0.4.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54aae1a1f3ea1f189a9ae9f0ce186d9562a9fd3020f51e10798681a20cdc345e |
|
MD5 | 23d905dd704b61f1c7a03235ec211ae5 |
|
BLAKE2b-256 | 6654b0886d69824ddf09d741bcab61d91eb50168b3ad30677fcbd13a8cff41fa |
File details
Details for the file nicetrace-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: nicetrace-0.4.2-py3-none-any.whl
- Upload date:
- Size: 119.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | be204c60b67a7e046bb264b5dd065fc6cd87c71b7bd7283e7f496cdd2eca6de7 |
|
MD5 | a5ae506d9d1d4a3d160f2777bb2e8517 |
|
BLAKE2b-256 | a31c54bc8e659ca4f93321340d5750af4b15855da9401d32c431f0e5edfc141b |