Unified framework for efficiently fine-tuning 100+ LLMs and VLMs with a zero-code CLI and Web UI.
modelscope/ms-swift
A fine-tuning, training, inference and deployment framework for 600+ large language models and 400+ multimodal models, covering SFT, DPO and GRPO.
- Stars
- 15,903
- Forks
- 1,747
- Open issues
- 601
- Last commit
- 2 hours ago
What is it?
ms-swift is a framework from the ModelScope community for fine-tuning, aligning, evaluating, quantizing and deploying large language models and multimodal models. It supports pre-training, supervised fine-tuning, preference learning such as DPO, KTO and ORPO, and a family of GRPO reinforcement learning algorithms including DAPO, GSPO and RLOO. Embedding, reranker and sequence classification tasks are also covered.
The framework offers both a command-line interface (swift sft, swift rlhf, swift infer, swift deploy) and a Gradio-based Web-UI, plus a Python API. Training can use LoRA, QLoRA, DoRA or full-parameter tuning with DeepSpeed, FSDP or Megatron parallelism (TP, PP, CP, EP). Inference and deployment can run on Transformers, vLLM, SGLang or LMDeploy, and models can be exported with AWQ, GPTQ, FP8 or BNB quantization.
Hardware support covers NVIDIA CUDA GPUs, AMD ROCm GPUs, Ascend NPU, MetaX, Moore Threads, Apple MPS and CPU. Datasets can be pulled from ModelScope or Hugging Face, or supplied as custom data.
Key features
- 01Supervised fine-tuning, pre-training, DPO/KTO/ORPO preference alignment and GRPO-family reinforcement learning.
- 02LoRA, QLoRA, DoRA and full-parameter training with DeepSpeed, FSDP and Megatron parallelism.
- 03Inference and deployment through Transformers, vLLM, SGLang or LMDeploy with an OpenAI-compatible interface.
- 04Quantization export to AWQ, GPTQ, FP8 and BNB.
- 05Command-line tools, a Gradio Web-UI and a Python API for the same workflow.
Use cases
- Fine-tuning an open-weight Qwen or Llama model on a custom instruction dataset on a single GPU.
- Training a multimodal model on image, video or audio data with independent control of its vision and language parts.
- Running GRPO reinforcement learning with vLLM acceleration for reasoning or agent tasks.
- Training embedding or reranker models for retrieval pipelines.
Things to know
- Training large models needs substantial GPU memory; the README cites about 9GB for 7B models even with quantization.
Topics
FAQ
- What is ms-swift?
- A fine-tuning, training, inference and deployment framework for 600+ large language models and 400+ multimodal models, covering SFT, DPO and GRPO. ms-swift is a framework from the ModelScope community for fine-tuning, aligning, evaluating, quantizing and deploying large language models and multimodal models. It supports pre-training, supervised fine-tuning, preference learning such as DPO, KTO and ORPO, and a family of GRPO reinforcement learning algorithms including DAPO, GSPO and RLOO. Embedding, reranker and sequence classification tasks are also covered.
- Is ms-swift free to use? What license does it have?
- ms-swift is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is ms-swift still maintained?
- Actively maintained. The last commit to ms-swift was on Oct 21, 2026.
- What can I use ms-swift for?
- Fine-tuning an open-weight Qwen or Llama model on a custom instruction dataset on a single GPU. Training a multimodal model on image, video or audio data with independent control of its vision and language parts. Running GRPO reinforcement learning with vLLM acceleration for reasoning or agent tasks. Training embedding or reranker models for retrieval pipelines.
- Where can I get ms-swift?
- The source code and installation instructions are on GitHub: https://github.com/modelscope/ms-swift
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Hugging Face library for post-training transformer language models with SFT, GRPO, DPO, KTO and reward modeling.
Python RL framework that trains multi-step LLM agents on their own experience using GRPO, with a client-server design that plugs into existing apps.
A JAX-based open-source LLM library and reference implementation for pre-training and post-training large models on Google Cloud TPUs and GPUs.
Open-source multimodal models (MiniCPM-V 4.7 and MiniCPM-o 4.5) for understanding images, video, documents and speech on local and on-device hardware.
verl is an open-source reinforcement learning training library for post-training large language models, built on the HybridFlow paper.