Standalone Usage
Use LitLogger in any Python process without Lightning. For new code, the recommended standalone workflow is the dict-style Experiment API returned by litlogger.init().

Recommended New API
import litlogger
from litlogger import File
experiment = litlogger.init(name="my-experiment")
experiment["model"] = "resnet50"
experiment["lr"] = "0.001"
for step in range(100):
experiment["train/loss"].append(1.0 / (step + 1), step=step)
experiment["train/accuracy"].append(step / 100.0, step=step)
experiment["config"] = File("config.yaml")
experiment.finalize()The new standalone API covers:
- metadata through
experiment["key"] = "value" - metrics through
append()andextend() - artifacts, media, and models through file-like wrappers
- retrieval through
metadata,metrics, andartifacts
Metric Logging
experiment["loss"].append(0.5, step=0)
experiment["loss"].extend([0.4, 0.3, 0.2], start_step=1)Metadata
Metadata can be provided at initialization time or added later:
experiment = litlogger.init(
name="training-run",
metadata={"dataset": "imagenet"},
)
experiment["optimizer"] = "adamw"Files, Media, and Models
from litlogger import File, Image, Model, Text
experiment["config"] = File("config.yaml")
experiment["preview"] = Image("sample.png")
experiment["notes"] = Text("training summary")
experiment["checkpoint"] = Model("checkpoint.ckpt")Resume by Name
Initializing with the same name reconnects to the same experiment.
experiment = litlogger.init(name="my-experiment")
experiment["train/loss"].append(0.2, step=100)
experiment.finalize()Runtime Views
Use metadata, metrics, artifacts, and url to inspect the current run state.
print(experiment.metadata)
print(experiment.metrics)
print(experiment.artifacts)
print(experiment.url)Legacy Module-Level API
The older module-level API is still available for compatibility through log_metrics(), log_file(), log_metadata(), and finalize():
import litlogger
litlogger.init(name="legacy-script")
litlogger.log_metrics({"loss": 0.5}, step=0)
litlogger.log_file("config.yaml")
litlogger.log_metadata({"model": "resnet50"})
litlogger.finalize()This API is useful for existing scripts, but the dict-style API is the primary user-facing workflow.
Operational Options
Common standalone options:
teamspace=...to select a teamspace explicitlysave_logs=Trueto capture terminal output asconsole_output.txtlight_color=...anddark_color=...to override chart colorsstore_step=Falseorstore_created_at=Trueto control tracker data
Related Docs
Was this page helpful?
Thanks for the feedback.