Skip to main content

TensorBoard-like terminal monitor for PyTorch Lightning metrics, CSVLogger runs, and live run comparison.

Project description

ltui - terminal TensorBoard for PyTorch Lightning metrics

PyPI

Monitor PyTorch Lightning training runs directly over SSH or inside tmux. No browser, no TensorBoard server, no port forwarding.

pipx install lightning-metrics-tui
ltui --demo

For your own Lightning logs:

ltui ./lightning_logs

Grouped multiplot view in ltui

Run comparison plot in ltui

Why ltui?

ltui is a TensorBoard-like terminal monitor for PyTorch Lightning metrics. It is built for remote training sessions where opening a browser, starting a TensorBoard server, or forwarding ports is friction.

Use it to inspect Lightning CSVLogger runs, compare versions, group train/validation metrics, smooth noisy curves, inspect run configs, and navigate everything from the terminal.

Quick start

pipx install lightning-metrics-tui
ltui --demo

For one-shot use without a persistent install:

pipx run --spec lightning-metrics-tui ltui --demo

The command remains ltui. The install package is lightning-metrics-tui, and the Python module remains ltui.

Try the demo

ltui --demo

The demo opens bundled Lightning-style CSVLogger logs with three versions, training and validation loss, accuracy, learning rate, and hparams.yaml files. The demo data is copied to a temporary directory before launch.

From a source checkout, the same example data is available at:

ltui examples/lightning_logs

Usage with existing Lightning logs

Point ltui at any directory containing Lightning logs:

ltui /path/to/log/root

Common examples:

ltui ./outputs
ltui ./lightning_logs
ltui /data/experiments/stage1

On startup, ltui recursively discovers supported run directories, selects the latest modified run by default, and chooses a loss metric when one is available. The preferred x-axis is step, then epoch, then row index. Press a to toggle between step and epoch mode.

Usage with PyTorch Lightning CSVLogger

Existing Lightning CSVLogger runs work without changing your training code. Every discovered metrics.csv is treated as one selectable run/version.

Supported layouts include:

lightning_logs/version_0/metrics.csv
run_a/version_0/metrics.csv
run_a/lightning_logs/version_0/metrics.csv
experiments/group_1/run_a/lightning_logs/version_3/metrics.csv

For native metrics.csv files, train/validation grouping uses the standard prefixes:

train_
val_

Examples:

train_loss + val_loss -> loss
train_recon_loss + val_recon_loss -> recon_loss
train_kl + val_kl -> kl

Lightning step/epoch suffixes are handled as part of the same family, so train_loss_step, train_loss_epoch, and val_loss appear as loss.

Usage with LtuiLogger

LtuiLogger is an optional PyTorch Lightning logger for new runs. It writes a small manifest, one narrow CSV file per metric series, optional image folders, and hyperparameters as JSON.

Install the optional logger dependencies in your training environment:

python -m pip install "lightning-metrics-tui[logger]"

Use it with Lightning:

from lightning.pytorch import Trainer
from ltui.lightning import LtuiLogger

logger = LtuiLogger(
    save_dir="outputs",
    name="stage1",
)

trainer = Trainer(logger=logger)

Path-style metric names create a hierarchy in the metric selector and multiplot view:

self.log("train/loss/kl", train_kl)
self.log("val/loss/kl", val_kl)
self.log("train/loss/recon", train_recon)
self.log("val/loss/recon", val_recon)

The logger also accepts train_ and val_ style names with the default prefixes, so simple metric names like train_loss and val_loss remain grouped as loss.

Images can be logged with the same path-style hierarchy:

logger.log_image("train/recon/sample", image, step=global_step, epoch=current_epoch)
logger.experiment.add_image("val/recon/sample", image_tensor, global_step=global_step)

Press i in the TUI to choose an image stream. Image viewing launches feh when it is installed.

Features

  • Live terminal monitoring for PyTorch Lightning runs
  • Lightning CSVLogger metrics.csv compatibility
  • Optional LtuiLogger for structured metric and image logs
  • Train/validation metric grouping
  • Grouped multiplot pages for sibling metrics
  • Multi-run comparison with color-coded legends
  • Step and epoch x-axis modes with Lightning-friendly validation alignment
  • Log scaling and EMA smoothing
  • YAML config inspection for runs with a unique config file
  • Keyboard-first selectors with fuzzy search

Why use ltui instead of TensorBoard?

Use ltui when you:

  • train on a remote machine over SSH
  • work inside tmux
  • do not want to forward ports
  • want to inspect CSVLogger-compatible metrics quickly
  • want terminal-native run comparison
  • want a lightweight monitor without starting a TensorBoard server

TensorBoard is still the broader tool for full experiment dashboards, plugin views, embeddings, and richer browser-based inspection. ltui focuses on fast scalar metric monitoring in the terminal.

How is this different from generic terminal plotters?

Generic terminal plotters can display scalar data, TensorBoard logs, or CSV files. ltui is focused on PyTorch Lightning training workflows: Lightning-style log directories, CSVLogger-compatible metrics, train/validation metric grouping, run comparison, smoothing, config inspection, and terminal-native navigation.

Installation

Recommended CLI install:

pipx install lightning-metrics-tui

Normal pip install:

python -m pip install lightning-metrics-tui

Optional logger dependencies:

python -m pip install "lightning-metrics-tui[logger]"

The TUI itself does not require PyTorch Lightning.

Controls

Key Action
r Open run/version selector
c Open config viewer for runs with a unique YAML config
m Open metric selector
i Open image selector and launch feh for the selected image stream
/ Fuzzy search inside selector
arrow keys Navigate selector or selected plot in multiplot mode; left/right jump between models in run/config selectors
space Toggle selection in selector, open multiplot on main screen
enter Apply selector, focus selected plot in multiplot mode
escape Clear plot selection in multiplot mode
n Next selected metric/family, or next page in multiplot mode
p Previous selected metric/family, or previous page in multiplot mode
a Toggle x-axis between step and epoch
d Toggle dark/light plot theme
s Toggle smoothing
x Toggle log-x
y Toggle log-y
q Quit

Development

python -m pip install -e ".[dev]"
pytest
python -m build

Changelog / release notes

See CHANGELOG.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightning_metrics_tui-0.2.0.tar.gz (518.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightning_metrics_tui-0.2.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file lightning_metrics_tui-0.2.0.tar.gz.

File metadata

  • Download URL: lightning_metrics_tui-0.2.0.tar.gz
  • Upload date:
  • Size: 518.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lightning_metrics_tui-0.2.0.tar.gz
Algorithm Hash digest
SHA256 816587cb98d7c79e16b0978f3d52c025ee09f38dbffef8421bcd4485e1e5c951
MD5 71216bacb79e1a15224fe704d5d64490
BLAKE2b-256 caf40a9cb491e796fe35701b981f207e041a0953e7e4fceb9b2b35db4675ea8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_metrics_tui-0.2.0.tar.gz:

Publisher: publish.yml on erik-ayari/ltui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lightning_metrics_tui-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_metrics_tui-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04541f3e87622d2509553a3592223581bf267204f97a5534f0efa4141e5c8109
MD5 c5135670b45e1891ec4a19786352b7d2
BLAKE2b-256 1c38ae45b748c4bb035e7935532f620b50d5f4beea5d17c4969644186b57fae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lightning_metrics_tui-0.2.0-py3-none-any.whl:

Publisher: publish.yml on erik-ayari/ltui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page