# modelscope/ms-swift

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/modelscope-ms-swift).**

12,689 stars · 1,206 forks · Python · apache-2.0

## Links

- GitHub: https://github.com/modelscope/ms-swift
- Homepage: https://swift.readthedocs.io/zh-cn/latest/
- awesome-repositories: https://awesome-repositories.com/repository/modelscope-ms-swift.md

## Topics

`deepseek-r1` `embedding` `grpo` `internvl` `liger` `llama` `llama4` `llm` `lora` `megatron` `moe` `multimodal` `open-r1` `peft` `qwen3` `qwen3-next` `qwen3-omni` `qwen3-vl` `reranker` `sft`

## Description

This project is a comprehensive toolkit designed for the full lifecycle management of large language and multimodal models. It functions as a unified orchestrator that handles the entire development process, ranging from dataset preparation and supervised fine-tuning to advanced reinforcement learning alignment and production-ready inference deployment.

The platform distinguishes itself through a specialized reinforcement learning library that supports complex optimization algorithms, including group relative policy optimization and leave-one-out techniques, to improve model instruction-following and safety. It provides extensive support for training stability through sequence-level importance sampling, token-level loss normalization, and uncertainty-based weighting, ensuring reliable policy updates during the alignment phase.

Beyond its core training capabilities, the framework integrates high-performance inference backends and model quantization to facilitate efficient production access. It supports diverse data modalities—including text, image, video, and audio—and offers a modular interface for registering custom model architectures, dialogue templates, and training callbacks. Users can manage these complex workflows through a centralized configuration system or a web-based graphical interface that simplifies task execution and performance monitoring.

## Tags

### Artificial Intelligence & ML

- [Large Language Model Fine-Tuning Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/integrated-development-platforms/machine-learning-platforms/large-language-model-fine-tuning-frameworks.md) — The platform adapts pre-trained language and multimodal models to specific tasks using various training techniques including supervised fine-tuning and parameter-efficient methods. ([source](https://swift.readthedocs.io/en/latest/Megatron-SWIFT/Quick-start.html))
- [Reinforcement Learning Alignment](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-models/reinforcement-learning-alignment.md) — The platform optimizes model performance through alignment techniques such as PPO, DPO, and GRPO to improve reasoning and instruction-following capabilities during training. ([source](https://swift.readthedocs.io/en/latest/))
- [LLM Fine-Tuning Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/training-systems/model-training-engines/llm-fine-tuning-engines.md) — A comprehensive toolkit for supervised fine-tuning, reinforcement learning, and alignment of large language and multimodal models.
- [Multimodal Training Platforms](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/integrated-development-platforms/machine-learning-platforms/multimodal-training-platforms.md) — A framework that supports the training and inference of models across text, image, video, and audio data modalities.
- [Reinforcement Learning Alignment](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-alignment.md) — Optimizes model behavior through iterative policy updates and reward-based feedback loops to improve instruction following and safety.
- [Data-Parallel Training](https://awesome-repositories.com/f/artificial-intelligence-ml/distributed-training-frameworks/data-parallel-training.md) — Scales large-scale model training across multiple hardware resources using integrated parallelization frameworks.
- [Model Training Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/training-frameworks/model-training-pipelines.md) — Coordinates the entire model lifecycle from dataset preparation and preprocessing to training, evaluation, and distribution.
- [Transformer Reinforcement Learning Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning/transformer-reinforcement-learning-libraries.md) — A platform for optimizing model alignment using PPO, DPO, GRPO, and RLOO algorithms with integrated training stability techniques.
- [Large-Scale Training Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/large-scale-training-frameworks.md) — Distributes large-scale model training across multiple hardware resources using parallel processing frameworks. ([source](https://swift.readthedocs.io/en/latest/))
- [Large Scale Training Suites](https://awesome-repositories.com/f/artificial-intelligence-ml/large-scale-training-suites.md) — Scaling large-scale model training across multiple hardware resources using parallel processing frameworks and optimized memory management.
- [Preference-Based Model Alignments](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/machine-learning-training/fine-tuning-and-alignment/preference-based-model-alignments.md) — The platform trains models using reinforcement learning by sampling multiple outputs per prompt and calculating advantages based on normalized reward statistics to improve response quality. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/REINFORCEPP.html))
- [Training Progress Monitoring](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/machine-learning-training/utilities/training-progress-monitoring.md) — The platform tracks and logs comprehensive performance statistics, including reward distributions, divergence, and entropy, to evaluate model training progress. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/GetStarted/GRPO.html))
- [High-Performance Inference Modes](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/inference-optimization/high-performance-inference-modes.md) — Serves fine-tuned models using optimized kernels and quantization for efficient production access.
- [Model Quantization Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/model-optimization/quantization/model-quantization-frameworks.md) — A training suite that optimizes memory usage and performance through model quantization and high-performance hardware-specific kernels.
- [Model Quantization](https://awesome-repositories.com/f/artificial-intelligence-ml/model-quantization.md) — The platform lowers the memory footprint and accelerates inference speeds by applying compression methods to model weights during the loading or export process. ([source](https://swift.readthedocs.io/en/latest/Instruction/Command-line-parameters.html))
- [Multimodal Training](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-training.md) — Integrates text, image, video, and audio data into training pipelines by mapping media content to model inputs. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html))
- [Reinforcement Learning Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-optimizers.md) — The platform trains models using group relative policy optimization to improve stability by calculating relative advantages within groups and incorporating divergence penalties. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/GetStarted/GRPO.html))
- [Leave-One-Out Advantage Estimators](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-optimizers/leave-one-out-advantage-estimators.md) — The platform trains models using reinforcement learning by calculating an unbiased advantage baseline through the leave-one-out technique to improve the quality of generated outputs. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/RLOO.html))
- [Training Stability Techniques](https://awesome-repositories.com/f/artificial-intelligence-ml/training-stability-techniques.md) — The platform applies a specific loss function during reinforcement learning to stabilize policy updates by constraining the divergence between current and reference model distributions. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/CISPO.html))
- [Model Performance Benchmarking](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-analysis/model-analysis/model-performance-benchmarking.md) — The platform assesses model quality using standard evaluation backends to measure accuracy and performance on specific datasets and benchmarks. ([source](https://swift.readthedocs.io/en/latest/))
- [Model Inference and Serving](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving.md) — Serving fine-tuned models for production use through high-performance backends with support for quantization and streaming interfaces.
- [Model Inference Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/engines-runtimes-servers/model-inference-servers.md) — Launches a dedicated web application for model inference that handles loading and provides a streaming interface. ([source](https://swift.readthedocs.io/en/latest/GetStarted/Web-UI.html))
- [Data Preprocessing](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/data-and-checkpointing/data-preprocessing.md) — Transforms raw data into model-ready formats using registered custom functions and standardized mapping logic.
- [Model Performance Optimization](https://awesome-repositories.com/f/artificial-intelligence-ml/model-optimization/profiling-and-benchmarking/model-performance-optimization.md) — The platform reduces memory usage and increases processing speed by applying quantization and hardware-specific kernels to improve efficiency during training and inference tasks. ([source](https://cdn.jsdelivr.net/gh/modelscope/ms-swift@main/README.md))
- [Custom Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-model-integrations.md) — Integrates external model architectures and loading logic into the pipeline via metadata definitions. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-model.html))
- [Custom Training Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-training-loops.md) — Extends core functionality by registering custom model architectures, datasets, and training callbacks for specialized research. ([source](https://swift.readthedocs.io/en/latest/))
- [Sequence Importance Sampling](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-models/reinforcement-learning-alignment/sequence-importance-sampling.md) — The platform adjusts importance sampling weights at the sequence level rather than the token level to stabilize gradient estimates and prevent training collapse during reinforcement learning. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/GSPO.html))
- [Dataset Preprocessing Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/data-ingestion-preparation/dataset-preprocessing-utilities.md) — Converts various local or remote data formats into a standardized structure for training and inference. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html))
- [Gradient Optimization Techniques](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/machine-learning-training/utilities/gradient-optimization-techniques.md) — The platform applies a temperature-controlled soft gate function to smooth gradient attenuation during off-policy training for improved model stability. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/SAPO.html))
- [Inference Acceleration Techniques](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/inference-optimization/inference-acceleration-techniques.md) — The platform speeds up the generation of text completions during reinforcement learning by integrating high-performance inference engines directly into the training loop. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/GetStarted/GRPO.html))
- [Reinforcement Learning Data Filters](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-data-filters.md) — The platform excludes responses that were forcibly truncated during generation to prevent reward noise from negatively impacting the learning process of the model. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/DAPO.html))
- [Policy Clipping](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-optimizers/policy-clipping.md) — The platform adjusts upper and lower bounds of policy update limits independently to encourage model exploration while maintaining training stability during reinforcement learning. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/DAPO.html))
- [Agentic Tool-Use Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/integration-deployment/agent-frameworks/tool-use-and-execution/agentic-tool-use-frameworks.md) — Structures training data for tool-use tasks by mapping tool definitions and interaction sequences into standardized formats. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html))
- [Reinforcement Learning Sampling](https://awesome-repositories.com/f/artificial-intelligence-ml/gradient-computation/gradient-based-sampling/reinforcement-learning-sampling.md) — The platform skips samples with uniform rewards and continues generation until a diverse batch is achieved to prevent vanishing gradients during the training process. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/DAPO.html))
- [Loss Aggregation](https://awesome-repositories.com/f/artificial-intelligence-ml/loss-function-utilities/average-loss-calculators/loss-aggregation.md) — The platform calculates training loss based on individual tokens rather than entire sentences to eliminate bias introduced by varying response lengths during training. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/DAPO.html))
- [Dataset Management Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/dataset-management/dataset-management-tools.md) — Provides access to a curated library of datasets with pre-calculated token statistics for model training. ([source](https://swift.readthedocs.io/en/latest/Instruction/Supported-models-and-datasets.html))
- [Streaming Inference Processors](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/inference-engines/streaming-inference-processors.md) — Enables incremental streaming of model responses for real-time token consumption during inference. ([source](https://swift.readthedocs.io/en/latest/Megatron-SWIFT/Quick-start.html))
- [Length Penalization](https://awesome-repositories.com/f/artificial-intelligence-ml/text-sequence-processing/sequence-length-constraints/length-penalization.md) — The platform imposes multi-stage penalties on generated outputs that exceed defined length thresholds to improve control over the size and efficiency of model responses. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/DAPO.html))
- [Loss Weight Schedulers](https://awesome-repositories.com/f/artificial-intelligence-ml/training-loop-schedulers/loss-weight-schedulers.md) — The platform adjusts the influence of supervised signals over time by decaying the balancing coefficient from a peak value to a final target value. ([source](https://swift.readthedocs.io/en/latest/Instruction/GRPO/AdvancedResearch/CHORD.html))

### Software Engineering & Architecture

- [Training Pipelines](https://awesome-repositories.com/f/software-engineering-architecture/training-pipelines.md) — The platform coordinates the entire model lifecycle, including dataset preparation, training, evaluation, quantization, and model distribution through a unified interface. ([source](https://cdn.jsdelivr.net/gh/modelscope/ms-swift@main/README.md))
- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures.md) — Extends core functionality by allowing users to register custom model architectures, reward functions, and training callbacks.

### Development Tools & Productivity

- [Machine Learning Pipelines](https://awesome-repositories.com/f/development-tools-productivity/task-pipeline-managers/machine-learning-pipelines.md) — Coordinates the entire model lifecycle including dataset preparation, training, and evaluation through a unified interface.
- [Model Training Dashboards](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/cli-task-managers/visual-task-managers/model-training-dashboards.md) — The platform configures, launches, and monitors model training and deployment tasks through a graphical interface while maintaining persistent background processes for continuous operation. ([source](https://swift.readthedocs.io/en/latest/GetStarted/Web-UI.html))
- [Configuration-Driven Orchestrators](https://awesome-repositories.com/f/development-tools-productivity/configuration-driven-orchestrators.md) — Orchestrates complex training and deployment workflows using centralized configuration files and metadata.
- [Training Visualization Interfaces](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/training-visualization-interfaces.md) — The platform displays real-time logs and performance charts including loss, accuracy, and learning rates during active training sessions within the interface. ([source](https://swift.readthedocs.io/en/latest/GetStarted/Web-UI.html))
- [Custom Preprocessing Registrations](https://awesome-repositories.com/f/development-tools-productivity/dynamic-configuration-providers/dynamic-provider-registration/custom-generation-provider-registration/custom-preprocessing-registrations.md) — Defines specialized logic for transforming raw data into model-ready formats by registering custom functions. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html))
- [Dialogue Interaction Engines](https://awesome-repositories.com/f/development-tools-productivity/interactive-execution-interfaces/dialogue-interaction-engines.md) — Configures custom conversation formats by specifying prompt structures, turn separators, and system message handling. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-model.html))

### Data & Databases

- [Dataset Configuration Systems](https://awesome-repositories.com/f/data-databases/dataset-configuration-systems.md) — Manages dataset sources, subsets, and column mappings through centralized configuration files. ([source](https://swift.readthedocs.io/en/latest/Customization/Custom-dataset.html))

### User Interface & Experience

- [Graphical User Interfaces](https://awesome-repositories.com/f/user-interface-experience/graphical-user-interfaces.md) — The platform provides a web-based dashboard for configuring and executing training and deployment tasks without writing code to lower the barrier for model development. ([source](https://cdn.jsdelivr.net/gh/modelscope/ms-swift@main/README.md))
