Skip to main content

model-downloader-util

Download or resolve model files from local paths, HTTP(S), S3-compatible storage (S3, MinIO, RustFS), Google Cloud Storage, and Git LFS.

Install

pip install modeldownloaderutil

From source:

uv sync

Usage

from modeldownloaderutil import download_model, cache_dir

path = download_model("s3://my-bucket/models/weights.onnx")
path = download_model("https://example.com/model.onnx", force_download=True)

Supported sources

Scheme Example
Local /path/to/model.onnx, ~/models/x.onnx
HTTP(S) https://host/path/model.onnx
S3 s3://bucket/key
MinIO minio://bucket/key (MINIO_ENDPOINT)
RustFS rustfs://bucket/key (RUSTFS_ENDPOINT)
GCS gs://bucket/object
Git LFS git+https://github.com/org/repo.git#path/in/repo.onnx

Cache

Default: platformdirs cache for model_registry (override with MODEL_CACHE_DIR).

<cache>/
  s3/<bucket>/<key>
  gs/<bucket>/<object>
  url/<host>/<path>
  git/<repo_slug>/<file_path>
  git/<repo_slug>.lock   # serializes parallel Git / Git LFS pulls for the same repo

Progress

HTTP(S), S3/MinIO/RustFS, GCS, and Git LFS show tqdm byte bars. Plain Git clones/pulls stream native git --progress to stderr. Disable with MODEL_DOWNLOAD_PROGRESS=0 (or TQDM_DISABLE=1).

Environment

Copy .env.example to .env in the project root (loaded automatically on download_model).

Variable Purpose
MODEL_CACHE_DIR Download cache root (cache_dir())
MODEL_DOWNLOAD_PROGRESS Set to 0/false to disable tqdm progress bars
RUSTFS_ENDPOINT Required for rustfs:// URLs
MINIO_ENDPOINT Required for minio:// URLs
MODEL_ACCESS_KEY / MODEL_SECRET_KEY S3-compatible credentials

Development

make test
make build

Publish to PyPI

Create an API token at pypi.org (scope: project modeldownloaderutil or entire account).

export UV_PUBLISH_TOKEN=pypi-xxxxxxxx
make publish

Dry run on TestPyPI first:

export UV_PUBLISH_TOKEN=pypi-xxxxxxxx
make publish-test
pip install --index-url https://test.pypi.org/simple/ modeldownloaderutil

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modeldownloaderutil-1.0.10.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modeldownloaderutil-1.0.10-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file modeldownloaderutil-1.0.10.tar.gz.

File metadata

  • Download URL: modeldownloaderutil-1.0.10.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modeldownloaderutil-1.0.10.tar.gz
Algorithm Hash digest
SHA256 3d6334e9890a07fcfbf75f8777c4b3ba95a6aaf8083c4e3acf59587a76199923
MD5 1be1208d68073f86105e0e2dd3ac1c4d
BLAKE2b-256 14a74628e2ca91ca35f7b4a36ec5829e83b9fc33dd66374bb9c8a5683b27970f

See more details on using hashes here.

File details

Details for the file modeldownloaderutil-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: modeldownloaderutil-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modeldownloaderutil-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 acdf59b8e530f95c6b27a78e220164ab7ab3fb040d7dc5e20a29f11cb45d3dd3
MD5 b636254882a7189338c735f0e69b71b7
BLAKE2b-256 90400f6b324670a1fb7ace80f723de8c6123dd91c08b5bd7b10f31397b33e106

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.1

2 files

1.2.0

2 files

This release

1.0.10 This release

2 files

1.0.8

2 files

1.0.7

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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