Agent skill

Pytorch Lightning Guide

by wentorai in wentorai/research-plugins

PyTorch Lightning framework for scalable model training and research

MITAuto-check passedAI & LLM Engineering

Install Pytorch Lightning Guide

skills CLI
$ npx skills add wentorai/research-plugins --skill pytorch-lightning-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wentorai/research-plugins pytorch-lightning-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/domains/ai-ml/pytorch-lightning-guide .claude/skills/pytorch-lightning-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pytorch-lightning-guide
GitHub stars
298
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
340 words
Files
1
Skills in repo
405
Repo updated
First seen
Licence
MIT

At a glance

PyTorch Lightning framework for scalable model training and research

  • Tasks that involve Deep learning
  • SKILL.md covers Overview, Installation and Setup, Core Architecture and Advanced Research Features, plus 2 more sections
  • Calls pip and python
  • Tasks that involve Fine-tuning

What it does

Pytorch Lightning Guide is an agent skill from wentorai/research-plugins. PyTorch Lightning framework for scalable model training and research

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Deep learning and Fine-tuning. It works with PyTorch Lightning and PyTorch. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Deep learning
  • Tasks that involve Fine-tuning

Example prompts

  • “/pytorch-lightning-guide”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • lightning.ai
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pytorch Lightning Guide loads about 2k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 340 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 340 words, ~2,014 tokens.

Download SKILL.mdSave it as .claude/skills/pytorch-lightning-guide/SKILL.md (or your agent's skills folder).
name
pytorch-lightning-guide
description
PyTorch Lightning framework for scalable model training and research

PyTorch Lightning Guide

Overview

PyTorch Lightning is a deep learning framework with over 31,000 GitHub stars that provides a high-level interface for PyTorch, enabling researchers to focus on model design rather than engineering boilerplate. Developed by Lightning AI, it decouples the science (model architecture, loss functions, data processing) from the engineering (distributed training, mixed precision, gradient accumulation, checkpointing) through a structured LightningModule abstraction.

For academic researchers, Lightning eliminates the need to write repetitive training loops, device management code, and distributed training logic. You define your model, training step, and data loaders, and Lightning handles everything else -- from single GPU to multi-node distributed training, from FP32 to mixed precision, from local development to cloud deployment. This means faster iteration on research ideas with production-quality training infrastructure.

Lightning is used extensively in AI research labs and has become a standard tool for reproducible deep learning experiments. It integrates seamlessly with experiment tracking tools like Weights & Biases, MLflow, and TensorBoard, and supports all PyTorch-compatible model architectures.

Installation and Setup

bash
# Install PyTorch Lightning
pip install lightning

# Or install with specific extras
pip install lightning[extra]

# For development/research with all features
pip install lightning[all]

Lightning requires Python 3.9+ and PyTorch 2.1+. For GPU training, ensure your PyTorch installation includes CUDA support:

bash
# Check GPU availability
python -c "import torch; print(torch.cuda.is_available())"

Verify your installation:

python
import lightning as L
print(L.__version__)

Core Architecture

The LightningModule

The LightningModule is the central abstraction. It organizes your PyTorch code into clearly defined methods:

python
import lightning as L
import torch
import torch.nn.functional as F
from torch import nn

class ResearchModel(L.LightningModule):
    def __init__(self, input_dim, hidden_dim, output_dim, lr=1e-3):
        super().__init__()
        self.save_hyperparameters()
        self.encoder = nn.Sequential(
            nn.Linear(input_dim, hidden_dim),
            nn.ReLU(),
            nn.Dropout(0.2),
            nn.Linear(hidden_dim, hidden_dim),
            nn.ReLU(),
        )
        self.classifier = nn.Linear(hidden_dim, output_dim)
        self.lr = lr

    def forward(self, x):
        features = self.encoder(x)
        return self.classifier(features)

    def training_step(self, batch, batch_idx):
        x, y = batch
        logits = self(x)
        loss = F.cross_entropy(logits, y)
        acc = (logits.argmax(dim=-1) == y).float().mean()
        self.log("train_loss", loss, prog_bar=True)
        self.log("train_acc", acc, prog_bar=True)
        return loss

    def validation_step(self, batch, batch_idx):
        x, y = batch
        logits = self(x)
        loss = F.cross_entropy(logits, y)
        acc = (logits.argmax(dim=-1) == y).float().mean()
        self.log("val_loss", loss, prog_bar=True)
        self.log("val_acc", acc, prog_bar=True)

    def configure_optimizers(self):
        optimizer = torch.optim.AdamW(self.parameters(), lr=self.lr)
        scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(
            optimizer, T_max=self.trainer.max_epochs
        )
        return [optimizer], [scheduler]
The LightningDataModule

Encapsulate all data processing in a reusable LightningDataModule:

python
class ResearchDataModule(L.LightningDataModule):
    def __init__(self, data_dir, batch_size=32, num_workers=4):
        super().__init__()
        self.data_dir = data_dir
        self.batch_size = batch_size
        self.num_workers = num_workers

    def setup(self, stage=None):
        # Load and split data
        dataset = load_research_dataset(self.data_dir)
        self.train_data, self.val_data, self.test_data = random_split(
            dataset, [0.8, 0.1, 0.1]
        )

    def train_dataloader(self):
        return DataLoader(self.train_data, batch_size=self.batch_size,
                         shuffle=True, num_workers=self.num_workers)

    def val_dataloader(self):
        return DataLoader(self.val_data, batch_size=self.batch_size,
                         num_workers=self.num_workers)
The Trainer

The Trainer orchestrates everything with a rich set of configuration options:

python
trainer = L.Trainer(
    max_epochs=100,
    accelerator="gpu",
    devices=4,
    strategy="ddp",
    precision="16-mixed",
    gradient_clip_val=1.0,
    accumulate_grad_batches=4,
    callbacks=[
        L.callbacks.EarlyStopping(monitor="val_loss", patience=10),
        L.callbacks.ModelCheckpoint(monitor="val_loss", save_top_k=3),
        L.callbacks.LearningRateMonitor(),
    ],
    logger=L.loggers.WandbLogger(project="my-research"),
)

# Train the model
trainer.fit(model, datamodule=data_module)

# Test with best checkpoint
trainer.test(model, datamodule=data_module, ckpt_path="best")

Advanced Research Features

Distributed Training Strategies

Lightning supports multiple distributed training strategies out of the box:

  • DDP (Distributed Data Parallel): Standard multi-GPU training
  • FSDP (Fully Sharded Data Parallel): Memory-efficient training for large models
  • DeepSpeed: ZeRO optimization stages 1, 2, and 3
python
# FSDP for large model training
trainer = L.Trainer(
    strategy="fsdp",
    devices=8,
    precision="bf16-mixed",
)
Custom Training Loops

Override the training loop for non-standard research workflows like GANs, reinforcement learning, or meta-learning:

python
class GANModule(L.LightningModule):
    def training_step(self, batch, batch_idx):
        optimizer_g, optimizer_d = self.optimizers()

        # Train discriminator
        real_loss = self.discriminator_loss(batch, real=True)
        fake_loss = self.discriminator_loss(batch, real=False)
        d_loss = (real_loss + fake_loss) / 2
        optimizer_d.zero_grad()
        self.manual_backward(d_loss)
        optimizer_d.step()

        # Train generator
        g_loss = self.generator_loss(batch)
        optimizer_g.zero_grad()
        self.manual_backward(g_loss)
        optimizer_g.step()

    @property
    def automatic_optimization(self):
        return False
Profiling and Debugging

Built-in profiling tools help identify bottlenecks:

python
trainer = L.Trainer(
    profiler="advanced",  # or "simple", "pytorch"
    detect_anomaly=True,
    overfit_batches=10,   # Quick sanity check
)

Experiment Reproducibility

Lightning has built-in support for reproducibility, which is critical for academic research:

python
# Seed everything for reproducibility
L.seed_everything(42, workers=True)

# Hyperparameters are automatically saved
model = ResearchModel(input_dim=768, hidden_dim=256, output_dim=10)
# model.hparams is automatically populated and logged

# Checkpoints include full training state
# Resume training from a checkpoint
trainer.fit(model, ckpt_path="path/to/checkpoint.ckpt")

The save_hyperparameters() call in your module's __init__ automatically tracks all constructor arguments, making experiment comparison straightforward.

References

© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/domains/ai-ml/pytorch-lightning-guide of wentorai/research-plugins.

Open the folder on GitHubat commit bf44b3c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Pytorch Lightning Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pytorch Lightning Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pytorch Lightning Guide this skillwentorai/research-plugins2981 repos~2kAutomated safety check: PassMIT
PyTorch Lightning TrainingOrchestra-Research/AI-Research-SKILLs13k6 repos~2.3kAutomated safety check: PassMIT
Alphagenome Finetuninggenomicsxai/alphagenome-pytorch162—~1kAutomated safety check: PassApache-2.0
PyTorch Lightning Training Setupdavila7/claude-code-templates32k11 repos~1.7kAutomated safety check: PassMIT
Pytorch LightningK-Dense-AI/scientific-agent-skills48k1 repos~2.6kAutomated safety check: NotesApache-2.0
Spark Environment Setupwshobson/agents40k—~2kAutomated safety check: PassMIT

Similar skills

  • PyTorch Lightning Training

    Orchestra-Research/AI-Research-SKILLs

    Shows how to organize PyTorch training with Lightning's LightningModule and Trainer, covering validation, DDP, callbacks and learning-rate scheduling.

    13k GitHub starsUsed in 6 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Alphagenome Finetuning

    genomicsxai/alphagenome-pytorch

    Fine-tune or transfer-learn AlphaGenome-PyTorch on custom genomic data — pick a mode (linear probe, LoRA, Locon, full), train on BigWig tracks with agt finetune, use adapters, delta checkpoints…

    162 GitHub stars~1k tokensUpdated 24 days ago
    AI & LLM EngineeringAuto-check passed
  • PyTorch Lightning Training Setup

    davila7/claude-code-templates

    Organizes PyTorch training code into LightningModules, DataModules and Trainers, with multi-GPU strategies, callbacks and logging configured.

    32k GitHub starsUsed in 11 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Pytorch Lightning

    K-Dense-AI/scientific-agent-skills

    Deep learning framework (PyTorch Lightning / lightning package).

    48k GitHub starsUsed in 1 repo~2.6k tokens
    AI & LLM EngineeringAuto-check: notes
  • Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13).

    40k GitHub stars~2k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Official

    Convert existing PyTorch Lightning training code into an NVFLARE federated job using the Lightning Client API patch, local validation, and job export; use only when the request names…

    3.5k GitHub stars~3.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from wentorai/research-plugins

All 405 skills in this repo
  • Abstract Writing Guide

    wentorai/research-plugins

    Craft structured research abstracts that maximize clarity and journal acceptance

    298 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Academic Citation Manager

    wentorai/research-plugins

    Manage academic citations across BibTeX, APA, MLA, and Chicago formats

    298 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Academic Paper Summarizer

    wentorai/research-plugins

    Summarize academic papers with structured extraction of key elements

    298 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Academic Study Methods

    wentorai/research-plugins

    Evidence-based study techniques for academic learning and retention

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Academic Tone Guide

    wentorai/research-plugins

    Adjust writing tone and register for academic audiences and venues

    298 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Academic Translation Guide

    wentorai/research-plugins

    Academic translation, post-editing, and Chinglish correction guide

    298 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Questions about Pytorch Lightning Guide

What does Pytorch Lightning Guide do?

PyTorch Lightning framework for scalable model training and research. Pytorch Lightning Guide is an agent skill from wentorai/research-plugins.

When should I use Pytorch Lightning Guide?

Pytorch Lightning Guide fits situations like: tasks that involve Deep learning; tasks that involve Fine-tuning.

How do I install Pytorch Lightning Guide in Claude Code?

Run `npx skills add wentorai/research-plugins --skill pytorch-lightning-guide -a claude-code`. Or copy the skill folder (skills/domains/ai-ml/pytorch-lightning-guide in wentorai/research-plugins) into .claude/skills/pytorch-lightning-guide in your project. Claude Code loads it when a task matches its description.

How do I install Pytorch Lightning Guide in Codex?

Run `npx skills add wentorai/research-plugins --skill pytorch-lightning-guide -a codex`. Or copy the skill folder (skills/domains/ai-ml/pytorch-lightning-guide in wentorai/research-plugins) into .agents/skills/pytorch-lightning-guide in your project. Codex loads it when a task matches its description.

Can I use Pytorch Lightning Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill pytorch-lightning-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pytorch-lightning-guide, .gemini/skills/pytorch-lightning-guide, .github/skills/pytorch-lightning-guide and .opencode/skills/pytorch-lightning-guide in your project.

What does Pytorch Lightning Guide need to run?

Going by SKILL.md and its folder, Pytorch Lightning Guide needs the command-line tools its instructions call (pip and python). Our summary lists: Python 3.

Does Pytorch Lightning Guide access the network?

SKILL.md names 2 domains. As links in the text: lightning.ai and github.com. This is read from the text; nothing was executed.

Is Pytorch Lightning Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pytorch Lightning Guide use?

Pytorch Lightning Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pytorch Lightning Guide use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pytorch Lightning Guide?

Skills that share tags, products or a category with Pytorch Lightning Guide: PyTorch Lightning Training (Orchestra-Research/AI-Research-SKILLs, 13k stars), Alphagenome Finetuning (genomicsxai/alphagenome-pytorch, 162 stars), PyTorch Lightning Training Setup (davila7/claude-code-templates, 32k stars) and Pytorch Lightning (K-Dense-AI/scientific-agent-skills, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pytorch Lightning Guide?

wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.

Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.