跳到主要内容Skip to main content
训练与微调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.

16.1k stars 1815 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-20

为什么选Why choose it

  • 训练、推理、评测与部署在同一套命令里,少写胶水代码。Training, inference, evaluation and deployment share one command surface, reducing glue code.
  • 对多模态模型与中文数据配方覆盖较多。Broad coverage of multimodal models and Chinese data recipes.
  • 支持 LoRA、全参、DPO、GRPO 等常见路线,适合从实验走到服务。Supports LoRA, full-parameter training, DPO and GRPO, useful from experiment through serving.

不适合Not for

只在 Hugging Face 生态内工作、且不需要 ModelScope 模型时,依赖会更重。If you work only inside the Hugging Face ecosystem and do not need ModelScope models, the dependency footprint is heavier than necessary.
极端自定义的分布式训练仍要回到 DeepSpeed / Megatron 层。Highly custom distributed training still belongs in DeepSpeed or Megatron layers.

最小上手Minimum setup

  1. 确认目标模型是否在支持列表内,先跑官方最小示例验证环境。Confirm the target model is supported and run the official minimal example to validate the environment.
  2. 用 LoRA 在小样本上跑通训练与推理,记录数据格式与 chat template。Run LoRA training and inference on a small sample, recording the data format and chat template.
  3. 需要对齐训练时先做 SFT,再加 DPO/GRPO,并保留同一套评测题。For alignment, start with SFT, then add DPO/GRPO, keeping the same evaluation set.

依赖与成本Dependencies and cost

Python + PyTorch/CUDA;多模态训练显存更高;部分模型与数据需 ModelScope 访问。Python + PyTorch/CUDA; multimodal training needs more VRAM; some models and datasets require ModelScope access.

许可与使用边界License and usage boundaries

代码 Apache-2.0;模型、数据集与 ModelScope 上的分发条款各自独立。Code is Apache-2.0; models, datasets and distribution terms on ModelScope are separate.

开源不等于可商用: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.
  • Axolotl — 生产可用Production,一份 YAML 配置跑通微调:支持 LoRA、QLoRA、全参、DPO、GRPO 与多机训练。One YAML config for fine-tuning: LoRA, QLoRA, full-parameter, DPO, GRPO and multi-node training.

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