--- id: ms-swift version: "4.5.0" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # ms-swift — Swift: Scalable lightWeight Infrastructure for Fine-Tuning License: permissive · Maintenance: active · Downloads: 130.6K/mo ## What it is and what it does ms-swift is a comprehensive framework for training and deploying large language models and multimodal models, built by the ModelScope community. It handles the full pipeline from pre-training and fine-tuning through inference, evaluation, quantization, and deployment. The framework supports a wide range of model architectures (including Qwen, InternLM, GLM, Mistral, DeepSeek, and Llama for text; and Qwen-VL, Kimi-K3, Llava, and others for multimodal) and training tasks including supervised fine-tuning, reinforcement learning algorithms (GRPO family), preference learning (DPO, KTO, SimPO), and embedding/reranker training. The framework emphasizes efficiency and scalability through support for parameter-efficient methods (LoRA, QLoRA, DoRA, Adapter), distributed training strategies (DDP, DeepSpeed ZeRO, FSDP, Megatron), memory optimization techniques (GaLore, Flash-Attention, sequence parallelism), and quantization-aware training on BNB, AWQ, GPTQ models. It includes inference acceleration via vLLM, SGLang, and LMDeploy, provides a web UI for training and evaluation, and integrates EvalScope for model evaluation across 100+ datasets. Use it for: - Fine-tune a 7B language model on custom instruction data using LoRA with only 9GB of GPU memory via quantized training. - Train a multimodal model on mixed text, image, and video data with independent control over vision encoder, aligner, and LLM components. - Deploy a trained model with OpenAI-compatible inference endpoints using vLLM or SGLang acceleration. - Run distributed training of a mixture-of-experts model across multiple GPUs using Megatron parallelism strategies. - Evaluate a fine-tuned model against 100+ standard benchmarks using the integrated EvalScope backend. - Quantize a trained model to AWQ, GPTQ, or FP8 format for reduced memory and faster inference. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ms-swift is a framework for training, evaluating, quantizing, and deploying large language models and multimodal models at scale, supporting 600+ text models and 400+ multimodal models with distributed training and inference acceleration. Yes. ms-swift is actively maintained, permissively licensed, and offers a production-ready framework for LLM and multimodal model training and deployment. The low install friction, broad hardware support, and comprehensive feature set (distributed training, quantization, inference acceleration, evaluation) make it valuable for teams working with modern large models. No known security vulnerabilities. Install if you need end-to-end LLM training and deployment infrastructure; skip if you only need inference or a simpler fine-tuning wrapper. ## Install pip install ms-swift uv add ms-swift poetry add ms-swift ## Installing ms-swift Before you install: Low install friction with a pure-Python wheel. Active maintenance with a recent release and 15170 repository stars. Supports Python 3.8 through 3.12. The 39 runtime dependencies are substantial but typical for a comprehensive ML framework. License in practice: Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary projects. Quickstart: pip install ms-swift from swift import Swift # Framework provides training, inference, and quantization APIs # See documentation for model-specific training examples Requires Python 3.8 or later. GPU support depends on installed CUDA/ROCm libraries and hardware compatibility (A10, A100, H100, RTX, T4, V100, AMD MI300, or Ascend NPU). Verify before relying: - Exact model count claims (600+ text, 400+ multimodal) and whether Day-0 support means immediate availability or planned support - Whether 150+ built-in datasets are pre-downloaded or require separate acquisition - Memory reduction percentages for sequence parallelism techniques (Ulysses, Ring-Attention) - Training speed improvement claim of 100%+ for multimodal packing and how it is measured ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 130.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags large language model fine-tuning framework, LLM training and deployment, multimodal model training, distributed LLM training, model quantization and inference, LoRA and parameter-efficient training, reinforcement learning for LLMs, llm-training, distributed-ml, model-quantization [View on SkillFed](https://skillfed.io/packages/ms-swift) · [View on PyPI](https://pypi.org/project/ms-swift/)