MS-SWIFT 5 / BUILT ON TWINKLE

Meet MS-SWIFT 5

An all-in-one large-model training framework with day-0 support and a complete training toolchain out of the box.

Quick start
GitHub
START BUILDINGPython
pip install -U "ms-swift>5.0.0"

Requires a published version > 5.0.0. For the current development version, install from source.

Open source · CLI · Code API · WebUI · 5.0.0.dev

A sample of day-0 supported models

QwenDeepSeekGLMKimiMiniMaxGemma
NEWS

ms-swift 5.0 is released: one CLI for the transformers / Megatron / unsloth backends and the local / Ray / remote modes, the swift.dev code API, Agentic RL with sandboxes and external harnesses, remote training on twinkle-server (ModelScope and Tinker hosted), and the new TrainBench WebUI. For release notes, please refer to here. Existing 4.x scripts keep running with USE_SWIFT_V5=0; see Swift 5 and Swift 4.

MS-SWIFT × TWINKLE

Capabilities

MS-SWIFT handles model and data adaptation, config and training recipes; twinkle provides the training loop, sampling, Ray execution and twinkle-server components.

Model ecosystem

Day-0 support for new models

998 models for language, multimodal, embedding and reranker training.

QwenDeepSeekGLMGemmaLlama
Documentation — Day-0 support for new models
Training & alignment

Training methods

Pre-training, SFT, preference alignment, online RL and distillation share one CLI and config; Agentic training and multiple task heads included.

PTSFTDPOGRPOGKDAgentic
Documentation — Training methods
Hardware flexibility

Multiple hardware backends

NVIDIA GPUs, Ascend NPUs and more hardware platforms, with Transformers and Megatron backends and several parallelism options.

CUDAAscend NPUHFMegatron
Documentation — Multiple hardware backends
Own your training loop

Customizable training

The CLI works out of the box and composes with Config and code APIs; loss, reward, data and templates are customizable without rewriting the training stack.

CLIConfigCode APIPlugins
Documentation — Customizable training
Local code · remote compute

Remote training with the same command

Connect to a remote training service (twinkle-server) with --mode remote; the driver stays local while training runs on the remote cluster, with the same CLI and config.

RayRemotetwinkle-server
Documentation — Remote training with the same command
The complete toolchain

Complete toolchain

Benchmark evaluation, quantization, inference and deployment commands, with composable twinkle components covering the full workflow.

EvalScopevLLMSGLangQuantization
Documentation — Complete toolchain
TRAINBENCH

TrainBench visual workbench

TrainBench manages training jobs from a web UI, composes workflows on a drag-and-drop canvas and runs experiments automatically with AutoResearch.

TrainingWorkflowAutoResearch
TrainBench docs
TrainBenchWORKBENCH
MS-SWIFT WebUI interface
Agentic RLASYNC DATAFLOW
Asynchronous RL dataflow: concurrent samples, a ready queue and overlapping sampling and training, with driver, actor and remote-service labels
ASYNCHRONOUS RL

Efficiency-first asynchronous RL

StreamingDriver schedules samples independently, queues fully scored groups and overlaps sampling with training on the previous batch. A bounded window and policy-version limits control data freshness and reduce waiting; the same components run on Ray or a remote training service.

StreamingDriverAgenticRay / Remote training service
Explore asynchronous RL
PERFORMANCE & REGRESSION

Reliability and performance

GRPO throughput, multi-node 122B MoE training, and training-result comparisons with v4, all from completed runs.

Results
COMMUNITY & CITATION

Community and citation

Discuss issues and training methods on GitHub; the Discord and WeChat entries sit in the top-right corner. Cite the paper below when using MS-SWIFT in research.

Cite MS-SWIFT
View citation
@misc{zhao2024swiftascalablelightweightinfrastructure,
      title={SWIFT:A Scalable lightWeight Infrastructure for Fine-Tuning},
      author={Yuze Zhao and Jintao Huang and Jinghan Hu and Xingjun Wang and Yunlin Mao and Daoze Zhang and Zeyinzi Jiang and Zhikai Wu and Baole Ai and Ang Wang and Wenmeng Zhou and Yingda Chen},
      year={2024},
      eprint={2408.05517},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2408.05517},
}
MS-SWIFT × TWINKLE

Open-source, composable large-model training.

ModelScope