Skip to main content

CLI tool for uploading HuggingFace models to S3 storage

Project description

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

Project details


Download files

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

Source Distribution

hf_s3_mirror-0.4.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

hf_s3_mirror-0.4.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file hf_s3_mirror-0.4.1.tar.gz.

File metadata

  • Download URL: hf_s3_mirror-0.4.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hf_s3_mirror-0.4.1.tar.gz
Algorithm Hash digest
SHA256 295ecf9e00f6692932e61c4269868d7f20109af91a337420d75a9988fb07efb2
MD5 6bfbb490a19bc136ee11e30b271dce88
BLAKE2b-256 2aa2e122a24a6cb4d5d68834becfb702af651e529d32f07c9121a1b38543287d

See more details on using hashes here.

Provenance

The following attestation bundles were made for hf_s3_mirror-0.4.1.tar.gz:

Publisher: publish.yml on Suro4ek/h3_s3_mirror

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hf_s3_mirror-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: hf_s3_mirror-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hf_s3_mirror-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 334be3449ffe9b2a4bcd2718149202406d20142cc91f1c6a32f83e0c64ea0161
MD5 b679056185f171149d89d7364e4a556a
BLAKE2b-256 8bf0129a3c53da18b12710203fa40f46ed331015143839a7f8dcc1fdeb70d402

See more details on using hashes here.

Provenance

The following attestation bundles were made for hf_s3_mirror-0.4.1-py3-none-any.whl:

Publisher: publish.yml on Suro4ek/h3_s3_mirror

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page