Model or dataset
modelscope/ms-swift avatar
modelscope/ms-swift

ms-swift: A ModelScope Toolkit for Fine-Tuning and RL on 600+ LLMs and 400+ MLLMs

Use PEFT or Full-parameter to CPT/SFT/DPO/GRPO 600+ LLMs (Qwen3.6, DeepSeek-V4, GLM-5.1, InternLM3, Llama4, ...) and 300+ MLLMs (Qwen3-VL, Qwen3-Omni, InternVL3.5, Ovis2.5, GLM4.5v, Gemma4, Llava, Phi4, ...) (AAAI 2025).

15,636 stars1,680 forksPythonApache-2.0

At a glance

What is it?
ms-swift is a Python framework from ModelScope that covers pre-training, SFT, preference learning, GRPO-family RL, evaluation, and deployment for a broad catalog of text and multimodal models. It stands out for its breadth of supported algorithms and hardware, but its documentation and release cadence demand careful verification before adoption.
Who is it for?
Adopt ms-swift if you need a single toolkit to fine-tune or run reinforcement learning across many Qwen, Llama, GLM, and multimodal models, especially if you are already in the ModelScope ecosystem or require Megatron parallelism for MoE training. Do not adopt it if you need stable, deeply documented production support for a narrow set of models, or if you cannot tolerate frequent releases (v4.5.3 one day after v4.5.2) and a README that points to Chinese-first docs.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What ms-swift actually covers

ms-swift is a training and deployment framework for large language models and multimodal large models. The README claims support for 600+ text-only models and 400+ multimodal models, including Qwen3, Qwen3.5, InternLM3, GLM4.5, DeepSeek-R1, Llama4, Qwen3-VL, Qwen3-Omni, InternVL3.5, Ovis2.5, GLM4.5-V, and others. It is not a single-purpose trainer. It covers pre-training (CPT), supervised fine-tuning (SFT), human alignment via DPO, KTO, RM, CPO, SimPO, ORPO, and reinforcement learning with a broad GRPO family: GRPO, DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, and Reinforce++. It also handles embedding, reranker, and sequence classification tasks. The intended user is an engineer or researcher who needs to fine-tune or align a model from a wide catalog without switching between many separate tools. The project is from the ModelScope community, and it integrates tightly with ModelScope's model hub, though it also works with PyTorch and Hugging Face conventions.

The architecture: from data to deployment in one pipeline

The framework is built as a full pipeline. It accepts custom datasets or 150+ built-in datasets for pre-training, fine-tuning, and alignment. The training core supports lightweight methods like LoRA, QLoRA, DoRA, LoRA+, LLaMAPro, LongLoRA, LoRA-GA, ReFT, RS-LoRA, Adapter, and LISA. It also supports full-parameter training. For memory reduction, it integrates GaLore, Q-Galore, UnSloth, Liger-Kernel, Flash-Attention 2/3, and sequence parallelism techniques like Ulysses and Ring-Attention. For distributed training, it offers DDP, device_map, DeepSpeed ZeRO2/ZeRO3, FSDP/FSDP2, and Megatron with TP, PP, SP, CP, ETP, EP, and VPP strategies. That Megatron support is notable because it explicitly targets MoE model training speed. The pipeline does not stop at training. It includes inference acceleration via Transformers, vLLM, SGLang, and LMDeploy, an OpenAI-compatible interface, evaluation through EvalScope with 100+ datasets, and quantization export to AWQ, GPTQ, FP8, and BNB. The README also mentions a Web-UI for training, inference, evaluation, and quantization. That is a wide surface, and the trade-off is that no single part is described in depth in the README.

How to get it running: commands and config keys

The README does not show explicit installation commands in the English excerpt, but it references PyPI as ms-swift and lists Python 3.12, PyTorch >= 2.0, and modelscope >= 1.23 as requirements. The typical installation would be pip install ms-swift, but that is not stated verbatim in the provided material. The documentation link is https://swift.readthedocs.io/en/latest/ for English and the Chinese version is at https://swift.readthedocs.io/zh-cn/latest/. The README says users only need to prepare datasets for one-click training, implying a CLI or Python API exists, but the exact commands are not in the excerpt. The README mentions 'Web-UI interface' for training, which suggests a graphical entry point. For actual configuration keys, the README does not list any. This is a gap in the material. If you adopt ms-swift, you must consult the documentation for concrete CLI examples and config files. The release notes for v4.5.3, v4.5.2, and v4.5.0 are dated September and August 2026, so the project is actively maintained. The lack of inline examples in the README is a real friction point for new users.

Reinforcement learning: a rich but complex menu

One of ms-swift's strongest claims is its support for many GRPO-family algorithms. The README lists GRPO, DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, and Reinforce++. It also says the framework supports synchronous and asynchronous vLLM engine inference acceleration, extensible reward functions, multi-turn inference schedulers, and environments through plugins. That is a substantial RL toolkit. However, the README does not explain the differences between these algorithms or when to use one over another. For an engineer, choosing between DAPO and SAPO without guidance is risky. The documentation might cover it, but the README does not. The framework also supports agent training with templates that allow one dataset to be used across different models. That is useful for RL environments. The complexity is real: running RL with a vLLM engine, custom reward functions, and multi-turn schedulers requires a deeper understanding than the README provides. The project's value in RL is high, but the learning curve is steep.

Multimodal and hardware support: broad but with caveats

ms-swift claims support for multimodal packing to improve training speed by over 100%, and mixed modality training with text, images, video, and audio. It also allows independent control of the vision encoder (vit), aligner, and LLM parts. That level of control is uncommon and valuable for multimodal research. On hardware, the README lists A10/A100/H100, RTX series, T4/V100, AMD GPU (MI300 series), CPU, MPS, and Ascend NPU. It also claims quantized training on BNB, AWQ, GPTQ, AQLM, HQQ, and EETQ, requiring only 9GB for 7B models. Those are concrete numbers, but they are claims from the README, not from independent benchmarks. The breadth of hardware support is a differentiator, especially the inclusion of domestic hardware like Ascend NPU, which is rare in Western-focused frameworks. The caveat is that supporting many hardware backends often means that not every feature works on every backend. The README does not specify which training methods or parallelism strategies are available on which hardware. You must verify that against the documentation.

Limitations and wrong-tool cases

The most obvious limitation is documentation depth. The README is a feature list, not a guide. It points to external docs, but the English documentation is secondary to the Chinese version. For non-Chinese readers, that is a barrier. The project is also moving fast: v4.5.3 was released on September 8, 2026, one day after v4.5.2 on September 7, and v4.5.0 on August 14. That release cadence suggests rapid iteration, which can mean breaking changes or unstable APIs. If you need a stable, long-term supported training stack, this may be the wrong tool. Another limitation is the sheer scope. The framework tries to cover training, inference, evaluation, quantization, and deployment across hundreds of models. That ambition can lead to shallow support in any single area. For example, if you only need to fine-tune Llama 3.1 8B with QLoRA, you might be better served by a simpler, more focused tool like Hugging Face TRL. ms-swift is the wrong choice if you need a minimal dependency footprint or if your organization has strict requirements around model hub integration, because the framework is deeply tied to ModelScope.

Alternatives: TRL and Axolotl take different paths

A direct alternative is Hugging Face TRL. TRL focuses on SFT, DPO, and PPO, and it is tightly integrated with the Transformers ecosystem. It does not claim support for hundreds of models or multimodal packing. Its approach is modular: you bring your own model and dataset, and it provides trainer classes. ms-swift, by contrast, is a monolithic pipeline with its own dataset handling, inference engines, and quantization. Another alternative is Axolotl, which is a configuration-driven fine-tuning framework that supports SFT and DPO on a range of open models. Axolotl uses YAML config files and is known for reproducibility. It does not cover RL as broadly as ms-swift. The key difference is that ms-swift aims to be an end-to-end platform with a Web-UI and RL algorithms, while TRL and Axolotl are more focused on training loops. If you need GRPO variants or Megatron parallelism, ms-swift's approach is more integrated. If you need a simple, well-documented training run, TRL or Axolotl may be easier to start with.

Maintenance, license, and upgrade cost

The project is licensed under Apache-2.0, which is permissive and allows commercial use and modification. That is a positive for adoption. The repository is not archived, and the last push was September 9, 2026, with releases as recent as September 8. That indicates active maintenance. The upgrade cost is non-trivial. With three minor releases in less than a month, you will likely need to track changes frequently. The README does not include a changelog or migration guide in the excerpt. The documentation site is the only place to find release notes. The project also depends on modelscope, which may be an additional dependency you do not want. The maintenance burden is not just on the project but on you: you must verify that your training scripts and configs remain compatible with each new version. The README mentions 'Day-0 support for popular models', which means the project prioritizes being current with new model releases, but that also means it may break backward compatibility. For a production environment, you should pin a specific version and test upgrades in a staging environment.

Editorial conclusion

Adopt ms-swift if you need a single toolkit to fine-tune or run reinforcement learning across many Qwen, Llama, GLM, and multimodal models, especially if you are already in the ModelScope ecosystem or require Megatron parallelism for MoE training. Do not adopt it if you need stable, deeply documented production support for a narrow set of models, or if you cannot tolerate frequent releases (v4.5.3 one day after v4.5.2) and a README that points to Chinese-first docs. Before committing, verify that your exact model and training task appear in the supported list, check the documentation for the specific algorithm you plan to use (e.g., DAPO vs. GRPO), and test on a small run with your own dataset to confirm the data format and the Web-UI workflow match your expectations. The framework's value is real but conditional on your ability to navigate its rapid evolution.

Official sources

  1. License: Apache-2.0
  2. modelscope/ms-swift on GitHub
  3. Project website
  4. README
  5. Releases
Community notes

Community notes