Litgpt logo

Litgpt

Free

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

FreeFree tier
Inputs: textOutputs: text
Type
Open Source
Company
Lightning AI

About Litgpt

LitGPT is an open-source library from Lightning AI that provides from-scratch implementations of 20+ high-performance large language models (LLMs) with recipes to pretrain, finetune, and deploy them at scale. It emphasizes minimal abstractions, full control, and optimized performance, supporting Flash Attention, FSDP, LoRA/QLoRA/Adapter, and mixed precision (fp4/8/16/32). The library is beginner-friendly yet scales from a single GPU to thousands of GPUs/TPUs, making it suitable for both research and production deployment. All models are Apache 2.0 licensed for unlimited enterprise use.

Key Features

From-scratch implementations with no abstractions
Beginner-friendly design with full control
Flash Attention support
FSDP (Fully Sharded Data Parallel) for distributed training
LoRA, QLoRA, and Adapter fine-tuning methods
Mixed precision training (fp4, fp8, fp16, fp32)
Scalable from 1 to 1000+ GPUs/TPUs
20+ supported LLMs including Llama, Code Llama, Qwen, Phi, Gemma
Quantization for reduced GPU memory usage
Optimized for fast inference and production deployment

Pros & Cons

Pros
  • Open source and free under Apache 2.0 license
  • No abstraction layers, making debugging and customization straightforward
  • Optimized for performance and cost reduction
  • Supports a wide range of LLMs and fine-tuning techniques
  • Scalable from single GPU to enterprise-grade clusters
  • Beginner-friendly with complete code examples
Cons
  • Requires manual setup and configuration compared to managed services
  • Optimal performance requires GPU hardware (though low-memory GPUs supported)
  • Limited to the PyTorch ecosystem

Best For

Pretraining large language models from scratchFine-tuning LLMs on custom datasetsDeploying LLMs for inference at scaleResearch and experimentation with LLM architecturesPrototyping and iterating on model training recipes

FAQ

What models does LitGPT support?
LitGPT supports over 20 LLMs including Llama 3/3.1/3.2/3.3, Code Llama, CodeGemma, Gemma 2, Phi 4, Qwen2.5, Qwen2.5 Coder, R1 Distill Llama, and others. A full list is available in the repository.
Is LitGPT free to use?
Yes, LitGPT is open source and free to use under the Apache 2.0 license, granting unlimited enterprise use.
Can I run LitGPT without a GPU?
LitGPT is optimized to run on low-memory GPUs and supports quantization, but a GPU is recommended for acceptable performance. The library is designed to minimize memory usage.