--- id: pytorch-lightning version: "2.6.5" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pytorch-lightning — PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate. License: permissive · Maintenance: active · Downloads: 11.2M/mo ## What it is and what it does PyTorch Lightning is a structured wrapper around PyTorch that enforces separation of research code (the LightningModule), engineering code (handled by the Trainer), and auxiliary concerns like logging and callbacks. It lets you write a model once and then scale it to multiple GPUs, TPUs, or CPUs by changing only Trainer configuration—no changes to your model code required. The package handles distributed training setup, mixed-precision training, checkpointing, early stopping, and integration with experiment loggers (TensorBoard, Weights & Biases, MLflow, and others) automatically. The design philosophy is to eliminate boilerplate: you define training_step, validation_step, and configure_optimizers in your LightningModule, organize data into DataLoaders or a LightningDataModule, and let the Trainer orchestrate the rest. It's built on top of torch, tqdm, PyYAML, fsspec, torchmetrics, packaging, typing-extensions, and lightning-utilities, all of which are standard dependencies in the PyTorch ecosystem. The package is actively maintained, has no known vulnerabilities, and supports Python 3.10 through 3.13. Use it for: - Train a model on a single GPU, then scale to 8 GPUs or 256 GPUs across multiple nodes without modifying model code. - Manage experiment tracking and logging across multiple runs with built-in logger integrations. - Implement early stopping and model checkpointing with minimal boilerplate code. - Export trained models to TorchScript or ONNX for production inference. - Run the same training code on TPUs, GPUs, or CPUs by changing only the Trainer accelerator parameter. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyTorch Lightning wraps PyTorch training code to separate research logic from engineering boilerplate, enabling distributed training across GPUs, TPUs, and CPUs without code changes. Yes. PyTorch Lightning is a mature, actively maintained framework (31287 stars, recent release) with zero known vulnerabilities, permissive licensing, and low install friction. It's worth installing if you want to reduce training boilerplate and gain automatic support for distributed training, mixed precision, and experiment management without learning a new deep-learning abstraction. If you're writing simple single-GPU scripts, the overhead may not justify it; for research or production workflows involving scaling, logging, or checkpointing, it's a clear win. ## Install pip install pytorch-lightning uv add pytorch-lightning poetry add pytorch-lightning ## Installing pytorch-lightning Before you install: Low friction install with a pure-Python wheel. Active maintenance with a recent release (79 days ago) and strong repository signals (31287 stars, last commit 2026-08-09). Depends on torch and eight other runtime packages, all standard in the ML ecosystem. License in practice: Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for both research and production deployments. Quickstart: pip install pytorch-lightning import pytorch_lightning as pl from torch.utils.data import DataLoader class LitModel(pl.LightningModule): def training_step(self, batch, batch_idx): # your training logic return loss trainer = pl.Trainer() trainer.fit(model, DataLoader(train_data), DataLoader(val_data)) Requires Python >=3.10 and torch as a runtime dependency. Verify before relying: - Whether the 40+ advanced features mentioned in the description are all stable or some remain experimental. - Performance overhead compared to raw PyTorch for simple single-GPU training workflows. - Compatibility guarantees across the PyTorch versions tested (1.12, 1.13, 2.0, 2.1). ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 11.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch training framework, distributed deep learning, pytorch boilerplate reduction, multi-gpu training wrapper, pytorch experiment management, lightning module trainer, pytorch scaling framework, distributed-training, pytorch-wrapper, experiment-management [View on SkillFed](https://skillfed.io/packages/pytorch-lightning) · [View on PyPI](https://pypi.org/project/pytorch-lightning/)