Quickstart
This tutorial introduces the new dict-style API through the smallest useful workflow: create an experiment, log metadata and metrics, upload a file, and finalize the run.
Create an Experiment
import litlogger
experiment = litlogger.init(name="quickstart")litlogger.init() returns an Experiment instance. That object is the main entrypoint for the new API.
Log Metadata
Static string assignments become metadata entries:
experiment["model"] = "resnet50"
experiment["dataset"] = "cifar10"
experiment["optimizer"] = "adamw"Log Metrics
Time-series metrics use Series through append() or extend() on experiment["key"]:
for step in range(10):
experiment["train/loss"].append(1.0 / (step + 1), step=step)
experiment["train/accuracy"].append(step / 10.0, step=step)You can also batch values:
experiment["val/loss"].extend([0.5, 0.4, 0.3], start_step=100)Log a File
Use File for static artifacts:
from litlogger import File
experiment["config"] = File("config.yaml")Inspect Logged Data
The experiment exposes runtime views through metadata, metrics, artifacts, and url:
print(experiment.metadata)
print(experiment.metrics)
print(experiment.artifacts)
print(experiment.url)Finalize
Use finalize() when the run is complete.
experiment.finalize()Next Steps
- Files, Media, Models for files, media, and model logging
- Lightning Tutorial for Lightning/Fabric integration
- Complete Workflow for a log-and-fetch workflow
- Standalone Usage for the full standalone guide
Was this page helpful?
Thanks for the feedback.