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 process. While designed for generic usage, it's particularly well-suited for tracing experiments with Large Language Models (LLMs).
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.2.0.tar.gz
(113.9 kB
view hashes)
Built Distribution
nicetrace-0.2.0-py3-none-any.whl
(118.5 kB
view hashes)
Close
Hashes for nicetrace-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d6c9aaf91e7a7e62d21e1ddae3a6a6a0dba14f9068c38d73389c38e3097d577 |
|
MD5 | 31e98e701123090a315684fc842bee00 |
|
BLAKE2b-256 | 926f1f419fcac22b154a41a123b86724acd4f90b2b542dcf4ab39749ca1db86a |