lightning
The Deep Learning framework to train, deploy, and ship AI products Lightning fast.
Decision gist · record as of 2026-08-14
Yes, if you train PyTorch models at any scale beyond single-GPU prototypes. Lightning eliminates repetitive distributed training boilerplate while keeping model code readable and portable. One known vulnerability (PYSEC-2026-3624) should be reviewed before production use, but the active maintenance status and permissive license make it a solid choice for research and production workflows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.10 and torch as a runtime dependency; GPU training requires CUDA-compatible hardware and drivers.
- Low friction: pure Python wheel with 9 runtime dependencies including torch and torchmetrics.
- Actively maintained with recent releases; last commit 2026-08-09 and 31287 repository stars indicate ongoing development.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions—suitable for most projects.
last release 2026-05-27 (79 days) · last repo commit 2026-08-09 · 31,287 stars
1 known vulnerabilities (OSV.dev, 2026-08-14) · 6,376,248 downloads/mo, #1,919 on PyPI
Alternatives
Verify before relying
pip install lightning
import lightning as L
import torch.nn as nn
class LitModel(L.LightningModule):
def __init__(self):
super().__init__()
self.layer = nn.Linear(10, 1)
def training_step(self, batch, batch_idx):
return self.layer(batch[0]).mean()
def configure_optimizers(self):
return torch.optim.Adam(self.parameters())
trainer = L.Trainer()
trainer.fit(model, train_dataloader)- Scope and severity of PYSEC-2026-3624 vulnerability and whether it affects typical training workflows.
- Whether the framework's abstraction overhead is acceptable for custom training loops requiring fine-grained control.
What it is and what it does
Lightning is a training framework built on top of PyTorch that eliminates boilerplate infrastructure code. Instead of manually managing backpropagation, mixed precision, distributed training, and device placement across projects, you define your model as a LightningModule with training_step and configure_optimizers methods, then pass it to a Trainer that handles the rest. The framework scales from single CPU to thousands of GPUs across multiple nodes without changing your core model code.
It sits between plain PyTorch (which requires you to write all infrastructure) and higher-level frameworks that hide model details. You retain full control over model logic while Lightning automates the engineering: logging, checkpointing, gradient accumulation, distributed synchronization, and hardware acceleration. It supports pretraining and finetuning workflows across diverse tasks—image classification, segmentation, text, audio, LLM finetuning, and time-series forecasting.
Use it for
- Scale a single-GPU PyTorch model to multi-node training without rewriting training loops.
- Pretrain or finetune large models (LLMs, diffusion models) with automatic mixed precision and distributed strategies.
- Manage experiment tracking, checkpointing, and logging across multiple training runs.
- Train on TPUs or other accelerators by changing one Trainer parameter instead of rewriting device logic.
- Build reproducible research code that separates model definition from training infrastructure.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you train PyTorch models at any scale beyond single-GPU prototypes.
Lightning eliminates repetitive distributed training boilerplate while keeping model code readable and portable. One known vulnerability (PYSEC-2026-3624) should be reviewed before production use, but the active maintenance status and permissive license make it a solid choice for research and production workflows.
Install
lightning on PyPI
Before you install
Low friction: pure Python wheel with 9 runtime dependencies including torch and torchmetrics. Actively maintained with recent releases; last commit 2026-08-09 and 31287 repository stars indicate ongoing development.
Requires Python >=3.10 and torch as a runtime dependency; GPU training requires CUDA-compatible hardware and drivers.
License in practice
Apache-2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install lightning
import lightning as L
import torch.nn as nn
class LitModel(L.LightningModule):
def __init__(self):
super().__init__()
self.layer = nn.Linear(10, 1)
def training_step(self, batch, batch_idx):
return self.layer(batch[0]).mean()
def configure_optimizers(self):
return torch.optim.Adam(self.parameters())
trainer = L.Trainer()
trainer.fit(model, train_dataloader)
Verify before relying
- Scope and severity of PYSEC-2026-3624 vulnerability and whether it affects typical training workflows.
- Whether the framework's abstraction overhead is acceptable for custom training loops requiring fine-grained control.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 9 packagesPyYAMLfsspeclightning-utilitiespackagingtorchtorchmetricstqdmtyping-extensionspytorch-lightning |
| Maintenance | Actively maintained 79 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,376,248 / month, #1,919 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | 1 PYSEC-2026-3624 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information Analysis |
Evidence: lightning-2.6.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “multi-gpu training automation”
- lightningLightning is a framework that organizes PyTorch code to automate…
- accelerateAccelerate abstracts away distributed training boilerplate for…
- ring-flash-attnImplements ring attention with flash attention for distributed…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also lightning-sdk · litdata · pytorch-lightning · nv-one-logger-pytorch-lightning-integration · fairscale · litserve · pytorch-forecasting · pytorch-ignite · trainer · agentlightning