Tracelet
Tracelet is a Python library for tracking machine learning experiments. It works with popular backends like MLflow, Weights & Biases, ClearML, and AIM, and can automatically detect hyperparameters from your code.
What it does
- Tracks metrics, parameters, and artifacts across ML backends
- Automatically captures hyperparameters without manual logging
- Integrates with PyTorch, PyTorch Lightning, and TensorBoard
- Handles models, checkpoints, images, and other ML artifacts
- Monitors system resources during training
Installation
pip install tracelet
Install backend support as needed:
pip install tracelet[mlflow] # For MLflow
pip install tracelet[wandb] # For Weights & Biases
pip install tracelet[clearml] # For ClearML
pip install tracelet[aim] # For AIM
pip install tracelet[all] # Everything
Usage
Basic Example
from tracelet import Experiment
# Start tracking
exp = Experiment(name="my_experiment", backend=["mlflow"])
exp.start()
# Train your model
for epoch in range(10):
loss = train_model()
exp.log_metric("loss", loss, epoch)
exp.stop()
Automatic Detection
from tracelet import Experiment
# Enable automagic to detect hyperparameters automatically
exp = Experiment(name="auto_experiment", backend=["wandb"], automagic=True)
exp.start()
# Define hyperparameters normally - they're captured automatically
learning_rate = 0.001
batch_size = 32
# Your training code here
for epoch in range(epochs):
loss = train_model()
# Metrics logged automatically if using TensorBoard
exp.stop()
PyTorch Lightning
from tracelet import Experiment
import pytorch_lightning as pl
# Add to existing Lightning code
exp = Experiment(name="lightning_model", backend=["clearml"], automagic=True)
exp.start()
# Your existing code - all self.log() calls tracked automatically
trainer = pl.Trainer(max_epochs=10)
trainer.fit(model, datamodule)
exp.stop()
Multiple Backends
# Log to multiple backends simultaneously
exp = Experiment(
name="comparison",
backend=["mlflow", "wandb", "clearml"]
)
Configuration
Set defaults with environment variables:
export TRACELET_PROJECT="my_project"
export TRACELET_BACKEND="mlflow"
export TRACELET_ENABLE_AUTOMAGIC="true"
Or programmatically:
from tracelet.settings import TraceletSettings
settings = TraceletSettings(
project="my_project",
backend=["mlflow"],
enable_automagic=True,
track_system=True
)
Examples
The examples/ directory contains runnable examples:
01_manual_tracking/- Basic usage examples02_automagic_tracking/- Automatic hyperparameter detection03_backend_integrations/- Backend-specific features05_lightning_automagic/- PyTorch Lightning integration
cd examples
python 01_manual_tracking/01_basic_manual.py
Documentation
Development
git clone https://github.com/prassanna-ravishankar/tracelet.git
cd tracelet
uv sync
uv run pytest
License
Apache License 2.0 - see LICENSE file.
Support
- Issues for bug reports
- Discussions for questions
Metadata
Release files for tracelet 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tracelet-0.0.9.tar.gz | 9.4 kB | Without provenance | Details for tracelet-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tracelet-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for tracelet-0.0.9-py3-none-any.whl |
Total release size: 13.1 kB
Release files / tracelet-0.0.9.tar.gz
| Download URL | tracelet-0.0.9.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0191d5896eb2a65b77467ec41a9b35ebe32a25bbfd96c7d3834c5dcd9da0e7eb
|
|
BLAKE2b-256 checksum How to use checksums |
b4c5578f2ccf04730fe7e5aa8f6f4e061e51693ca935296df6d61a5579cd6362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / tracelet-0.0.9-py3-none-any.whl
| Download URL | tracelet-0.0.9-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e0bcea3c3033df3dae7ab174a6675cf21f1d9213e6566ad728a2c50c563d2fc
|
|
BLAKE2b-256 checksum How to use checksums |
6fb7efe5be09f6d94f23124f6f0cabe2ed3a8a8dab759aa4133e67767882d5d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for tracelet 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.