Skip to main content
All HugBucket configuration lives in a single Config dataclass defined in hugbucket/config.py. Fields that map to environment variables are resolved at instantiation time via os.environ.get().

Config dataclass

hugbucket/config.py

S3 gateway

Fields that control the S3 protocol listener. These can be overridden via --host and --port CLI flags on hugbucket-s3.

FTP gateway

Fields that control the FTP protocol listener. --host and --port CLI flags on hugbucket-ftp override ftp_host and ftp_port. Credentials are read from environment variables.
string
default:""
FTP login username. Maps to ftp_user on the Config dataclass. Set via the FTP_USERNAME environment variable.
string
default:""
FTP login password. Maps to ftp_password on the Config dataclass. Set via the FTP_PASSWORD environment variable.

Hugging Face

Settings for the HF Hub API connection.
string
required
Hugging Face API token. Maps to hf_token on the Config dataclass. Required — the server exits with code 1 if this is empty. Set via the HF_TOKEN environment variable.

S3 authentication

S3 clients authenticate using standard AWS credentials. If both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are empty, S3 authentication is disabled and a warning is logged.
string
default:""
S3 access key ID. Maps to s3_access_key on the Config dataclass. Set via the AWS_ACCESS_KEY_ID environment variable.
string
default:""
S3 secret access key. Maps to s3_secret_key on the Config dataclass. Set via the AWS_SECRET_ACCESS_KEY environment variable.

Xet CDC settings

Parameters for the content-defined chunking (CDC) algorithm used when uploading files to Xet CAS. The defaults match Hugging Face’s Xet protocol.

Connection pool


Upload settings

Controls retry behavior and timeouts for uploading xorbs and shards to Xet CAS.

Cache settings

HugBucket maintains three in-memory caches to reduce repeated network round-trips to the HF Hub and Xet CAS.