implementing-llms-litgpt
Agent skill fromOrchestra-Research/AI-Research-SKILLs
Implements and trains LLMs using Lightning AI's LitGPT with 20+ pretrained architectures (Llama, Gemma, Phi, Qwen, Mistral). Use when need clean model implementations, educational understanding of architectures, or production fine-tuning with LoRA/QLoRA. Single-file implementations, no abstraction layers.
How to install implementing-llms-litgpt
install implementing-llms-litgpt
# install the AI-Research-SKILLs pack with the skills CLI
npx skills add Orchestra-Research/AI-Research-SKILLs# or add only this skill to Claude Code: copy the folder
01-model-architecture/litgpt/
# into
~/.claude/skills/litgpt/ (all projects)
.claude/skills/litgpt/ (one project)
1# LitGPT - Clean LLM Implementations23## Quick start45LitGPT provides 20+ pretrained LLM implementations with clean, readable code and production-ready training workflows.67**Installation**:8```bash9pip install 'litgpt[extra]'10```1112**Load and use any model**:13```python14from litgpt import LLM1516# Load pretrained model17llm = LLM.load("microsoft/phi-2")1819# Generate text20result = llm.generate(21 "What is the capital of France?",22 max_new_tokens=50,23 temperature=0.724)25print(result)26```2728**List available models**:29```bash30litgpt download list31```3233## Common workflows3435### Workflow 1: Fine-tune on custom dataset3637Copy this checklist:3839```40Fine-Tuning Setup:41- [ ] Step 1: Download pretrained model42- [ ] Step 2: Prepare dataset43- [ ] Step 3: Configure training44- [ ] Step 4: Run fine-tuning45```4647**Step 1: Download pretrained model**4849```bash50# Download Llama 3 8B51litgpt download meta-llama/Meta-Llama-3-8B5253# Download Phi-2 (smaller, faster)54litgpt download microsoft/phi-25556# Download Gemma 2B57litgpt download google/gemma-2b58```5960Models are saved to `checkpoints/` directory.6162**Step 2: Prepare dataset**6364LitGPT supports multiple formats:6566**Alpaca format** (instruction-response):67```json68[69 {70 "instruction": "What is the capital of France?",71 "input": "",72 "output": "The capital of France is Paris."73 },74 {75 "instruction": "Translate to Spanish: Hello, how are you?",76 "input": "",77 "output": "Hola, ¿cómo estás?"78 }79]80```8182Save as `data/my_dataset.json`.83…
Excerpt shown under the repository's MIT license.
