[Bucket/Repo] Support 'region' option in create_bucket and create_repo#4194
Conversation
- Add region parameter to HfApi.create_bucket() method - Add --region option to hf buckets create CLI command - region accepts 'us' or 'eu' values (Literal type, no runtime validation) - Update documentation in buckets guide and CLI reference
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
nice! do you think it would also make sense to support that for git repos? (server-side we shipped it in a separate PR: https://github.com/huggingface-internal/moon-landing/pull/17957) |
ah yes definitely, haven't seen that one |
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
Wauplin
left a comment
There was a problem hiding this comment.
✔️
(added support both both buckets and repos)
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
| **Options**: | ||
|
|
||
| * `--private`: Create a private bucket. | ||
| * `--region [us|eu]`: Cloud region in which to create the bucket. Can be one of 'us' or 'eu'. |
There was a problem hiding this comment.
| * `--region [us|eu]`: Cloud region in which to create the bucket. Can be one of 'us' or 'eu'. | |
| * `--region [us|eu]`: Cloud region in which to create the bucket (requires Team plan or above). Can be one of 'us' or 'eu'. |
(maybe, as you prefer - same elsewhere?)
There was a problem hiding this comment.
yes good idea, updated all docstrings in d2264ab
|
This PR has been shipped as part of the v1.15.0 release. |
PR (almost) entirely made using Moon-IDE + Inference Providers + https://huggingface.co/Qwen/Qwen3.5-397B-A17B (Scaleway). cc @coyotte508
(made 36 requests for a cost of 2,42$ 😬)
Uploaded the Coder trace to https://huggingface.co/buckets/Wauplin/moon-ide-traces/tree/sess-1778056134318-f8763a11.jsonl but it's not recognized by the Hub.
Follow-up PR after server-side update (private - https://github.com/huggingface-internal/moon-landing/pull/18059) cc @alexpouliquen .
This PR adds a
regionparameter to thecreate_bucketmethod and CLI command, allowing users to specify the cloud region when creating a bucket.region: Literal["us", "eu"] | Noneparameter toHfApi.create_bucket()--regionoption tohf buckets createcommandUsage
Python:
CLI:
Note
Medium Risk
Adds a new user-facing
regionparameter/flag that alterscreate_repo/create_bucketrequest payloads; risk is mainly around backend compatibility and validation of supported regions.Overview
Adds support for creating repos and buckets in a specific cloud region.
HfApi.create_repoandHfApi.create_bucketnow accept an optionalregion("us"/"eu") and include it in the creation payload when provided; thehf repos createandhf buckets createCLI commands expose this via a new--regionoption and update examples/help text.Documentation and CLI reference pages are updated with new
regionusage examples, and CLI tests are adjusted to expectregion=Noneincreate_repocalls.Reviewed by Cursor Bugbot for commit 272e907. Bugbot is set up for automated code reviews on this repo. Configure here.