Lightning-AI/litgpt

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

What it solves

LitGPT 试图简化在大规模下预训练、微调和部署大型语言模型(LLM)的过程。它提供一个高性能框架,去除复杂的抽象层,让开发者能够完全控制模型实现,同时保持企业级性能。

How it works

LitGPT 从头实现了超过 20 种流行的 LLM。它使用命令行界面(CLI)执行各种工作流,例如 litgpt serve 用于部署,litgpt finetune 用于专门训练,litgpt pretrain 用于初始训练。框架通过 Flash Attention、FSDP 和量化(fp4/8/16/32)等技术优化性能,以降低 GPU 内存使用,并支持从 1 台到 1000+ 台 GPU/TPU 的扩展。

Who it’s for

它面向需要高性能、最小抽象的开发者和企业,用于训练、微调或部署 LLM,使调试和生产规模的优化更为容易。

Highlights

  • Extensive Model Support: Supports 20+ LLMs including Llama 3, Gemma 2, Phi 4, and Qwen2.5.
  • No Abstractions: Models are implemented from scratch in single files for easier debugging and better performance.
  • Scalable Training: Supports FSDP and scaling across hundreds of GPUs/TPUs.
  • Flexible Finetuning: Includes recipes for LoRA, QLoRA, and Adapter tuning.
  • Integrated Evaluation: Built-in tools to evaluate model performance on tasks like MMLU and Truthful QA.