Skip to main content

hf-s3-mirror

CLI tool for mirroring HuggingFace models to S3-compatible storage.

Installation

pip install hf-s3-mirror

Configuration

Create .env file in your working directory:

S3_ACCESS_KEY=your_access_key
S3_SECRET_KEY=your_secret_key
S3_ENDPOINT_URL=http://your-s3-endpoint
S3_REGION=ru-1
S3_BUCKET=model-bucket
S3_USE_SSL=false

Or export environment variables:

export S3_ACCESS_KEY=your_access_key
export S3_SECRET_KEY=your_secret_key
export S3_ENDPOINT_URL=http://your-s3-endpoint
export S3_REGION=ru-1
export S3_BUCKET=model-bucket

Usage

Upload model from HuggingFace to S3

# Basic usage
hf-s3 upload openai/whisper-large-v3

# With custom bucket and prefix
hf-s3 upload lab-ii/whisper-large-v3 -b my-bucket -p models/

Upload local directory to S3

hf-s3 upload-local ./my-model -b model-bucket -p models/

Download model from S3 mirror

hf-s3 download lab-ii/whisper-large-v3 -o ./models

List bucket contents

# List root
hf-s3 list-bucket

# List specific path
hf-s3 list-bucket -p models--lab-ii--whisper-large-v3

Delete model from S3

# By repo_id (will ask for confirmation)
hf-s3 delete lab-ii/whisper-large-v3

# By direct path
hf-s3 delete models--lab-ii--whisper-large-v3

# Skip confirmation (for scripts)
hf-s3 delete lab-ii/bad-model --force

Commands Reference

Command Description
upload <repo_id> Download from HuggingFace and upload to S3
upload-local <path> Upload local directory to S3
download <repo_id> Download from S3 mirror to local
list-bucket List S3 bucket contents
delete <path> Delete folder from S3 (with confirmation)

Common Options

Option Short Description
--bucket -b S3 bucket name (overrides env)
--prefix -p S3 prefix path
--help Show command help

S3 Storage Structure

Models are stored with the following naming convention:

bucket/
  models--organization--model-name/
    config.json
    model.bin
    tokenizer.json
    ...

License

Apache 2.0

Metadata

Release files for hf-s3-mirror 0.4.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 hf-s3-mirror 0.4.1
File Size Uploaded
hf_s3_mirror-0.4.1.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hf-s3-mirror 0.4.1
File Interpreter ABI Platform
hf_s3_mirror-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / hf_s3_mirror-0.4.1.tar.gz

Download URL hf_s3_mirror-0.4.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
295ecf9e00f6692932e61c4269868d7f20109af91a337420d75a9988fb07efb2
BLAKE2b-256 checksum
How to use checksums
2aa2e122a24a6cb4d5d68834becfb702af651e529d32f07c9121a1b38543287d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 5, 2026.

Transparency log

Release files / hf_s3_mirror-0.4.1-py3-none-any.whl

Download URL hf_s3_mirror-0.4.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
334be3449ffe9b2a4bcd2718149202406d20142cc91f1c6a32f83e0c64ea0161
BLAKE2b-256 checksum
How to use checksums
8bf0129a3c53da18b12710203fa40f46ed331015143839a7f8dcc1fdeb70d402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.1.0

2 release 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