Draft
Conversation
Design for adding HuggingFace Buckets API to the Rust SDK, covering HFBucket handle, API methods, xet integration, error handling improvements, blocking API, and CLI commands matching the Python hf buckets interface.
13-task plan covering error handling, types, HFBucket handle, xet refactoring, API methods, blocking wrapper, and CLI commands.
…ants Extend HFError with dedicated variants for HTTP 403, 409, and 429 status codes, plus BucketNotFound for bucket-specific 404s. Update check_response to map these status codes to the new variants instead of the generic Http error. Remove now-redundant inner status code matching in format_hf_error.
Add impl HFBucket with info, list_tree, get_paths_info, get_file_metadata, batch, delete_files, upload_files, and download_files methods. Xet integration uses bucket-specific token URLs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HFBuckethandle type (parallel toHFRepository) for bucket-scoped operationsHFClient:create_bucket,delete_bucket,list_buckets,move_bucketHFBucket:info,list_tree,get_paths_info,get_file_metadata,batch,upload_files,download_files,delete_filesHFBucketSyncblocking wrapper with all sync equivalentshfrs bucketsCLI commands matching the Pythonhf bucketsinterface:create,list/ls,info,delete,remove/rm,move,cpBucketNotFound,Forbidden,Conflict,RateLimitedvariantsDesign
Buckets are xet-backed mutable object storage with no git history. The implementation mirrors the Python
huggingface_hublibrary's bucket API (minussync_bucket).docs/superpowers/specs/2026-04-09-buckets-design.mddocs/superpowers/plans/2026-04-09-buckets-implementation.mdNew files
src/bucket.rsHFBuckethandle (owner, name, client ref)src/types/buckets.rsBucketInfo,BucketUrl,BucketTreeEntry,BucketFileMetadatasrc/types/bucket_params.rsTypedBuildersrc/api/buckets.rssrc/bin/hfrs/commands/buckets/Out of scope (future PRs)
sync_bucket— bidirectional sync with plan/applycopy_files— full cross-repo/bucket copy APITest plan
cargo test -p huggingface-hub)cargo clippy --all-features -D warnings)hfrs buckets --helpshows all subcommands