ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs
by ModelScope (Alibaba)
One CLI that takes you from LoRA on a single GPU to Megatron-parallel GRPO across a cluster, for text and multimodal models alike.
Overview
ms-swift is the ModelScope community's framework for post-training and serving large models. The documentation site splits into Get Started (installation, quick start, Web-UI), Instruction (Pre-training and Fine-tuning, Command-line parameters, Inference and deployment, Web-UI), Megatron-SWIFT, Customization and Best Practices. The training guide alone covers pre-training, supervised fine-tuning, knowledge distillation, reward modelling, sequence classification, embedding and reranker training, the preference-learning family (DPO, KTO, CPO, SimPO, ORPO, PPO) and an unusually broad GRPO lineup (GRPO, DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, Reinforce++). Parameter-efficient options documented include LoRA, QLoRA, DoRA, LongLoRA, LISA and Adapter; scaling options include DDP, device_map, DeepSpeed ZeRO-2 and ZeRO-3, FSDP and, through Megatron-SWIFT, tensor, pipeline, context, expert and sequence parallelism. Memory pages cover GaLore, Flash-Attention 2/3 and Ulysses attention. Everything is drivable three ways — `swift pt` and `swift sft` on the command line, a Gradio Web-UI, or the Python API — and a trained checkpoint hands off to vLLM, SGLang or LMDeploy to be served behind an OpenAI-compatible endpoint. Coverage is claimed at 600+ text models and 300+ multimodal models across NVIDIA, AMD MI300, Ascend NPU, Apple MPS and CPU. The project is Apache 2.0 with roughly 15.4k GitHub stars, shipped v4.0.0 in March 2026, added day-0 support for Qwen3.8-Flash-Next on 26 August 2026, and is backed by a peer-reviewed paper, 'SWIFT: A Scalable lightWeight Infrastructure for Fine-Tuning' (arXiv 2408.05517).
At a Glance
- Topic
- Fine-Tuning
- Level
- Advanced
- Format
- Documentation
- Cost
- Free
- Duration
- ~2-3 hours to a first LoRA run; several days to work through Megatron-SWIFT and the GRPO guides
- Provider
- ModelScope (Alibaba)
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Run pre-training, supervised fine-tuning and distillation from a single `swift pt` / `swift sft` command line
- ✓Choose between LoRA, QLoRA, DoRA, LongLoRA, LISA and full-parameter tuning based on your VRAM budget
- ✓Apply preference learning with DPO, KTO, CPO, SimPO, ORPO and PPO, including reward-model training
- ✓Configure the GRPO family — DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, Reinforce++ — for reinforcement fine-tuning
- ✓Scale past one node with DeepSpeed ZeRO-2/ZeRO-3, FSDP and Megatron tensor, pipeline, context and expert parallelism
- ✓Prepare custom and multimodal datasets in the framework's expected formats, including grounding and OCR tasks
- ✓Cut memory with GaLore, Flash-Attention 2/3 and Ulysses attention, and quantize during training
- ✓Serve the resulting checkpoint through vLLM, SGLang or LMDeploy behind an OpenAI-compatible API
Highlights
- •Far wider algorithm surface than Unsloth or Axolotl — eight GRPO variants and six preference-learning objectives are documented, not just LoRA and DPO
- •Megatron-SWIFT is the part you cannot get from most single-GPU-first frameworks: TP, PP, CP, EP and SP under the same CLI
- •Text and multimodal training share one interface, so a VLM run is a flag change rather than a different toolchain
- •Unusual hardware breadth for this class of tool — NVIDIA, AMD MI300, Ascend NPU, Apple MPS and CPU are all documented targets
- •Backed by a published paper (arXiv 2408.05517) and shipping day-0 support for new model families within days of release
Who It’s For
Best For
- ✓ML engineers post-training open-weight models beyond what a single-GPU LoRA script can handle
- ✓Teams doing reinforcement fine-tuning who want several GRPO variants available without writing the trainer
- ✓Practitioners fine-tuning multimodal or vision-language models alongside text models on one stack
- ✓Anyone running on Ascend NPU or AMD hardware where the NVIDIA-first frameworks are a poor fit
Prerequisites
- •Solid PyTorch and working knowledge of transformer training — this is not an introduction to fine-tuning
- •Access to at least one capable NVIDIA, AMD or Ascend accelerator; the Megatron guides assume multiple nodes
- •Familiarity with LoRA and RLHF/DPO concepts before you reach the GRPO and preference-learning pages
FAQ
What is ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs?
ms-swift is the ModelScope community's post-training framework, and its documentation doubles as a working map of modern fine-tuning practice. It is written for ML engineers who need more than a single-GPU LoRA script: pre-training, SFT, distillation, the full preference-learning family, an unusually broad GRPO lineup, and Megatron-style parallelism, all reachable from one CLI, a Gradio Web-UI or a Python API. After working through it you can fine-tune and then serve a text or multimodal model behind an OpenAI-compatible endpoint on NVIDIA, AMD or Ascend hardware.
Is ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs free?
ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs is free to access.
What level is ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs for?
ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs is aimed at a advanced audience. Recommended background: Solid PyTorch and working knowledge of transformer training — this is not an introduction to fine-tuning, Access to at least one capable NVIDIA, AMD or Ascend accelerator; the Megatron guides assume multiple nodes, Familiarity with LoRA and RLHF/DPO concepts before you reach the GRPO and preference-learning pages.
How long does ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs take?
Expect roughly ~2-3 hours to a first LoRA run; several days to work through Megatron-SWIFT and the GRPO guides. Most learners work through it at their own pace.
What will I learn from ms-swift Documentation — Fine-Tuning, RL and Deployment for 600+ LLMs and MLLMs?
You'll learn: Run pre-training, supervised fine-tuning and distillation from a single `swift pt` / `swift sft` command line; Choose between LoRA, QLoRA, DoRA, LongLoRA, LISA and full-parameter tuning based on your VRAM budget; Apply preference learning with DPO, KTO, CPO, SimPO, ORPO and PPO, including reward-model training; Configure the GRPO family — DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, Reinforce++ — for reinforcement fine-tuning; Scale past one node with DeepSpeed ZeRO-2/ZeRO-3, FSDP and Megatron tensor, pipeline, context and expert parallelism; Prepare custom and multimodal datasets in the framework's expected formats, including grounding and OCR tasks; Cut memory with GaLore, Flash-Attention 2/3 and Ulysses attention, and quantize during training; Serve the resulting checkpoint through vLLM, SGLang or LMDeploy behind an OpenAI-compatible API.
Topics
Sources
This page was written from 3 sources, 2 on domains other than swift.readthedocs.io.