ms-swift

Use PEFT or Full-parameter to CPT/SFT/DPO/GRPO 600+ LLMs (Qwen3.8, DeepSeek-V4, GLM-5.1, InternLM3, Llama4, ...) and 300+ MLLMs (Qwen3-VL, Qwen3-Omni, InternVL3

What is ms-swift?

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

Overview of ms-swift

What it is

ms-swift (Scalable lightWeight Infrastructure for Fine-Tuning) is a large model and multimodal large model fine-tuning and deployment framework provided by the ModelScope community. It supports training (pre-training, fine-tuning, human alignment), inference, evaluation, quantization, and deployment for 600+ text-only large models and 400+ multimodal large models. Large models include Qwen3, Qwen3.5, InternLM3, GLM4.5, Mistral, DeepSeek-R1, Llama4, etc. Multimodal large models include Qwen3-VL, Qwen3-Omni, Kimi-K3, Llava, InternVL3.5, MiniCPM-V-4, Ovis2.5, GLM4.5-V, DeepSeek-VL2, etc.

Key features

  • Supports 600+ text-only large models and 400+ multimodal large models from training to deployment full pipeline, with Day-0 support for popular models.
  • Built-in 150+ datasets for pre-training, fine-tuning, human alignment, multimodal and various other tasks, with support for custom datasets.
  • Supports lightweight fine-tuning methods such as LoRA, QLoRA, DoRA, LoRA+, LLaMAPro, LongLoRA, LoRA-GA, ReFT, RS-LoRA, Adapter, LISA, etc.
  • Supports distributed training technologies including DDP, DeepSpeed ZeRO2/ZeRO3, FSDP/FSDP2, and Megatron (TP/PP/SP/CP/ETP/EP/VPP).
  • Built-in rich GRPO family algorithms for reinforcement learning, including GRPO, DAPO, GSPO, SAPO, CISPO, CHORD, RLOO, Reinforce++, etc.
  • Supports inference acceleration engines Transformers, vLLM, SGLang, and LmDeploy, providing OpenAI interfaces.
  • Supports model quantization using GPTQ, AWQ, BNB, and FP8 technologies.

Use cases

ms-swift is used for pre-training and instruction fine-tuning of large language models and multimodal large models, human alignment through preference learning (DPO, KTO, RM, CPO, SimPO, ORPO, etc.), reinforcement learning with GRPO family algorithms, embedding and reranker tasks, sequence classification, model evaluation with 100+ evaluation datasets, and model quantization for deployment. It also supports agent training with Agent templates and multimodal packing technology to improve training speed.

Getting started

See the repository README for installation instructions.

License and pricing

The license is Apache-2.0. The project is open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/modelscopems-swift.svg)](https://yunodb.com/tools/modelscopems-swift?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/modelscopems-swift?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/modelscopems-swift.svg" alt="Featured on YunoDB" height="20"></a>