跳到主要内容Skip to main content
训练与微调Training & Fine-tuning先试这个Start here

Unsloth

unslothai / unsloth

QLoRA/LoRA 微调加速:用 Triton 内核把 7B–70B 模型的显存占用和训练时间压下来。Accelerated QLoRA/LoRA fine-tuning: Triton kernels cut VRAM use and training time for 7B–70B models.

79.8k stars 7447 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-19

为什么选Why choose it

  • 单卡 24GB 就能微调 7B 级模型,适合个人与小团队。Fine-tune a 7B-class model on a single 24 GB GPU, suitable for individuals and small teams.
  • 现成 notebook 与配方多,第一次微调不用从零写训练循环。Many ready-made notebooks and recipes; your first fine-tune does not require writing a training loop from scratch.
  • 与 Hugging Face 生态兼容,导出后可直接接 vLLM / Ollama。Compatible with the Hugging Face ecosystem; export feeds directly into vLLM / Ollama.

不适合Not for

要做大规模预训练或多机多卡,仍应看 DeepSpeed / TorchTitan。For large-scale pretraining or multi-node training, look at DeepSpeed / TorchTitan instead.
需要官方支持的新架构,可能要等内核适配。New architectures may need to wait for kernel support.

最小上手Minimum setup

  1. 确认 GPU 显存与 CUDA 版本,按官方 notebook 选 7B 4bit 配方。Check GPU VRAM and CUDA version; pick the official 7B 4-bit recipe.
  2. 准备 100–500 条领域样本,先跑 1 个 epoch 看 loss 与显存峰值。Prepare 100–500 domain samples and run one epoch to watch loss and peak VRAM.
  3. 导出 LoRA 适配器,用同一组评测题对比基座,确认不是只学会了口头禅。Export the LoRA adapter and compare against the base model on the same eval set; make sure it learned more than a catchphrase.

依赖与成本Dependencies and cost

Python + PyTorch/CUDA;显存取决于模型与序列长度;需要 Hugging Face 权重访问。Python + PyTorch/CUDA; VRAM depends on model and sequence length; needs Hugging Face weight access.

许可与使用边界License and usage boundaries

代码 Apache-2.0;模型权重与数据集另有许可,商用前逐项核对。Code is Apache-2.0; model weights and datasets carry their own licenses — 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

  • Axolotl — 生产可用Production,一份 YAML 配置跑通微调:支持 LoRA、QLoRA、全参、DPO、GRPO 与多机训练。One YAML config for fine-tuning: LoRA, QLoRA, full-parameter, DPO, GRPO and multi-node training.
  • TRL — 生产可用Production,Hugging Face 的强化学习与对齐训练库:SFT、DPO、PPO、GRPO、奖励模型都能接。Hugging Face's RL and alignment training library: SFT, DPO, PPO, GRPO and reward models.

下一步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.