Introduction¶
The common path to turn a model into a shareable Web Demo is to set up your own server or write a long list of deployment docs. Hugging Face Spaces turns each application into a Git repository, directly hosted via Gradio, Docker, or Static; but details such as SDK selection, the ZeroGPU quota on free accounts, hardware flavors, the hf spaces command, and README frontmatter are scattered across Hub documentation, making it easy for an Agent to stumble between “it works” and “it can be maintained long-term.”
Below is the huggingface-spaces Skill from Hugging Face’s official repository: it encodes the workflow for creating, building, debugging, and maintaining Spaces into SKILL.md, available for on-demand loading by clients compatible with Agent Skills such as Cursor, Claude Code, Codex, and Gemini CLI.
What Is This¶
huggingface-spaces is a workflow Skill in the huggingface/skills repository, following the Agent Skills standard (the folder contains SKILL.md plus reference docs).
The official description can be summarized as: build, deploy, and maintain applications on Hugging Face Spaces, covering Gradio / Docker / Static SDKs, ZeroGPU and dedicated GPUs, the spaces Python package and @spaces.GPU, model loading, troubleshooting, Buckets, Inference Providers, community Grants, and more. When a user wants to create or host an application on the Hub, migrate code to ZeroGPU, fix a Space that fails to build or run, or work with hf spaces … and Space README frontmatter, the Skill guides the Agent through step-by-step execution.
The Skill is suggested to be used together with hf-cli: the latter covers the full hf command set and can be installed via hf skills add hf-cli; this Skill is installed on demand with hf skills add huggingface-spaces (or an equivalent name).
Core Features¶
Based on the official SKILL.md, the capabilities covered by the Skill include:
- Environment & accounts: check the
hfCLI (which hf, install viapip install -U huggingface_hubif missing), log in (hf auth whoami/hf auth loginor a token with write permissions), and pay attention to howcanPayandisProconstrain hardware selection. - Space concepts: each Space is a Git repository; SDKs are Gradio (mainstream, supports ZeroGPU), Docker (any container, no ZeroGPU support), and Static (HTML or a frontend compiled at build time, no compute required).
- Hardware tiers: Static is free for everyone; Gradio/Docker requires a paid plan by default, while a free personal account can host up to 2 ZeroGPU Spaces when conditions are met. ZeroGPU (
zero-a10g) allocates a GPU per request, prioritizing Gradio with PyTorch; there are alsocpu-basicand hourly-billed dedicated GPUs (runhf spaces hardwarefor the list and pricing). - Search before creating:
hf spaces search "<model or task>" --sdk gradio --limit 10to reference existingapp.pyandrequirements.txt. - SDK & hardware decisions: public ML demos default to Gradio + ZeroGPU; non-PyTorch main inference paths, browser-side ML, and non-Python stacks have separate selection guidance (the Skill links to
references/zerogpu.md,references/inference-providers.md,references/grants.md, etc.). - Creating a Space:
hf repos create <namespace>/<name> --type space --space-sdk <gradio|docker|static>, combined with--flavor,--secrets,--env, and visibility; it emphasizes thathardware:in the README is ignored—hardware is determined by the--flavorat creation time or subsequenthf spaces settings. - Building the application: README.md YAML frontmatter (
title,sdk,sdk_version, etc.), dependency and Gradio/Static/Docker conventions, plus debugging and maintenance guidance (the truncated material still makes clear that frontmatter is mandatory).
The number of Spaces on the Hub has reached the million-level scale (the official Skill states 1M+); this Skill targets the complete operational path for continuously iterating demos on this platform, not a one-off “upload a few files.”
Installation and Activation¶
Hugging Face Skills supports Claude Code, Codex, Gemini CLI, Cursor, and others. The repository notes: the Cursor marketplace entry intentionally contains only hf-cli; other workflow Skills are installed via the hf CLI.
General (recommended when hf is already available)
pip install -U huggingface_hub
hf auth login
hf skills add huggingface-spaces
If the CLI capability package is not yet installed, you can first run:
hf skills add hf-cli
(Claude Code users can add --claude --global for user-level installation, see the Installation section in the official repository.)
Claude Code
- Register the plugin marketplace:
/plugin marketplace add huggingface/skills - Install the CLI Skill:
/plugin install hf-cli@huggingface/skills - Other Skills:
hf skills add <skill-name>(e.g.,huggingface-spaces)
Cursor
Access via the Hugging Face plugin in the Cursor Marketplace or the .cursor-plugin / MCP configuration in the repository; additional Skills are still installed with hf skills add huggingface-spaces.
Codex
Copy or symlink skills/huggingface-spaces to Codex’s convention .agents/skills path, or let a client that has already configured hf skills add discover it.
Gemini CLI
You can install the repository extension: gemini extensions install https://github.com/huggingface/skills.git --consent, then load the corresponding Skill according to the project documentation.
Typical Usage¶
All commands below come from the official Skill body and can be understood in sequence as the execution path the Agent is guided through.
1. Verify the CLI and identity
which hf
hf auth whoami
2. Find similar demos
hf spaces search "bert classification" --sdk gradio --limit 10
3. Create a Gradio + ZeroGPU Space (free accounts must explicitly specify the flavor)
hf repos create my-user/my-demo --type space --space-sdk gradio \
--flavor zero-a10g \
--public \
--exist-ok
Sensitive configurations use --secrets HF_TOKEN=hf_... (invisible to visitors); environment variables for display only use --env KEY=val.
4. View available hardware and pricing
hf spaces hardware
5. README frontmatter example (Gradio)
The Skill requires the top of the repository root README.md to contain YAML, e.g.:
---
title: My Demo
emoji: 🚀
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 6.15.1
---
(colorFrom / colorTo only allow the color names listed in the docs; sdk_version should follow the current stable version, per the Hub documentation.)
After pushing the code, the Space URL is https://huggingface.co/spaces/<namespace>/<name>. Gradio code that needs GPU inference usually combines the spaces package with the @spaces.GPU decorator; for details, see the ZeroGPU reference doc inside the Skill.
Use Cases and Cautions¶
Who it’s for
- Those who want to turn a PyTorch model into a public demo and have the Agent automatically handle Hub creation, hardware, and secrets.
- Those whose Space fails to build or runs abnormally, and need to check logs, dependencies, and hardware mismatches via the official troubleshooting checklist.
- Those on a free account who want to host Gradio via ZeroGPU as much as possible, or switch to alternatives such as Static / Inference Providers / community Grants.
Limitations and pitfalls
- Free personal accounts: only Static is unlimited; Gradio can only use ZeroGPU and at most 2 Spaces (requires verified email, account age of 30 days, etc.; subject to the Hub’s current policy).
- If
--flavoris omitted at creation, the default iscpu-basic, but this tier also requires a paid plan; free accounts should explicitly use--flavor zero-a10g. - Docker Spaces do not support ZeroGPU; non-Python stacks choose Docker, but must accept a paid dedicated or CPU tier.
hardware:in the README will not take effect; avoid confusion from mixing it with CLI settings.- The Skill contains many links to
references/*.md(Grants, Inference Providers, ZeroGPU quantitative estimates, etc.); the Agent should expand and read them when tackling specific subtasks rather than relying only on the summary.
For authoritative Hub behavior, refer to the Spaces overview documentation.
Conclusion¶
huggingface-spaces converges Hugging Face Spaces from “another hosting platform” into an executable Agent workflow: first hf auth and hardware boundaries, then search, select, and hf repos create, finally fill in README frontmatter and runtime debugging. If you already use hf-cli to manage the Hub, hf skills add huggingface-spaces lets the Agent avoid the pitfalls of fragmented documentation across the entire demo lifecycle.
Official Skill directory: github.com/huggingface/skills/tree/main/skills/huggingface-spaces