skillfed

modelscope-hub

The official Python client to connect with ModelScope Hub.

modelscope-hub v0.2.0 4.1M downloads/30d#2,379 on PyPI
Permissive license Apache-2.0 Active released

What it is and what it does

modelscope-hub is the official Python SDK and CLI for interacting with ModelScope Hub, a repository hosting many AI models and datasets. It provides a single HubApi class and ms-hub command-line tool that unify operations across models, datasets, Studio spaces, skills, and MCP servers. The package handles the full lifecycle: authentication, downloading individual files or entire snapshots with resume capability and integrity checks, uploading files and folders, creating and managing repositories, and inspecting cached assets.

The package is built on ModelScope's OpenAPI surface with transparent fallback to legacy APIs for backward compatibility. Downloads include production-grade features like HTTP Range resume, parallel range download for large files, per-file retry with backoff, SHA256 verification, file locking for multiprocess safety, offline mode, and progress callbacks. The CLI supports filtering by file patterns, direct local-directory downloads that bypass the cache, and full repository lifecycle management including secret management and cache inspection.

Use it for:

  • Download pre-trained models with pattern filtering to get only specific file types (e.g., .safetensors weights).
  • Upload trained model weights or datasets to a personal or organizational ModelScope repository with commit messages and folder organization.
  • Integrate ModelScope asset downloads into training or inference pipelines using the HubApi class with custom progress callbacks.
  • Manage repository metadata, visibility, and gating settings from the CLI without visiting the web interface.
  • Access cached models offline using local_files_only=True after an initial download, useful in air-gapped or low-bandwidth environments.
  • Deploy MCP servers or Studio spaces and manage their operational URLs and environment variables from the terminal.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Download, upload, and manage AI models, datasets, and other assets on ModelScope Hub through a unified Python SDK and CLI interface.

Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a concrete problem for anyone working with ModelScope Hub assets. Recent releases show active bug fixes and error-handling improvements. No known vulnerabilities. Install if you need to programmatically or via CLI download, upload, or manage models and datasets on ModelScope Hub.

Install

modelscope-hub on PyPI

pip

pip install modelscope-hub

uv

uv add modelscope-hub

poetry

poetry add modelscope-hub

Installing modelscope-hub

Before you install

Low friction install with four runtime dependencies (requests, tqdm, filelock, urllib3). Active maintenance — v0.2.0 released 2026-08-01 with bug fixes and error-handling improvements. Supports Python 3.10 through 3.14.

License in practice

Apache-2.0 permissive license — you can use, modify, and distribute freely, including in commercial projects, provided you include the license notice.

Quickstart

pip install modelscope-hub

from modelscope_hub import HubApi

api = HubApi(token="your-token")
path = api.download_file("Qwen/Qwen3-0.6B", "model", "config.json")

Requires Python 3.10 or later. ModelScope API token needed for authenticated operations (obtain from modelscope.cn/my/access/token or modelscope.ai/my/access/token).

Verify before relying

  • Whether the package handles authentication errors transparently across different ModelScope endpoints (v0.2.0 mentions endpoint probing but scope unclear).
  • Performance characteristics of parallel range download for very large files (description mentions it but no benchmarks provided).
  • Whether offline mode (local_files_only=True) works reliably across all repo types (models, datasets, studios, skills, MCP servers).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — requests, tqdm, filelock, urllib3
Maintenance actively maintained — 13 days since the last release
First released
Downloads 4,102,610/month — #2,379 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: modelscope_hub-0.2.0-py3-none-any.whl

Keywords: modelscope, hub, sdk, openapi, machine-learning

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

modelscope hub clientdownload models from modelscopeai model repository managementmodelscope sdk pythonhub asset upload downloadmodelscope cli toolmachine learning model hub
model-hubml-opscli-tool

More Artificial Intelligence packages