跳到主要内容Skip to main content

OSS · Scene 07

训练与微调Training & Fine-tuning

把现成模型改成你自己的:从单卡 QLoRA 到多机 RLHF,先看显存、并行方式与可复现性。Turn a base model into your own: from single-GPU QLoRA to multi-node RLHF, start with VRAM, parallelism and reproducibility.

20个场景精选selected repos
适合要改模型行为、做领域适配或对齐训练的人;只做推理不用进这个场景。For people who need to change model behavior, adapt to a domain or run alignment training; inference-only work does not need this scene.适合谁Who it is for

怎么选How to choose

• 单卡 24GB 想微调 7B:先看 Unsloth。24 GB single GPU, 7B model: start with Unsloth.
• 想把微调流程固化成配置:Axolotl。Turn fine-tuning into a reproducible config: Axolotl.
• 做 DPO/PPO/GRPO 对齐:TRL 起步,规模化再看 verl / OpenRLHF。DPO/PPO/GRPO alignment: start with TRL, scale with verl / OpenRLHF.
• 要训大模型或多机:DeepSpeed、TorchTitan。Large-model or multi-node training: DeepSpeed, TorchTitan.
• MoE 本地跑不动:KTransformers 的专家卸载。MoE does not fit locally: KTransformers expert offload.
不适合:Not for: 不要为了“全参训练”而全参;多数领域适配 LoRA/QLoRA 就够,先算数据量与评测收益。Do not choose full-parameter training by default; most domain adaptation is served by LoRA/QLoRA. Estimate data volume and eval gain first.

20 个仓库repos

按上手顺序,不是按 starOrdered by onboarding, not stars
训练与微调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.

语言
Python
许可
Apache-2.0
Stars
79.8k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning先试这个Start here

LLaMA-Factory

hiyouga / LLaMA-Factory

一套配置跑通微调:LoRA、QLoRA、全参与 DPO,带 WebUI 和模型导出。One setup for fine-tuning: LoRA, QLoRA, full-parameter and DPO, with a WebUI and model export.

语言
Python
许可
Apache-2.0
Stars
76.1k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Axolotl

axolotl-ai-cloud / axolotl

一份 YAML 配置跑通微调:支持 LoRA、QLoRA、全参、DPO、GRPO 与多机训练。One YAML config for fine-tuning: LoRA, QLoRA, full-parameter, DPO, GRPO and multi-node training.

语言
Python
许可
Apache-2.0
Stars
12.7k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

PEFT

huggingface / peft

参数高效微调的标准库:LoRA、IA3、Prefix Tuning 等适配器,接 Transformers 与 Accelerate。The standard parameter-efficient fine-tuning library: LoRA, IA3, prefix tuning and other adapters, wired into Transformers and Accelerate.

语言
Python
许可
Apache-2.0
Stars
21.9k
最近推送
2026-11-20
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

ms-swift

modelscope / ms-swift

ModelScope 的微调与部署工具链:LLM、多模态模型的 LoRA/全参、DPO/GRPO、推理与评测。ModelScope’s fine-tuning and deployment stack: LoRA and full-parameter training for LLMs and multimodal models, DPO/GRPO, inference and evaluation.

语言
Python
许可
Apache-2.0
Stars
16.1k
最近推送
2026-11-20
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

TRL

huggingface / trl

Hugging Face 的强化学习与对齐训练库:SFT、DPO、PPO、GRPO、奖励模型都能接。Hugging Face's RL and alignment training library: SFT, DPO, PPO, GRPO and reward models.

语言
Python
许可
Apache-2.0
Stars
19.8k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

torchtune

meta-pytorch / torchtune

PyTorch 原生的微调配方库:可读的训练循环、FSDP、激活检查点与常用后训练配方。A PyTorch-native fine-tuning recipe library: readable training loops, FSDP, activation checkpointing and common post-training recipes.

语言
Python
许可
BSD-3-Clause
Stars
5.8k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

DeepSpeed

deepspeedai / DeepSpeed

微软的大模型训练优化库:ZeRO、Offload、混合精度与 MoE 训练,把显存与吞吐压到可用。Microsoft's large-model training library: ZeRO, offload, mixed precision and MoE training to make VRAM and throughput usable.

语言
Python
许可
Apache-2.0
Stars
43.3k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

TorchTitan

pytorch / torchtitan

PyTorch 官方的大模型训练配方:张量并行、流水并行、FSDP 与分布式检查点,按 Llama 3 路线给参考实现。PyTorch's official large-model training recipe: tensor parallelism, pipeline parallelism, FSDP and distributed checkpoints, following the Llama 3 path.

语言
Python
许可
BSD-3-Clause
Stars
5.9k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

verl

volcengine / verl

字节跳动的 RL 训练框架:面向 LLM Agent 与推理任务,支持 PPO/GRPO 与多轮工具调用。ByteDance's RL training framework for LLM agents and reasoning tasks, with PPO/GRPO and multi-turn tool use.

语言
Python
许可
Apache-2.0
Stars
24.3k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

OpenRLHF

OpenRLHF / OpenRLHF

基于 Ray + vLLM 的 RLHF 训练框架:PPO、GRPO、DPO、KTO 与多机多卡编排。A Ray + vLLM RLHF framework: PPO, GRPO, DPO, KTO and multi-node orchestration.

语言
Python
许可
Apache-2.0
Stars
10.2k
最近推送
2026-11-03
看仓库卡 →
训练与微调Training & Fine-tuning本地优先Local-first

KTransformers

kvcache-ai / ktransformers

面向异构硬件的推理/微调框架:把 MoE 专家卸载到 CPU/内存,用少量 GPU 跑大模型。Heterogeneous-hardware inference and fine-tuning: offload MoE experts to CPU/RAM so a small GPU can run large models.

语言
Python
许可
Apache-2.0
Stars
19.7k
最近推送
2026-11-13
看仓库卡 →
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

Megatron-LM

NVIDIA / Megatron-LM

NVIDIA 的大规模 Transformer 训练框架,支持张量/流水/序列/上下文并行、FP8、MoE 和分布式 checkpoint。NVIDIA’s large-scale Transformer training framework with tensor, pipeline, sequence and context parallelism, FP8, MoE and distributed checkpointing.

语言
Python
许可
NOASSERTION
Stars
18.4k
最近推送
2026-11-20
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

kohya_ss

bmaltais / kohya_ss

Stable Diffusion 系模型的训练 GUI 与脚本集合:LoRA、DreamBooth、fine-tune、数据集打标与工具,覆盖 SD1/SDXL/FLUX 等。A training GUI and script collection for Stable Diffusion models: LoRA, DreamBooth, fine-tuning, dataset tagging and utilities across SD1, SDXL and FLUX.

语言
Python
许可
Apache-2.0
Stars
12.7k
最近推送
2026-08-01
看仓库卡 →
训练与微调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.

语言
Python
许可
Apache-2.0
Stars
13.8k
最近推送
2026-11-10
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Accelerate

huggingface / accelerate

把 PyTorch 的多 GPU、TPU、混合精度、梯度累积、FSDP 与 DeepSpeed 启动样板收进一个 API:设备放置、分布式启动和混合精度不用手写。Pulls PyTorch’s multi-GPU, TPU, mixed-precision, gradient-accumulation, FSDP and DeepSpeed boilerplate into one API: device placement, distributed launch and AMP without hand-written scaffolding.

语言
Python
许可
Apache-2.0
Stars
9.9k
最近推送
2026-11-18
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Datasets

huggingface / datasets

Hugging Face 的数据集库:load_dataset 读取 Hub、Parquet、JSON、CSV,支持流式读取、内存映射、map/filter/shuffle 与 train/test split,不用先把整份语料塞进内存。Hugging Face’s dataset library: load_dataset reads Hub, Parquet, JSON and CSV with streaming, memory mapping, map/filter/shuffle and train/test splits — without loading the whole corpus into RAM.

语言
Python
许可
Apache-2.0
Stars
22.2k
最近推送
2026-11-19
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Ray

ray-project / ray

分布式计算框架:把 Python 任务与 actor 扩展到多核多机;Ray Train / Serve / Data / Tune 覆盖训练、推理、数据加载与超参搜索。A distributed compute framework: scale Python tasks and actors across cores and machines; Ray Train / Serve / Data / Tune cover training, serving, data loading and hyperparameter search.

语言
Python
许可
Apache-2.0
Stars
44.3k
最近推送
2026-11-20
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Argilla

argilla-io / argilla

人机协同的数据标注与 curation 平台:数据集、标注任务、弱监督、模型反馈与 Hugging Face Hub 集成,适合 SFT/RLHF 数据。Human-in-the-loop data annotation and curation: datasets, labeling tasks, weak supervision, model feedback and Hugging Face Hub integration for SFT/RLHF data.

语言
Python
许可
Apache-2.0
Stars
5.2k
最近推送
2026-11-16
看仓库卡 →
训练与微调Training & Fine-tuning生产可用Production

Label Studio

HumanSignal / label-studio

多模态数据标注平台:文本、图像、音频、视频、HTML 与时间序列都能用模板化界面标注;支持 ML 后端预标注、多人协作与多种导出格式。A multimodal data-labeling platform: text, image, audio, video, HTML and time series with templated interfaces; ML-backend pre-labeling, multi-user collaboration and many export formats.

语言
Python
许可
Apache-2.0
Stars
28.7k
最近推送
2026-11-20
看仓库卡 →

并排看

许可、语言、活跃度、适合 / 不适合
字段UnslothLLaMA-FactoryAxolotlPEFTms-swiftTRLtorchtuneDeepSpeedTorchTitanverlOpenRLHFKTransformersMegatron-LMkohya_ssLitGPTAccelerateDatasetsRayArgillaLabel Studio
上手层先试这个先试这个生产可用生产可用生产可用生产可用规模 / 性能规模 / 性能规模 / 性能规模 / 性能规模 / 性能本地优先规模 / 性能生产可用生产可用生产可用生产可用生产可用生产可用生产可用
语言PythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPythonPython
许可Apache-2.0Apache-2.0Apache-2.0Apache-2.0Apache-2.0Apache-2.0BSD-3-ClauseApache-2.0BSD-3-ClauseApache-2.0Apache-2.0Apache-2.0NOASSERTIONApache-2.0Apache-2.0Apache-2.0Apache-2.0Apache-2.0Apache-2.0Apache-2.0
Stars79.8k76.1k12.7k21.9k16.1k19.8k5.8k43.3k5.9k24.3k10.2k19.7k18.4k12.7k13.8k9.9k22.2k44.3k5.2k28.7k
最近推送2026-11-192026-11-192026-11-192026-11-202026-11-202026-11-192026-11-192026-11-192026-11-192026-11-192026-11-032026-11-132026-11-202026-08-012026-11-102026-11-182026-11-192026-11-202026-11-162026-11-20
适合单卡 24GB 就能微调 7B 级模型,适合个人与小团队。把数据、训练与导出收在同一套配置里,第一次微调不用拼多个库。配置驱动,实验可复现,适合把微调流程固化。只训练少量参数,显存与存储成本远低于全参微调。训练、推理、评测与部署在同一套命令里,少写胶水代码。与 transformers 生态无缝,模型、分词器、数据集直接复用。训练循环写得薄,便于读源码和改数据、损失与采样。ZeRO 分片让单机多卡能训更大模型。官方维护,和 PyTorch 新特性同步快。为 Agentic RL 设计,能把工具调用轨迹纳入训练。把推理、奖励、训练分成可扩展的 Ray actor。MoE 模型不必全部塞进显存,适合本地大模型。想理解千卡级训练怎么切模型和激活,Megatron 是事实标准,很多大模型训练栈基于它改。GUI 把复杂训练参数摊开,适合个人与小队做角色/风格 LoRA。把训练脚本拆成可读配方,适合学习与中小规模微调。单卡训练脚本加一行 launch 就能跑多卡。一行读取 Hub 数据集,版本与 schema 有记录。同一套 API 从笔记本扩到集群,不用先上 K8s。把模型预标注、人工复核和数据集版本放在一条流里。一个界面覆盖多数模态,省去多套标注工具。
不适合要做大规模预训练或多机多卡,仍应看 DeepSpeed / TorchTitan。要做超大规模预训练或多机极限吞吐,应看 Megatron 系与 TorchTitan。不想读 YAML、只想点按钮的人,应先看托管平台。需要改变模型知识边界或做大规模继续预训练,单靠适配器不够。只在 Hugging Face 生态内工作、且不需要 ModelScope 模型时,依赖会更重。只做推理或简单微调,直接用 transformers Trainer 更轻。想要开箱 WebUI 与大量现成模型模板,LLaMA-Factory 更省事。小模型单卡微调,用不到这么重的分布式栈。只想微调一个小模型,直接用 Hugging Face Trainer。只做 SFT,不需要这么重的 RL 栈。单卡小实验,直接用 TRL 更简单。追求通用、稳定的生产推理,优先 vLLM/SGLang。单卡或小集群微调;配置和并行调优门槛高,小团队用 torchtune/DeepSpeed 更轻。不是一键出图产品;数据清洗、打标与参数调试决定结果。不是大规模分布式训练平台;千卡级训练仍用 Megatron/DeepSpeed。不是完整训练框架;数据加载、实验管理和评测仍要自己搭。不是数据治理平台;许可、PII 与去重仍要自己审。不是 Kubernetes 替代;集群运维、网络与存储仍要自己做。不是标注外包服务;标注指南与质控仍要自己定。开源版与企业版功能不同,商用前读条款。