modelscope/ms-swift

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).

What it solves

ms-swift is a comprehensive framework designed to simplify the entire lifecycle of large language models (LLMs) and multimodal large models. It addresses the complexity of training, fine-tuning, evaluating, and deploying these models by providing a unified, scalable infrastructure that supports a vast array of model architectures and hardware configurations.

How it works

The framework provides a full-pipeline approach to model development. It integrates various lightweight fine-tuning methods (like LoRA and QLoRA) and advanced training techniques (such as Megatron parallelism and GRPO reinforcement learning) to optimize performance and memory usage. It supports a wide range of hardware, from NVIDIA GPUs to AMD GPUs and Ascend NPUs. Users can interact with the framework via a command-line interface, a Python API, or a zero-threshold Web-UI for those who prefer a graphical interface.

Who it’s for

It is built for AI researchers and developers who need to fine-tune and deploy large-scale text and multimodal models efficiently, especially those working with constrained hardware resources or those requiring high-performance distributed training.

Highlights

  • Extensive Model Support: Supports over 600 text-only and 400 multimodal large models.
  • Full-Pipeline Capabilities: Covers everything from pre-training and instruction fine-tuning to evaluation, quantization, and deployment.
  • Advanced RLHF: Built-in support for a rich family of GRPO algorithms (e.g., DAPO, GSPO, SAPO) and preference learning (DPO, KTO, ORPO).
  • Memory and Speed Optimization: Integrates Flash-Attention 2/3, GaLore, UnSloth, and Megatron parallelism (TP, PP, CP, EP) to accelerate training and reduce memory overhead.
  • Hardware Versatility: Compatible with NVIDIA, AMD, CPU, MPS, and Ascend NPU hardware.
  • Integrated Tooling: Supports inference acceleration via vLLM, SGLang, and LMDeploy, and evaluation via EvalScope.

Related

  • Project
  • Project
  • Project
  • Project
  • Project