litgpt

Lightning-AI/litgpt

20+ high-performance LLMs with recipes to pretrain, finetune and deploy at scale.

13k
Stars
1.5k
Forks
266
Open issues
118
Watchers
Python Apache-2.0Last pushed Jul 6, 2026

20+ high-performance LLMs with recipes to pretrain, finetune and deploy at scale.

Categories

Tags

Similar tools

Install

pip install litgpt

README

⚡ LitGPT

20+ high-performance LLMs with recipes to pretrain, finetune, and deploy at scale.

✅ From scratch implementations      ✅ No abstractions         ✅ Beginner friendly
   ✅ Flash attention                   ✅ FSDP                    ✅ LoRA, QLoRA, Adapter
✅ Reduce GPU memory (fp4/8/16/32)   ✅ 1-1000+ GPUs/TPUs       ✅ 20+ LLMs         

Quick startModelsFinetuneDeployAll workflowsFeaturesRecipes (YAML)Lightning AITutorials

 

Get started

 

Looking for GPUs?

Over 340,000 developers use Lightning Cloud - purpose-built for PyTorch and PyTorch Lightning.

Finetune, pretrain, and inference LLMs Lightning fast ⚡⚡

Every LLM is implemented from scratch with no abstractions and full control, making them blazing fast, minimal, and performant at enterprise scale.

Enterprise ready - Apache 2.0 for unlimited enterprise use.
Developer friendly - Easy debugging with no abstraction layers and single file implementations.
Optimized performance - Models designed to maximize performance, reduce costs, and speed up training.
Proven recipes - Highly-optimized training/finetuning recipes tested at enterprise scale.

 

Quick start

Install LitGPT

pip install 'litgpt[extra]'

Load and use any of the 20+ LLMs:

from litgpt import LLM

llm = LLM.load("microsoft/phi-2")
text = llm.generate("Fix the spelling: Every fall, the family goes to the mountains.")
print(text)
# Corrected Sentence: Every fall, the family goes to the mountains.

 

✅ Optimized for fast inference
✅ Quantization
✅ Runs on low-memory GPUs
✅ No layers of internal abstractions
✅ Optimized for production scale

Advanced install options

Install from source:

git clone https://github.com/Lightning-AI/litgpt
cd litgpt
# if using uv
uv sync --all-extras
# if using pip
pip install -e ".[extra,compiler,test]"

Explore the full Python API docs.

 


Choose from 20+ LLMs

Every model is written from scratch to maximize performance and remove layers of abstraction:

ModelModel sizeAuthorReference
Llama 3, 3.1, 3.2, 3.3