Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

pytorch-lightning

Skill by davila7

Gives an AI assistant guidance on building and training neural networks with PyTorch Lightning. It covers LightningModules, Trainer setup for multi-GPU and TPU, data modules, callbacks, logging and distributed training. Aimed at developers who scale PyTorch training.

  • Score 94
  • 34k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install pytorch-lightning

Built from the published package, never by AI.

git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/pytorch-lightning ~/.claude/skills/pytorch-lightning

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install pytorch-lightning in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Pytorch-lightning is a skill that gives an AI assistant guidance on PyTorch Lightning, a deep learning framework that organizes PyTorch code to reduce boilerplate. It covers LightningModules with six sections, Trainer configuration for multi-GPU and TPU training, LightningDataModules, callbacks such as ModelCheckpoint and EarlyStopping, and logging to TensorBoard, Weights and Biases, MLflow, Neptune, Comet and CSV.

Distributed training is covered with DDP, FSDP and DeepSpeed, and the skill suggests a strategy based on model size: DDP for models under 500M parameters and FSDP for 500M and above. Reference files in the skill hold detailed docs for each component, and templates are provided for modules, data modules and Trainer setups. It is aimed at developers who build, train or scale neural networks with PyTorch Lightning.

Written from the project's SKILL.md and checked against it.

What it can do

  • LightningModule model definitionOrganizes PyTorch models into six sections, from initialization to configure_optimizers.
  • Trainer automationAutomates the training loop, device management, gradient operations and callbacks.
  • LightningDataModuleEncapsulates data preparation, dataset setup and DataLoaders in one reusable class.
  • CallbacksAdds training logic such as ModelCheckpoint, EarlyStopping, LearningRateMonitor and BatchSizeFinder.
  • Experiment loggingLogs metrics to TensorBoard, Weights and Biases, MLflow, Neptune, Comet or CSV.
  • Distributed trainingConfigures DDP, FSDP or DeepSpeed strategies for training on multiple devices.
  • Best practices guidanceCovers device-agnostic code, hyperparameter saving, seed_everything and fast_dev_run debugging.

Try asking

  • Organize my PyTorch model into a LightningModule with training and validation steps
  • Set up a Trainer for 4 GPUs using DDP or FSDP based on my model size
  • Add ModelCheckpoint and EarlyStopping callbacks to my Lightning training script

Good to know

  • The source does not state version or environment requirements.
  • Strategy guidance is based on the model size thresholds given in the skill.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: cli-tool/components/skills/scientific/pytorch-lightning/SKILL.md, cli-tool/components/skills/scientific/pytorch-lightning/scripts/quick_trainer_setup.py, cli-tool/components/skills/scientific/pytorch-lightning/scripts/template_datamodule.py, cli-tool/components/skills/scientific/pytorch-lightning/scripts/template_lightning_module.py. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md6 KB
  • references/best_practices.md16 KB
  • references/callbacks.md15 KB
  • references/data_module.md14 KB
  • references/distributed_training.md14 KB
Show all 11 files
  • references/lightning_module.md13 KB
  • references/logging.md14 KB
  • references/trainer.md14 KB
  • scripts/quick_trainer_setup.py13 KB
  • scripts/template_datamodule.py9 KB
  • scripts/template_lightning_module.py6 KB

Alternatives to pytorch-lightning

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

pytorch-lightning: common questions

Which distributed strategy does the skill recommend?

It suggests DDP for models under 500M parameters and FSDP for models 500M and above. It also lists DeepSpeed for cutting-edge features and fine-grained control.

Which loggers does it support?

It lists TensorBoard as the default, plus Weights and Biases, MLflow, Neptune, Comet and CSV.

How can I test a Lightning setup quickly?

The skill suggests Trainer(fast_dev_run=True) to test with one batch.

How do I install pytorch-lightning?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is pytorch-lightning free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is pytorch-lightning safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to pytorch-lightning?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

pytorch-lightning Install

Add to stack

Loading.