📈 Log and track ML metrics, parameters, models with Git and/or DVC https://dvc.org/doc/dvclive
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ivan Shcheklein 3225786990
deps: replace deprecated pynvml with nvidia-ml-py (#906)
The pynvml PyPI package is deprecated; v13.x is a shim that redirects to
the official NVIDIA bindings and emits a FutureWarning on import. Depend
on nvidia-ml-py directly, which provides the same pynvml module without
the shim. No code changes needed since the import path is unchanged.
2026-06-05 20:07:03 +05:45
.github chore(deps): bump actions/cache from 4 to 5 (#903) 2025-12-15 11:15:53 +05:45
docs Update README (#528) 2023-04-14 19:21:46 +02:00
examples [pre-commit.ci] pre-commit autoupdate (#892) 2025-11-06 13:13:25 +05:45
src/dvclive [pre-commit.ci] pre-commit autoupdate (#892) 2025-11-06 13:13:25 +05:45
tests [pre-commit.ci] pre-commit autoupdate (#892) 2025-11-06 13:13:25 +05:45
.cruft.json update cruft to have formatters for TOML and YAML (#783) 2024-02-14 08:30:25 -05:00
.gitattributes use py-template 2022-09-08 17:05:16 +02:00
.gitignore ignore logs from vscode and pycharm (#771) 2024-02-05 08:39:32 -05:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate (#892) 2025-11-06 13:13:25 +05:45
CODE_OF_CONDUCT.rst [pre-commit.ci] pre-commit autoupdate (#825) 2024-06-08 16:40:14 -07:00
CONTRIBUTING.rst drop Python 3.8 support (#780) 2024-02-12 10:47:13 +11:00
LICENSE use py-template 2022-09-08 17:05:16 +02:00
noxfile.py support Python 3.14 (#899) 2025-10-31 12:49:30 +05:45
pyproject.toml deps: replace deprecated pynvml with nvidia-ml-py (#906) 2026-06-05 20:07:03 +05:45
README.md Fix example typo in README.md (#764) 2024-01-19 11:34:40 -05:00

DVCLive

PyPI Status Python Version License

Tests Codecov pre-commit Black

DVCLive is a Python library for logging machine learning metrics and other metadata in simple file formats, which is fully compatible with DVC.

Documentation


Quickstart

Python API Overview PyTorch Lightning Scikit-learn Ultralytics YOLO v8

Install dvclive

$ pip install dvclive

Initialize DVC Repository

$ git init
$ dvc init
$ git commit -m "DVC init"

Example code

Copy the snippet below into train.py for a basic API usage example:

import time
import random

from dvclive import Live

params = {"learning_rate": 0.002, "optimizer": "Adam", "epochs": 20}

with Live() as live:

    # log a parameters
    for param in params:
        live.log_param(param, params[param])

    # simulate training
    offset = random.uniform(0.2, 0.1)
    for epoch in range(1, params["epochs"]):
        fuzz = random.uniform(0.01, 0.1)
        accuracy = 1 - (2 ** - epoch) - fuzz - offset
        loss = (2 ** - epoch) + fuzz + offset

        # log metrics to studio
        live.log_metric("accuracy", accuracy)
        live.log_metric("loss", loss)
        live.next_step()
        time.sleep(0.2)

See Integrations for examples using DVCLive alongside different ML Frameworks.

Running

Run this a couple of times to simulate multiple experiments:

$ python train.py
$ python train.py
$ python train.py
...

Comparing

DVCLive outputs can be rendered in different ways:

DVC CLI

You can use dvc exp show and dvc plots to compare and visualize metrics, parameters and plots across experiments:

$ dvc exp show
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Experiment                 Created    train.accuracy   train.loss   val.accuracy   val.loss   step   epochs
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
workspace                  -                  6.0109      0.23311          6.062    0.24321      6   7
master                     08:50 PM                -            -              -          -      -   -
├── 4475845 [aulic-chiv]   08:56 PM           6.0109      0.23311          6.062    0.24321      6   7
├── 7d4cef7 [yarer-tods]   08:56 PM           4.8551      0.82012         4.5555   0.033533      4   5
└── d503f8e [curst-chad]   08:56 PM           4.9768     0.070585         4.0773    0.46639      4   5
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ dvc plots diff $(dvc exp list --names-only) --open

dvc plots diff

DVC Extension for VS Code

Inside the DVC Extension for VS Code, you can compare and visualize results using the Experiments and Plots views:

VSCode Experiments

VSCode Plots

While experiments are running, live updates will be displayed in both views.

DVC Studio

If you push the results to DVC Studio, you can compare experiments against the entire repo history:

Studio Compare

You can enable Studio Live Experiments to see live updates while experiments are running.


Comparison to related technologies

DVCLive is an ML Logger, similar to:

The main differences with those ML Loggers are:

  • DVCLive does not require any additional services or servers to run.
  • DVCLive metrics, parameters, and plots are stored as plain text files that can be versioned by tools like Git or tracked as pointers to files in DVC storage.
  • DVCLive can save experiments or runs as hidden Git commits.

You can then use different options to visualize the metrics, parameters, and plots across experiments.


Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the Apache 2.0 license, dvclive is free and open source software.