Favicon of ms-swift

ms-swift

An open-source local LLM training framework with LoRA, multimodal support, and deployment through vLLM, SGLang or LMDeploy. Apache 2.0 licensed.

ms-swift is a Python framework for developers and researchers who want to train and deploy language or multimodal models on their own hardware. It brings fine-tuning, evaluation and model serving into one project, with support for Qwen3, DeepSeek-R1, Llama4 and Mistral, plus multimodal models such as Qwen3-VL and InternVL3.5. It's open source under Apache 2.0.

Training can update all model parameters or use methods such as LoRA and QLoRA to reduce resource needs. Beyond instruction fine-tuning, it supports pre-training, preference alignment with DPO, and reinforcement learning with GRPO. You can also train embedding and reranker models, use custom datasets, and mix text, images, video and audio in multimodal training. Agent training includes multi-turn dialogue and tool calling.

Hardware support covers NVIDIA GPUs through CUDA, AMD GPUs through ROCm, Apple MPS and CPUs, as well as Ascend NPUs and MetaX GPUs. For larger workloads, DeepSpeed, FSDP and Megatron support distributed training across machines, including mixture-of-experts models.

A Gradio web interface covers training, inference, evaluation and quantization alongside Python and command-line access. ModelScope and Hugging Face supply model and dataset downloads. For serving, ms-swift works with Transformers, vLLM, SGLang and LMDeploy and exposes OpenAI-compatible interfaces. EvalScope handles model evaluation, while quantization export supports AWQ, GPTQ, FP8 and BNB.

Similar to ms-swift