Repository navigation
add space hardware option to create repo - #277
Merged
Merged
Conversation
Member
Author
|
Checked the open question live. An OAuth token scoped only to The token came from the device-code flow and had scope exactly
The Hub never dropped the field: |
pngwn
marked this pull request as draft
October 19, 2026 08:57
pngwn
marked this pull request as ready for review
October 22, 2026 08:40
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.
create_repotakes a new optionalhardwareparam, so an agent can create a ZeroGPU Space, or a Space on any other hardware, in one call. Today every Space it creates starts oncpu-basic, and changing that needs a second Hub API call.{ "uri": "hf://spaces/alice/demo", "sdk": "gradio", "hardware": "zero-a10g" }New Spaces pass
hardwaretocreateRepo, which accepts it as of@huggingface/hub2.17.9 (huggingface/huggingface.js#2683). Duplicated Spaces pass it to the Hub duplicate endpoint. The hardware comes back in the result for Spaces.hardwareis a plain string, and the tool makes no checks of its own. The Hub's errors come back for an unknown flavor, ZeroGPU without Gradio, or an account without access. So new hardware works without a schema change, the same as #278 does forhf_jobs. The param description lists the current Space flavors fromGET /api/spaces/hardwareas examples. It also tells the model that a READMEsuggested_hardwaredoes NOT set the hardware, that ZeroGPU needs the gradio sdk and a PRO account (or a Team or Enterprise plan for an org-owned Space), and that paid flavors bill the owner as soon as the Space is created.A
contribute-reposOAuth token, the scope HuggingChat forwards, can set hardware on both endpoints (results in the comment below).