Favicon of ms-swift

ms-swift

A local LLM training and deployment framework with LoRA, multimodal models and vLLM, SGLang or LMDeploy integration, licensed under Apache 2.0.

Screenshot of ms-swift website

ms-swift is a Python framework for developers and researchers training and deploying language and multimodal models on their own hardware. It covers model adaptation through evaluation and serving, with support for Qwen3, DeepSeek-R1, Llama4, Mistral, Qwen3-VL and InternVL3.5.

  • Fine-tuning: Train all model parameters or use lighter methods such as LoRA and QLoRA, with support for custom datasets and quantized models.
  • Preference and reinforcement learning: Use DPO for preference training or GRPO-family methods for reinforcement learning, alongside pre-training and instruction fine-tuning.
  • Multimodal and specialist models: Train multimodal models as well as embedding, reranker and sequence classification models.
  • Cluster training: Megatron supports distributed training across machines, including mixture-of-experts models.
  • Serving and quantization: Integrate inference, evaluation and deployment with vLLM, SGLang or LMDeploy, and quantize models with GPTQ, AWQ, BNB or FP8.

A Gradio web interface provides access to training and deployment, alongside Python and command-line interfaces. Hardware support includes NVIDIA GPUs through CUDA, AMD GPUs through ROCm, Apple MPS and CPUs, plus Ascend NPUs, MetaX GPUs and Moore Threads GPUs through MUSA. ms-swift is open source under Apache 2.0.

Similar to ms-swift