跳到主要内容Skip to main content
训练与微调Training & Fine-tuning生产可用Production

LitGPT

Lightning-AI / litgpt

Lightning AI 的轻量 LLM 训练、微调与部署配方:20+ 模型,支持 pretrain、SFT、LoRA、量化与推理,强调单卡可跑与可读代码。Lightning AI’s lightweight recipes for LLM training, fine-tuning and deployment: 20+ models, pretraining, SFT, LoRA, quantisation and inference, with an emphasis on single-GPU runs and readable code.

13.8k stars 1549 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-10

为什么选Why choose it

  • 把训练脚本拆成可读配方,适合学习与中小规模微调。Recipes are readable and modifiable.
  • 支持多种模型与 LoRA/量化,不必上重型框架。Covers pretraining, SFT, LoRA and quantisation.
  • 单卡就能跑通,实验迭代快。Designed to run on a single GPU where possible.

不适合Not for

不是大规模分布式训练平台;千卡级训练仍用 Megatron/DeepSpeed。You need a large-scale multi-node training framework.
部分新模型支持滞后,需看版本。You want a no-code fine-tuning product.
配方多,参数与数据格式要按模型逐项核对。配方多,参数与数据格式要按模型逐项核对。

最小上手Minimum setup

  1. pip install litgpt;下载一个小模型(如 Llama 3.2 1B 或 Gemma)。Run the smallest SFT recipe on one GPU.
  2. 跑一次 chat 推理,再用公开小数据集做 LoRA。Record memory, throughput and evaluation scores.
  3. 导出合并权重,测困惑度与显存。Try LoRA and compare quality with full fine-tuning.

依赖与成本Dependencies and cost

Python + PyTorch;单卡 GPU 起;模型权重;训练数据。Check runtime, model weights and external service dependencies in the README.

许可与使用边界License and usage boundaries

Apache-2.0;模型权重与数据集另计。Code is Apache-2.0; model weights, training data and generated content may have separate terms — check each before commercial use.

开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

替代与相邻Alternatives and neighbors

  • LLaMA-Factory — 先试这个Start here,一套配置跑通微调:LoRA、QLoRA、全参与 DPO,带 WebUI 和模型导出。One setup for fine-tuning: LoRA, QLoRA, full-parameter and DPO, with a WebUI and model export.
  • Unsloth — 先试这个Start here,QLoRA/LoRA 微调加速:用 Triton 内核把 7B–70B 模型的显存占用和训练时间压下来。Accelerated QLoRA/LoRA fine-tuning: Triton kernels cut VRAM use and training time for 7B–70B models.
  • torchtune — 规模 / 性能Scale / performance,PyTorch 原生的微调配方库:可读的训练循环、FSDP、激活检查点与常用后训练配方。A PyTorch-native fine-tuning recipe library: readable training loops, FSDP, activation checkpointing and common post-training recipes.

下一步Next steps

  • 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
  • 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.

GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.