implementing-llms-litgpt

Implements, fine-tunes, and deploys LLMs using LitGPT with LoRA, QLoRA, and FSDP training.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/hanasho744/codex --skill implementing-llms-litgpt-hanasho744
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implementing-llms-litgpt
Source: https://github.com/hanasho744/codex/tree/main/.agents/skills/litgpt
Command: npx skills add https://github.com/hanasho744/codex --skill implementing-llms-litgpt-hanasho744

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires litgpt, torch, transformers, and includes references (resource) components.

What problem does it solve? Training and fine-tuning large language models typically requires navigating complex abstraction layers and fragmented tooling. This Skill provides clean, single-file LLM implementations with production-ready workflows for downloading, fine-tuning, pretraining, quantizing, and deploying 20+ model architectures. ## Core Features & Use Cases - Fine-tuning with LoRA/QLoRA: Train models like Phi-2 or Llama 3 on custom JSON datasets using parameter-efficient methods that fit on consumer GPUs (8-16GB VRAM). - Pretraining and distributed training: Pretrain models from scratch with multi-GPU FSDP support and proven hyperparameter recipes. - Model deployment: Merge LoRA adapters, quantize to 4-bit, convert to GGUF, and serve models via a FastAPI endpoint. - Use Case: Fine-tune Phi-2 with LoRA on a custom Alpaca-format instruction dataset using a single 16GB GPU, then merge the adapters and deploy the model behind a REST API. ## Quick Start Use the LitGPT skill to fine-tune microsoft/phi-2 with LoRA on my custom instruction dataset and show me the training command.

Frequently Asked Questions about implementing-llms-litgpt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fine-tune Llama 3 with LoRA using LitGPT?▼

Run litgpt finetune_lora with the model name, a JSON dataset in Alpaca format, and LoRA parameters like lora_r 16 and lora_alpha 32. Training saves checkpoints to the out/finetune directory automatically.

What models does LitGPT support for fine-tuning?▼

LitGPT supports over 20 model families including Llama, Gemma, Phi, Qwen, Mistral, Mixtral, Falcon, and Pythia, ranging from 135M to 405B parameters. Run litgpt download list to see all available models.

How much GPU memory does LoRA fine-tuning require?▼

LoRA fine-tuning a 7B model requires about 16GB VRAM, while QLoRA with 4-bit quantization reduces this to around 6GB. Smaller models like Phi-2 need only 8GB with LoRA or 3GB with QLoRA.

LitGPT vs Axolotl vs HuggingFace Transformers for fine-tuning?▼

LitGPT offers clean single-file implementations ideal for understanding architectures and education. Axolotl provides more fine-tuning features with YAML configs, while HuggingFace Transformers has the broadest model support.

Why does LitGPT fine-tuning run out of memory?▼

Out of memory errors occur with full fine-tuning of large models or oversized batches. Switch to LoRA or QLoRA, reduce micro_batch_size to 1, enable gradient accumulation, or use multiple GPUs with FSDP.

Can LitGPT train models across multiple GPUs?▼

Yes, LitGPT automatically enables FSDP when devices is set above 1, sharding parameters, gradients, and optimizer states across GPUs. It supports multi-node training via SLURM or torchrun for models up to 405B parameters.