skillfed

ms-swift

Swift: Scalable lightWeight Infrastructure for Fine-Tuning

ms-swift v4.5.0 130.6K downloads/30d#11,635 on PyPI15,170
Permissive license Apache License 2.0 Active released

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 on this page — 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

ms-swift on PyPI

pip

pip install ms-swift

uv

uv add ms-swift

poetry

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 the current Python release (>=3.8.0)
Install friction low — pure-Python wheel
Runtime dependencies 39 — accelerate, addict, aiohttp, attrdict, binpacking, charset-normalizer, cpm-kernels, dacite, datasets, einops, fastapi, gradio, importlib-metadata, json-repair, matplotlib, modelscope, nltk, numpy, openai, oss2, pandas, peft, pillow, PyYAML, requests, rouge, safetensors, scipy, sentencepiece, simplejson
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 130,605/month — #11,635 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ms_swift-4.5.0-py3-none-any.whl

Keywords: transformers, LLM, lora, megatron, grpo, sft

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

large language model fine-tuning frameworkLLM training and deploymentmultimodal model trainingdistributed LLM trainingmodel quantization and inferenceLoRA and parameter-efficient trainingreinforcement learning for LLMs
llm-trainingdistributed-mlmodel-quantization

More Artificial Intelligence packages

Further reading