Skip to main content

modely-ai

modely-ai is a Python package that provides a unified interface for downloading AI models and datasets from multiple platforms including Hugging Face and ModelScope. It offers a simple command-line tool and Python API to efficiently download models and datasets with progress tracking, resumable downloads, and minimal dependencies.

Features

  • 🚀 Unified interface: Download from both Hugging Face and ModelScope with a single tool
  • ⚡ Progress tracking: Real-time download progress with tqdm
  • 🔄 Resumable downloads: Resume interrupted downloads automatically
  • 📁 Flexible options: Download entire repositories or specific files
  • 🔐 Authentication support: Access private models and datasets with tokens
  • 📦 Minimal dependencies: Only requires requests and tqdm

Installation

Install modely-ai using pip:

pip install modely-ai

Usage

Command Line Interface

modely-ai provides a command-line interface with two main subcommands: hf for Hugging Face and ms for ModelScope.

Download from Hugging Face

Download an entire model repository:

modely hf bert-base-uncased

Download a specific file from a repository:

modely hf bert-base-uncased --file config.json

Download with specific options:

modely hf facebook/opt-2.7b --repo-type model --revision v1.1.0 --local-dir ./models

Download from a private repository:

modely hf username/private-repo --token YOUR_HUGGINGFACE_TOKEN

Download from ModelScope

Download an entire model repository:

modely ms owner/model-name

Download a specific file:

modely ms owner/model-name --file config.json

Download a dataset:

modely ms owner/dataset-name --repo-type dataset

Download with specific options:

modely ms owner/model-name --revision main --local-dir ./models

Python API

You can also use modely-ai directly in your Python code:

from modely import hf_snapshot_download, model_file_download

# Download an entire Hugging Face repository
model_path = hf_snapshot_download(
    repo_id="bert-base-uncased",
    repo_type="model",
    revision="main"
)

# Download a specific file from Hugging Face
file_path = hf_file_download(
    repo_id="bert-base-uncased",
    filename="config.json",
    repo_type="model"
)

# Download from ModelScope
ms_model_path = modelscope_snapshot_download(
    repo_id="owner/model-name",
    repo_type="model",
    revision="master"
)

Command Reference

Hugging Face Commands

modely hf <repo_id> [OPTIONS]

Options:

  • --file FILE: Specific file path to download from the repository
  • --repo-type {model,dataset,space}: Type of repository (default: model)
  • --revision REVISION: Revision of the model (default: main)
  • --cache-dir DIR: Cache directory for downloaded files
  • --local-dir DIR: Local directory to download files to
  • --token TOKEN: Access token for private repositories
  • --force-download: Force re-download even if file exists

ModelScope Commands

modely ms <repo_id> [OPTIONS]

Options:

  • --file FILE: Specific file path to download from the repository
  • --repo-type {model,dataset}: Type of repository (default: model)
  • --revision REVISION: Revision of the model (default: master)
  • --cache-dir DIR: Cache directory for downloaded files
  • --local-dir DIR: Local directory to download files to
  • --token TOKEN: Access token for private models

Requirements

  • Python 3.10 or higher
  • requests >= 2.25.0
  • tqdm >= 4.62.0

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue to improve the functionality or documentation.

Support

If you encounter any issues or have questions, please open an issue on the GitHub repository.

Metadata

Release files for modely-ai 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modely-ai 0.1.1
File Size Uploaded Provenance
modely_ai-0.1.1.tar.gz 14.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for modely-ai 0.1.1
File Interpreter ABI Platform
modely_ai-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / modely_ai-0.1.1.tar.gz

Download URL modely_ai-0.1.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f0bf12c52b9a04f570d47f2ebf1bc23825beb4ed2d94a74e99540e09447b9241
BLAKE2b-256 checksum
How to use checksums
d704f63e9ac804732b7163a1de550d658098dff1a6e76dbf8543386e39db7590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / modely_ai-0.1.1-py3-none-any.whl

Download URL modely_ai-0.1.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a471b907005d71660dfc1bbf7a301e07204f4007711d1ff98caf3e9ce79fd55
BLAKE2b-256 checksum
How to use checksums
e0b53f92180b4472624c7a08851c2b5003378bc32be17b5a3e8405c83d59d7c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Security for modely-ai 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page