ModelScope

Published 2026-09-23Updated 2026-10-15

Download models with the modelscope CLI

Common ModelScope CLI commands for downloading models. Prefer ModelScope when you are in China — downloads are much faster there.

Install

Install the modelscope package:

Bash
pip install modelscope

On macOS, the default download location is ~/.cache/modelscope/hub. To change it, set the MODELSCOPE_CACHE environment variable in ~/.zshrc:

Bash
export MODELSCOPE_CACHE=/path/to/your/cache

Notes

  • If the path given to local_dir does not exist, the tool creates it automatically.

  • local_dir must be an absolute path. Do not use ~ for the home directory: Python's open() does not expand it, and the command fails with No such file or directory.

  • The quick start in the official docs uses the form --model="Qwen/Qwen2.5-0.5B-Instruct". Prefer the spaced form --model <model_repo_id> instead.

  • <model_repo_id> is the model repository ID from the model page. It is made of the organization name and the model name, for example Qwen/Qwen-Image-2.1.

  • Downloading a private model requires you to log in.

Download specific files to a directory

Bash
modelscope download --model '<model_repo_id>' '<file_path>' --local_dir '<local_dir>'
 
# Example: download one weight file to a given directory
modelscope download --model 'Qwen/Qwen-Image-2.1-Turbo' 'transformer/diffusion_pytorch_model-00001-of-00002.safetensors' --local_dir '/Users/oceanz/MyFiles/models/Qwen/Qwen-Image-2.1-Turbo'
  • <file_path> must keep the file's relative path inside the repository.

  • Separate multiple files with spaces.

Download a full repository to the default cache

Bash
modelscope download --model '<model_repo_id>'

Download a full repository to a given directory

Bash
modelscope download --model '<model_repo_id>' --local_dir '<local_dir>'
 
# Example
modelscope download --model 'Qwen/Qwen-Image-2.1-Turbo' --local_dir '/Users/oceanz/MyFiles/models/Qwen/Qwen-Image-2.1-Turbo'

Parameters

ParameterShortTypeDefaultDescription
repo_id-str-Positional argument: repository ID (optional; can also be set with --model)
files-str-Positional argument: files to download (multiple files allowed)
--model-strNoneModel ID (mutually exclusive with --dataset)
--dataset-strNoneDataset ID (mutually exclusive with --model)
--repo-type-choicemodelRepository type (model or dataset), used with the positional repo_id
--revision-strNoneRevision, branch, or tag
--cache_dir-strNoneCache directory
--local_dir-strNoneLocal directory (takes priority over cache_dir)
--include-listNoneGlob patterns for files to include
--exclude-listNoneGlob patterns for files to exclude
--token-strNoneAccess token (required for private models)
--endpoint-strNoneModelScope service endpoint
--max-workers-intdefaultMaximum number of concurrent download threads
ModelScope BadgeOfficial docs