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.8.tar.gz
.
File metadata
- Download URL: nicetrace-0.4.8.tar.gz
- Upload date:
- Size: 60.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d5c676dc2b8e66dca7d3cacaf4d58e4e23d24d9991e777c19d308cb2baa96f7 |
|
MD5 | 03762532b3fe368208f51aec4787c0af |
|
BLAKE2b-256 | 75999b36bea5f07357442273950540347ef9f057675375cd13915318adf9afae |
File details
Details for the file nicetrace-0.4.8-py3-none-any.whl
.
File metadata
- Download URL: nicetrace-0.4.8-py3-none-any.whl
- Upload date:
- Size: 120.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0de4d36bc5e6ceff86899cfe97616e33de74029929ec6b0af499c177e92e0306 |
|
MD5 | 7d59b409d242f633ddb6d6a250118256 |
|
BLAKE2b-256 | ed339baa20cd642a3f5d3e6a61c22f05f6f99dedc138262e7c5c2d7d8bdc4198 |