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.
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-lightningRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/scientific/pytorch-lightning ~/.gemini/antigravity-cli/skills/pytorch-lightningAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
