Skip to content
Back to skills

Ms Swift

ASecurity

"Use ms-swift for LLM and multimodal training, inference,

  • 247 stars
  • 0 votes
  • 1 copy
  • 8 views
  • Added September 8, 2026
devopspythongoswiftshellapibackendperformance

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill ms-swift --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ms Swift?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ms Swift
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-ms-swift/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-ms-swift)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ms-swift
description: "Use ms-swift for LLM and multimodal training, inference,
  deployment, data/model customization, export, evaluation, RLHF, Ray, and
  Megatron workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# ms-swift

Use this repo skill when a task mentions `ms-swift`, `swift`, ModelScope SWIFT, `swift sft`, `swift infer`, `swift deploy`, `swift eval`, `swift export`, `swift rlhf`, GRPO, Ray, or Megatron-SWIFT.

ms-swift is a Python framework for large-model and multimodal fine-tuning, inference, evaluation, quantization, deployment, RLHF/GRPO, Ray scheduling, and Megatron-style distributed training.

## First Checks

- Public package: install with `pip install ms-swift -U`; from source use `pip install -e .`.
- Import check: `python -c "import swift; print(swift.__version__)"`.
- CLI check: `swift sft --help`, `swift infer --help`, `swift export --help`, and `swift rlhf --help` should work in a base install.
- Optional extras are workflow-specific: evaluation needs EvalScope, advanced Megatron needs Megatron packages, and accelerated serving needs vLLM/SGLang/LMDeploy as appropriate.
- Use local model and dataset paths plus offline flags when users cannot download from ModelScope or HuggingFace.

## Route by User Goal

- **Train or fine-tune models**: read `sub-skills/training/SKILL.md` for `swift pt`, `swift sft`, LoRA/QLoRA/full tuning, multimodal training, checkpoints, YAML/JSON configs, and training-time evaluation flags.
- **Infer, serve, or call a local model**: read `sub-skills/inference-deployment/SKILL.md` for `swift infer`, `swift app`, `swift deploy`, backend selection, OpenAI-compatible APIs, adapters, batch inference, logprobs, and multimodal requests.
- **Prepare data or register models/templates**: read `sub-skills/data-model-customization/SKILL.md` for dataset formats, `--columns`, `--custom_dataset_info`, `--external_plugins`, registry inspection, custom models, and templates.
- **Export, quantize, push, or evaluate**: read `sub-skills/export-evaluation/SKILL.md` for `swift export`, `swift merge-lora`, quantization, hub pushes, `swift eval`, EvalScope backends, and custom eval datasets.
- **Use RLHF, GRPO, Ray, or Megatron**: read `sub-skills/advanced-rl-distributed/SKILL.md` for `swift rlhf`, `swift sample`, `swift rollout`, reward plugins, Ray configs, Megatron-SWIFT, and distributed troubleshooting.

## Shared References and Scripts

- Read `references/package-overview.md` for package purpose, CLI route map, optional extras, and cross-skill terminology.
- Read `references/troubleshooting.md` for install/import, optional dependency, backend, hub/offline, CLI/config, and hardware issues that cut across workflows.
- Read `references/repo-provenance.md` when checking whether this skill is stale against a newer ms-swift checkout.
- Run `scripts/check_ms_swift_install.py --help` for a safe installed-package and optional-dependency checker.
- Run `scripts/inspect_swift_cli.py --help` for a safe CLI route inventory and help-command planner.

## Common Decision Points

- Use `--model` for full checkpoints or model IDs; use `--adapters` for LoRA adapter checkpoints.
- If a LoRA checkpoint must run on vLLM/SGLang/LMDeploy as a merged full model, route through export/merge guidance first; do not promise QLoRA merge support.
- If a task asks for dataset rows, schemas, media fields, or `loss_scale`, solve that in data/model customization before constructing training or RLHF commands.
- If a task asks for deployment performance, distinguish model support from package availability: base ms-swift may install while vLLM, SGLang, LMDeploy, EvalScope, Ray, or Megatron extras remain absent.
- If a task asks for GRPO or custom rewards, confirm the dataset fields and reward function signature before planning rollout placement or Ray/Megatron parallelism.

## Runtime Safety

- The bundled scripts print diagnostics or command skeletons; they do not launch training, download models, start servers, or push to hubs unless their help explicitly says otherwise.
- Treat model downloads, hub pushes, long training, evaluation benchmarks, Ray/Megatron clusters, and accelerated serving as user-controlled side effects.
- Keep credentials in environment variables such as `MODELSCOPE_TOKEN`, `HF_TOKEN`, or a user-provided shell environment; do not write tokens into command builders or config examples.

Files in this skill

  • SKILL.md4.3 KB
  • references/package-overview.md4.4 KB
  • references/repo-provenance.md1.5 KB
  • references/repo-routing-metadata.json561 B
  • references/troubleshooting.md3.8 KB
  • scripts/check_ms_swift_install.py4.6 KB
  • scripts/inspect_swift_cli.py2.6 KB
  • sub-skills/advanced-rl-distributed/SKILL.md3.8 KB
  • sub-skills/advanced-rl-distributed/references/ray-megatron-workflows.md12.2 KB
  • sub-skills/advanced-rl-distributed/references/rlhf-grpo-workflows.md11.5 KB
  • sub-skills/advanced-rl-distributed/references/troubleshooting.md11 KB
  • sub-skills/advanced-rl-distributed/scripts/build_rlhf_command.py13.8 KB
  • sub-skills/advanced-rl-distributed/scripts/check_optional_backends.py7.4 KB
  • sub-skills/data-model-customization/SKILL.md2.9 KB
  • sub-skills/data-model-customization/references/data-formats.md8 KB
  • sub-skills/data-model-customization/references/registry-and-plugins.md8.8 KB
  • sub-skills/data-model-customization/references/template-reference.md7.5 KB
  • sub-skills/data-model-customization/references/troubleshooting.md7.8 KB
  • sub-skills/data-model-customization/scripts/inspect_registries.py11.7 KB
  • sub-skills/data-model-customization/scripts/inspect_template_encoding.py8.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.