---
title: API Reference
description: 'This reference documents the public LitLogger surface:'
canonical: 'https://lightning.ai/docs/litlogger/stable/api-reference/api'
---
# API Reference {#api-reference}

This reference documents the public LitLogger surface:

- initialization functions
- module-level compatibility helpers
- the `Experiment` class
- file, media, and model wrappers
- series and public enums
- `LightningLogger` (deprecated compatibility alias)

## Initialization {#initialization}

### `litlogger.init.init(name=None, root_dir=None, teamspace=None, metadata=None, store_step=True, store_created_at=False, save_logs=False, print_url=True, verbose=True, **kwargs)` {#litlogger.init.init}

Initialize a litlogger experiment for standalone usage.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Name of your experiment (defaults to a generated name).
    
*   **root\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Folder where logs and metadata are stored (default: ./lightning\_logs).
    
*   **teamspace** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | `Teamspace` | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Teamspace where charts and artifacts will appear.
    
*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Extra metadata to associate with the experiment as tags.
    
*   **store\_step** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Whether to store the step field with each logged value.
    
*   **store\_created\_at** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Whether to store a creation timestamp with each value.
    
*   **save\_logs** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If True, capture and upload terminal logs.
    
*   **print\_url** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print the experiment URL and initialization info.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If True, print styled console output. Defaults to True.
    
*   **\*\*kwargs** ([`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")) – Additional keyword arguments. Will be forwarded to the Experiment constructor.
    

Returns:

The initialized experiment instance.

Return type:

[Experiment](#litlogger.experiment.Experiment "litlogger.experiment.Experiment")

Example:

```python
import litlogger

litlogger.init(name="my-experiment")

for i in range(100):
    litlogger.log({"loss": 1.0 / (i + 1), "accuracy": i / 100.0}, step=i)

litlogger.finalize()
```

### `litlogger.init.finish(status=None)` {#litlogger.init.finish}

Finalize the current experiment.

Deprecated since version Use: `experiment.finalize()` instead.

Parameters:

**status** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional status string to mark the experiment with.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.init.get_metadata()` {#litlogger.init.get_metadata}

Get the metadata associated with the current experiment.

Deprecated since version Use: `experiment.metadata` instead.

Returns:

The metadata dictionary with key-value pairs from the metrics stream.

Return type:

[dict](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If litlogger.init() has not been called.

## Module-Level Helpers {#module-level-helpers}

These helpers are available on the top-level `litlogger` module after
initialization. They exist primarily for standalone compatibility workflows.

### `litlogger.log(self, metrics=None, step=None, **kwargs)` {#litlogger.log}

Log metrics to the experiment with background uploading.

Deprecated since version Use: `experiment["key"].append(value, step=step)` instead.

Metrics are buffered locally and uploaded to the cloud in batches to optimize performance. The batch is sent when either 1 second has passed or 1000 values have been logged.

Parameters:

*   **metrics** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Dictionary mapping metric names to numeric values. Example: {“loss”: 0.5, “accuracy”: 0.95}.
    
*   **step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional step number for this data point (e.g., training step, epoch). If None and store\_step=True, no step is recorded.
    
*   **kwargs** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")) – Additional metric values. Can be used to provide metrics more natural. Example: loss=0.5, accuracy: 0.95.
    

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the background thread encountered an error.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.log_metrics(self, metrics=None, step=None, **kwargs)` {#litlogger.log_metrics}

Log metrics to the experiment with background uploading.

Deprecated since version Use: `experiment["key"].append(value, step=step)` instead.

Metrics are buffered locally and uploaded to the cloud in batches to optimize performance. The batch is sent when either 1 second has passed or 1000 values have been logged.

Parameters:

*   **metrics** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Dictionary mapping metric names to numeric values. Example: {“loss”: 0.5, “accuracy”: 0.95}.
    
*   **step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional step number for this data point (e.g., training step, epoch). If None and store\_step=True, no step is recorded.
    
*   **kwargs** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")) – Additional metric values. Can be used to provide metrics more natural. Example: loss=0.5, accuracy: 0.95.
    

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the background thread encountered an error.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.log_metadata(self, metadata=None, **kwargs)` {#litlogger.log_metadata}

Add or update metadata tags on the experiment.

Deprecated since version Use: `experiment["key"] = "value"` instead.

Merges the provided key-value pairs into the experiment’s existing metadata and pushes the update to the cloud immediately.

Parameters:

*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Dictionary of metadata key-value pairs to add or update. Example: {“optimizer”: “adam”, “lr”: “0.001”}.
    
*   **\*\*kwargs** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Additional metadata as keyword arguments. Example: optimizer=”adam”, lr=”0.001”.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.log_file(self, path, remote_path=None, verbose=True)` {#litlogger.log_file}

Upload a file artifact to the cloud for this experiment.

Deprecated since version Use: `experiment["key"] = File("path")` or `experiment["key"].append(File("path"))` instead.

The file is uploaded to cloud storage and registered with the experiment, making it visible in the artifacts view and accessible via get\_file().

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path to the local file to upload. Can be absolute or relative.
    
*   **remote\_path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Path relative to experiment root for storage and display. If None, uses the path relative to cwd if under cwd, otherwise basename. Example: remote\_path=”images/0.png” will store and display as “images/0.png”.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print a confirmation message after upload. Defaults to True.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.get_file(self, path, remote_path=None, verbose=True)` {#litlogger.get_file}

Download a file artifact from the cloud for this experiment.

Deprecated since version Use: `experiment["key"]` to access files instead.

The file is downloaded from cloud storage (previously uploaded via log\_file) and saved to the specified local path.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path where the file should be saved locally. Parent directories are created if needed.
    
*   **remote\_path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Path relative to experiment root where the file is stored. If None, uses the path relative to cwd if under cwd, otherwise basename. Must match the remote\_path used during log\_file() for correct resolution.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print a confirmation message after download. Defaults to True.
    

Returns:

The local path where the file was saved (same as the input path).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

### `litlogger.log_model(self, model, staging_dir=None, verbose=False, version=None, metadata=None)` {#litlogger.log_model}

Save and upload a model object to cloud storage using litmodels.

Deprecated since version Use: `experiment["key"] = File("path")` instead.

This saves a live model object (e.g., PyTorch module, LightningModule) to disk using framework-specific serialization, then uploads it to the litmodels registry.

For uploading pre-saved model files, use log\_model\_artifact() instead.

Parameters:

*   **model** ([`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")) – The model object to save and upload (e.g., torch.nn.Module, LightningModule).
    
*   **staging\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional local directory for staging the model before upload. If None, uses a temp directory.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during upload. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    
*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional metadata dictionary to store with the model (e.g., hyperparameters, metrics).
    

Returns:

Information about the uploaded model (details from litmodels).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

### `litlogger.get_model(self, staging_dir=None, verbose=False, version=None)` {#litlogger.get_model}

Get a model object using litmodels load\_model.

Deprecated since version Use: `experiment["key"]` to access models instead.

Parameters:

*   **staging\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional directory where the model will be downloaded.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

Returns:

The loaded model object.

### `litlogger.log_model_artifact(self, path, verbose=False, version=None)` {#litlogger.log_model_artifact}

Upload a model file or directory to cloud storage using litmodels.

Deprecated since version Use: `experiment["key"] = File("path")` instead.

This uploads raw model files (e.g., weights.pt, checkpoint.ckpt) or entire directories to the litmodels registry. Use this when you have pre-saved model files.

For saving model objects directly, use log\_model() instead.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path to the local model file or directory to upload.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during upload. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

### `litlogger.get_model_artifact(self, path, verbose=False, version=None)` {#litlogger.get_model_artifact}

Download a model artifact file or directory from cloud storage using litmodels.

Deprecated since version Use: `experiment["key"]` to access model artifacts instead.

This downloads raw model files or directories that were previously uploaded via log\_model\_artifact(). The files are saved to the specified local path.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path where the model should be saved locally. Directories are created if needed.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during download. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Returns:

The local path where the model was saved (same as the input path).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

### `litlogger.finalize(self, status=None, print_summary=True)` {#litlogger.finalize}

Finalize the experiment and upload all remaining metrics.

This method waits for the background thread to finish uploading all queued metrics, and uploads terminal logs if save\_logs=True. It’s automatically called on exit via an atexit handler, but can also be called manually.

This method is idempotent and can be called multiple times safely.

Parameters:

*   **status** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional status string for the experiment (currently unused, reserved for future use).
    
*   **print\_summary** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print the run completion summary. Defaults to True.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

## Experiment {#experiment}

### `class litlogger.experiment.Experiment(name, log_dir='lightning_logs', save_logs=False, teamspace=None, light_color=None, dark_color=None, metadata=None, store_step=True, store_created_at=False, max_batch_size=1000, rate_limiting_interval=1, verbose=True)` {#litlogger.experiment.Experiment}

Bases: `LegacyExperiment`

Core experiment with dict-like API for logging data.

Supports pythonic dict-like access patterns:

experiment\[“key”\].append(value) # time series (metrics or files) experiment\[“key”\].extend(values) # batch time series experiment\[“key”\] = “value” # static metadata experiment\[“key”\] = File(“path”) # static file artifact experiment\[“key”\] # fetch data

Also inherits the legacy method-based API used for backwards compatibility (log\_metrics, log\_file, log\_model, etc.).

Keys must be unique across metadata, artifacts, and metrics.

Initialize an experiment for logging to the [https://lightning.ai](https://lightning.ai) platform.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – A human-friendly name for your experiment.
    
*   **log\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Local directory where temporary logs/artifacts are stored. Defaults to “lightning\_logs”.
    
*   **save\_logs** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If True, capture and upload terminal output as a file artifact. Defaults to False.
    
*   **teamspace** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | `Teamspace` | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Teamspace in which to create and display the charts. If None, uses your default teamspace.
    
*   **light\_color** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Hex color of the curve in light mode (overrides the random default). Example: “#FF5733”.
    
*   **dark\_color** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Hex color of the curve in dark mode (overrides the random default). Example: “#3498DB”.
    
*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Key-value parameters associated with the experiment (displayed as tags in the UI).
    
*   **store\_step** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Whether to store the provided step for each data point. Defaults to True.
    
*   **store\_created\_at** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Whether to store a creation timestamp for each data point. Defaults to False.
    
*   **max\_batch\_size** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – Number of metric values to batch before uploading. Defaults to 1000.
    
*   **rate\_limiting\_interval** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – Minimum seconds between uploads. Defaults to 1.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If True, print styled console output. Defaults to True.
    

#### `finalize(status=None, print_summary=True)` {#litlogger.experiment.Experiment.finalize}

Finalize the experiment and upload all remaining metrics.

This method waits for the background thread to finish uploading all queued metrics, and uploads terminal logs if save\_logs=True. It’s automatically called on exit via an atexit handler, but can also be called manually.

This method is idempotent and can be called multiple times safely.

Parameters:

*   **status** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional status string for the experiment (currently unused, reserved for future use).
    
*   **print\_summary** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print the run completion summary. Defaults to True.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `get_file(path, remote_path=None, verbose=True)` {#litlogger.experiment.Experiment.get_file}

Download a file artifact from the cloud for this experiment.

Deprecated since version Use: `experiment["key"]` to access files instead.

The file is downloaded from cloud storage (previously uploaded via log\_file) and saved to the specified local path.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path where the file should be saved locally. Parent directories are created if needed.
    
*   **remote\_path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Path relative to experiment root where the file is stored. If None, uses the path relative to cwd if under cwd, otherwise basename. Must match the remote\_path used during log\_file() for correct resolution.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print a confirmation message after download. Defaults to True.
    

Returns:

The local path where the file was saved (same as the input path).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

#### `get_model(staging_dir=None, verbose=False, version=None)` {#litlogger.experiment.Experiment.get_model}

Get a model object using litmodels load\_model.

Deprecated since version Use: `experiment["key"]` to access models instead.

Parameters:

*   **staging\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional directory where the model will be downloaded.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

Returns:

The loaded model object.

#### `get_model_artifact(path, verbose=False, version=None)` {#litlogger.experiment.Experiment.get_model_artifact}

Download a model artifact file or directory from cloud storage using litmodels.

Deprecated since version Use: `experiment["key"]` to access model artifacts instead.

This downloads raw model files or directories that were previously uploaded via log\_model\_artifact(). The files are saved to the specified local path.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path where the model should be saved locally. Directories are created if needed.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during download. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Returns:

The local path where the model was saved (same as the input path).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

#### `log_file(path, remote_path=None, verbose=True)` {#litlogger.experiment.Experiment.log_file}

Upload a file artifact to the cloud for this experiment.

Deprecated since version Use: `experiment["key"] = File("path")` or `experiment["key"].append(File("path"))` instead.

The file is uploaded to cloud storage and registered with the experiment, making it visible in the artifacts view and accessible via get\_file().

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path to the local file to upload. Can be absolute or relative.
    
*   **remote\_path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Path relative to experiment root for storage and display. If None, uses the path relative to cwd if under cwd, otherwise basename. Example: remote\_path=”images/0.png” will store and display as “images/0.png”.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print a confirmation message after upload. Defaults to True.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `log_files(paths, remote_paths=None, max_workers=10)` {#litlogger.experiment.Experiment.log_files}

Upload multiple file artifacts to the cloud in parallel.

Deprecated since version Use: `experiment["key"] = File("path")` for each file instead.

This is more efficient than calling log\_file() multiple times when you have many files, as it handles them in parallel.

Parameters:

*   **paths** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – List of paths to local files to upload.
    
*   **remote\_paths** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional list of remote paths, one for each file in paths. If provided, must have same length as paths. If None, each file uses its default remote path (relative to cwd or basename).
    
*   **max\_workers** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – Maximum number of concurrent uploads. Defaults to 10.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `log_media(name, path, kind=None, step=None, epoch=None, caption=None, verbose=False)` {#litlogger.experiment.Experiment.log_media}

Upload a media file (image, text, etc.) to the experiment.

Deprecated since version Use: `experiment["key"].append(Image(...))` or `experiment["key"].append(Text(...))` instead.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Name of the media.
    
*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Local path to the media file.
    
*   **kind** ([`MediaType`](#litlogger.types.MediaType "litlogger.types.MediaType") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Type of media (MediaType.IMAGE or MediaType.TEXT). If None, attempts to guess from file extension or mime type.
    
*   **step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional training step.
    
*   **epoch** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional training epoch.
    
*   **caption** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional caption for the media.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to print a confirmation message after upload.
    

Raises:

*   [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If the file type cannot be determined or is not supported.
    
*   [**FileNotFoundError**](https://docs.python.org/3/builtins/exceptions.html#FileNotFoundError "(in Python v3.15)") – If the file does not exist.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `log_metadata(metadata=None, **kwargs)` {#litlogger.experiment.Experiment.log_metadata}

Add or update metadata tags on the experiment.

Deprecated since version Use: `experiment["key"] = "value"` instead.

Merges the provided key-value pairs into the experiment’s existing metadata and pushes the update to the cloud immediately.

Parameters:

*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Dictionary of metadata key-value pairs to add or update. Example: {“optimizer”: “adam”, “lr”: “0.001”}.
    
*   **\*\*kwargs** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Additional metadata as keyword arguments. Example: optimizer=”adam”, lr=”0.001”.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `log_metrics(metrics=None, step=None, **kwargs)` {#litlogger.experiment.Experiment.log_metrics}

Log metrics to the experiment with background uploading.

Deprecated since version Use: `experiment["key"].append(value, step=step)` instead.

Metrics are buffered locally and uploaded to the cloud in batches to optimize performance. The batch is sent when either 1 second has passed or 1000 values have been logged.

Parameters:

*   **metrics** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Dictionary mapping metric names to numeric values. Example: {“loss”: 0.5, “accuracy”: 0.95}.
    
*   **step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional step number for this data point (e.g., training step, epoch). If None and store\_step=True, no step is recorded.
    
*   **kwargs** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")) – Additional metric values. Can be used to provide metrics more natural. Example: loss=0.5, accuracy: 0.95.
    

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the background thread encountered an error.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `log_metrics_batch(metrics)` {#litlogger.experiment.Experiment.log_metrics_batch}

Log a batch of metrics through the background queue.

Deprecated since version Use: `experiment["key"].extend(values, start_step=step)` instead.

This method converts the batch format to Metrics objects and pushes them through the background queue, which handles batching and chunking to respect API limits.

Parameters:

**metrics** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\]\]\]) – Dictionary mapping metric names to lists of dicts with “step” and “value” keys.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

Example:

```python
{
    "loss": [
        {"step": 0, "value": 1.0},
        {"step": 1, "value": 0.5},
    ],
    "accuracy": [
        {"step": 0, "value": 0.6},
        {"step": 1, "value": 0.8},
    ],
}
```

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the background thread encountered an error.

#### `log_model(model, staging_dir=None, verbose=False, version=None, metadata=None)` {#litlogger.experiment.Experiment.log_model}

Save and upload a model object to cloud storage using litmodels.

Deprecated since version Use: `experiment["key"] = File("path")` instead.

This saves a live model object (e.g., PyTorch module, LightningModule) to disk using framework-specific serialization, then uploads it to the litmodels registry.

For uploading pre-saved model files, use log\_model\_artifact() instead.

Parameters:

*   **model** ([`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")) – The model object to save and upload (e.g., torch.nn.Module, LightningModule).
    
*   **staging\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional local directory for staging the model before upload. If None, uses a temp directory.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during upload. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    
*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional metadata dictionary to store with the model (e.g., hyperparameters, metrics).
    

Returns:

Information about the uploaded model (details from litmodels).

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

#### `log_model_artifact(path, verbose=False, version=None)` {#litlogger.experiment.Experiment.log_model_artifact}

Upload a model file or directory to cloud storage using litmodels.

Deprecated since version Use: `experiment["key"] = File("path")` instead.

This uploads raw model files (e.g., weights.pt, checkpoint.ckpt) or entire directories to the litmodels registry. Use this when you have pre-saved model files.

For saving model objects directly, use log\_model() instead.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path to the local model file or directory to upload.
    
*   **verbose** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Whether to show progress bar during upload. Defaults to False.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional version string for the model.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `print_url()` {#litlogger.experiment.Experiment.print_url}

Print the experiment URL and initialization info with styled output.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `update(data)` {#litlogger.experiment.Experiment.update}

Bulk-update the experiment with multiple keys at once.

Dispatches each value based on its type:

str → metadata (same as experiment\[“key”\] = “value”) File → static file artifact (same as experiment\[“key”\] = file) float/int → append a single metric point (same as experiment\[“key”\].append(value)) list → extend a time series (same as experiment\[“key”\].extend(values))

Parameters:

**data** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") | [`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`File`](#litlogger.media.File "litlogger.media.File") | [`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") | [`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`File`](#litlogger.media.File "litlogger.media.File")\]\]) – Dictionary mapping keys to values of mixed types.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `property artifacts` {#litlogger.experiment.Experiment.artifacts}

Get all artifacts (static files and file series) logged to this experiment.

Returns:

Mapping of artifact keys to File (static)

or Series (time series of files).

Return type:

[dict](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [File](#litlogger.media.File "litlogger.media.File") | [Series](#litlogger.series.Series "litlogger.series.Series")\]

#### `property metadata` {#litlogger.experiment.Experiment.metadata}

Get the metadata associated with this experiment from the metrics stream.

Returns:

The metadata dictionary with key-value pairs from code-defined tags.

Return type:

[dict](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]

#### `property metrics` {#litlogger.experiment.Experiment.metrics}

Get all metric time series logged to this experiment.

Returns:

Mapping of metric names to their series of values.

Return type:

[dict](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [Series](#litlogger.series.Series "litlogger.series.Series")\]

#### `property teamspace` {#litlogger.experiment.Experiment.teamspace}

Get the teamspace for this experiment.

Returns:

The teamspace object.

Return type:

Teamspace

#### `property url` {#litlogger.experiment.Experiment.url}

Get the direct URL to view this experiment in the Lightning.ai web interface.

Returns:

The full URL to the experiment’s visualization page.

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

## Media Wrappers {#media-wrappers}

### `class litlogger.media.File(path, description='')` {#litlogger.media.File}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

Represents a file to be logged to the experiment.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Path to the local file.
    
*   **description** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Optional human-readable description of the file.
    

#### `save(path)` {#litlogger.media.File.save}

Download the remote file to a local path.

Only works for files that have been uploaded to an experiment.

Parameters:

**path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Local path where the file should be saved.

Returns:

The local path where the file was saved.

Return type:

[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the file has no remote download context.

### `class litlogger.media.Image(data, format='png', description='')` {#litlogger.media.Image}

Bases: [`File`](#litlogger.media.File "litlogger.media.File")

Represents an image to be logged.

Can take a file path (str) or a Python object (PIL Image, numpy array, or torch Tensor) and will render it to a temporary file for upload.

Parameters:

*   **data** ([`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")) – The image data - a file path string, PIL Image, numpy array, or torch Tensor.
    
*   **format** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Image format for rendering objects to disk (default: “png”).
    
*   **description** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Optional human-readable description of the image.

### `class litlogger.media.Text(content, description='')` {#litlogger.media.Text}

Bases: [`File`](#litlogger.media.File "litlogger.media.File")

Represents text content to be logged.

Takes a string and writes it to a temporary file for upload.

Parameters:

*   **content** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – The text string to log.
    
*   **description** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Optional human-readable description of the text.

### `class litlogger.media.Video(data, format='mp4', description='', fps=None)` {#litlogger.media.Video}

Bases: [`File`](#litlogger.media.File "litlogger.media.File")

#### `DEFAULT_FPS = 24` {#litlogger.media.Video.DEFAULT_FPS}

Represents a video to be logged.

Accepts: - a file path string - a MoviePy clip - a numpy array / torch tensor of frames

Supported array shapes: - (T, H, W) grayscale frames - (T, H, W, C) frames in HWC format - (T, C, H, W) frames in CHW format, where C is 1/3/4

Parameters:

*   **data** – Video data or a path to a video file.
    
*   **format** – Output container/extension, default “mp4”.
    
*   **description** – Optional description.
    
*   **fps** – Frames per second used when rendering arrays or clips that do not already carry fps metadata.

### `class litlogger.media.Model(data, name=None, version=None, metadata=None, staging_dir=None, description='', _kind=None)` {#litlogger.media.Model}

Bases: [`File`](#litlogger.media.File "litlogger.media.File")

Represents a model to be logged.

Can take either a Python model object or a local path to a pre-saved model artifact. Uploads are handled through the model registry.

Parameters:

*   **data** ([`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")) – Python model object or path to a pre-saved model file/directory.
    
*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional registry name override for this model. Defaults to the experiment name.
    
*   **version** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional model version. Defaults to `"latest"`.
    
*   **metadata** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\] | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional metadata to associate with the model upload.
    
*   **staging\_dir** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional local staging directory for object-based uploads.
    
*   **description** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Optional human-readable description of the model.
    

#### `classmethod from_remote(model_name, kind, version=None)` {#litlogger.media.Model.from_remote}

Create a remote-bound model wrapper for resumed experiments.

Return type:

[`Model`](#litlogger.media.Model "litlogger.media.Model")

#### `load(staging_dir=None)` {#litlogger.media.Model.load}

Load a remote model object via the registry helpers.

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

## Series {#series}

### `class litlogger.series.Series(experiment, key)` {#litlogger.series.Series}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

A list-like proxy for time-series data that supports append and extend.

Tracks either metric values (floats) or file series (File objects). The type is determined by the first value appended and cannot be mixed.

#### `append(value, step=None)` {#litlogger.series.Series.append}

Append a value to the time series.

Parameters:

*   **value** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") | [`File`](#litlogger.media.File "litlogger.media.File")) – A float/int for metric series, or a File for file series.
    
*   **step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional step number for this data point (e.g., training step, epoch).
    

Raises:

[**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError "(in Python v3.15)") – If value type doesn’t match existing series type or is unsupported.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `extend(values, start_step=None)` {#litlogger.series.Series.extend}

Extend the time series with multiple values.

Parameters:

*   **values** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") | [`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`File`](#litlogger.media.File "litlogger.media.File")\]) – List of values to append.
    
*   **start\_step** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") | [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")) – Optional starting step number. Each subsequent value gets start\_step, start\_step+1, start\_step+2, etc.
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

## Types {#types}

### `class litlogger.types.MediaType(*values)` {#litlogger.types.MediaType}

Bases: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum "(in Python v3.15)")

Type of media to upload.

#### `FILE = 'file'` {#litlogger.types.MediaType.FILE}

#### `IMAGE = 'image'` {#litlogger.types.MediaType.IMAGE}

#### `MODEL = 'model'` {#litlogger.types.MediaType.MODEL}

#### `TEXT = 'text'` {#litlogger.types.MediaType.TEXT}

#### `VIDEO = 'video'` {#litlogger.types.MediaType.VIDEO}

### `class litlogger.types.PhaseType(*values)` {#litlogger.types.PhaseType}

Bases: [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum "(in Python v3.15)")

Phase of a metrics store lifecycle.

#### `COMPLETED = 'completed'` {#litlogger.types.PhaseType.COMPLETED}

#### `FAILED = 'failed'` {#litlogger.types.PhaseType.FAILED}

#### `PENDING = 'pending'` {#litlogger.types.PhaseType.PENDING}

#### `RUNNING = 'running'` {#litlogger.types.PhaseType.RUNNING}

#### `STOPPED = 'stopped'` {#litlogger.types.PhaseType.STOPPED}

### `class litlogger.types.MetricValue(value, step=None, created_at=None)` {#litlogger.types.MetricValue}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

A single metric value with optional step and timestamp.

#### `value` {#litlogger.types.MetricValue.value}

The numeric metric value.

#### `step` {#litlogger.types.MetricValue.step}

Optional step number for this value.

#### `created_at` {#litlogger.types.MetricValue.created_at}

Optional datetime when this value was created.

### `class litlogger.types.Metrics(name, values=<factory>)` {#litlogger.types.Metrics}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

A collection of metric values for a named metric.

#### `name` {#litlogger.types.Metrics.name}

The metric name (e.g., “loss”, “accuracy”).

#### `values` {#litlogger.types.Metrics.values}

List of metric values.

## Model Registry Helpers {#model-registry-helpers}

These helpers are available from `litlogger.models` and expose the
vendored model-registry API on the LitLogger side.

### `litlogger.models.upload_model(name, model, progress_bar=True, cloud_account=None, verbose=1, metadata=None, experiment=None)` {#litlogger.models.upload_model}

Upload a local artifact (file or directory) to Lightning Cloud Models.

Return type:

`UploadedModelInfo`

### `litlogger.models.save_model(name, model, progress_bar=True, cloud_account=None, staging_dir=None, verbose=1, metadata=None, experiment=None)` {#litlogger.models.save_model}

Serialize an in-memory model and upload it to Lightning Cloud Models.

Return type:

`UploadedModelInfo`

### `litlogger.models.download_model(name, download_dir='.', progress_bar=True)` {#litlogger.models.download_model}

Download a model version from Lightning Cloud Models.

Return type:

[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]

### `litlogger.models.load_model(name, download_dir='.')` {#litlogger.models.load_model}

Download a model and load it into memory based on its file extension.

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

### `litlogger.models.upload_model_files(name, path, progress_bar=True, cloud_account=None, verbose=1, metadata=None, experiment=None)` {#litlogger.models.upload_model_files}

Upload local artifact(s) to Lightning Cloud using the SDK.

Return type:

`UploadedModelInfo`

### `litlogger.models.download_model_files(name, download_dir='.', progress_bar=True)` {#litlogger.models.download_model_files}

Download artifact(s) for a model version using the SDK.

Return type:

[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") | [`list`](https://docs.python.org/3/builtins/stdtypes.html#list "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]

## LightningLogger {#lightninglogger}

Deprecated compatibility alias for Lightning/Fabric integration. Prefer
`lightning:lightning.pytorch.loggers.LitLogger`, or use
`litlogger.init.init` and the dict-style
`Experiment` API for standalone usage.

### `class litlogger.logger.LightningLogger(*args, **kwargs)` {#litlogger.logger.LightningLogger}

Bases: [`LitLogger`](/docs/pytorch/stable/extensions/generated/lightning.pytorch.loggers.LitLogger#lightning.pytorch.loggers.LitLogger "(in PyTorch Lightning v2.7.0.dev)"), `LitLogger`

Deprecated compatibility alias for the upstream Lightning LitLogger.

Deprecated since version 2026.03.17: Use [`lightning.pytorch.loggers.LitLogger`](/docs/pytorch/stable/extensions/generated/lightning.pytorch.loggers.LitLogger#lightning.pytorch.loggers.LitLogger "(in PyTorch Lightning v2.7.0.dev)") for Lightning/Fabric integration, or use [`litlogger.init.init()`](#litlogger.init.init "litlogger.init.init") and the dict-style `Experiment` API for standalone scripts.

---

**Navigation**

- Parent: [API Reference](/docs/litlogger/2026.08.28/api-reference.md)
