AI SummaryHugging Face Spaces host machine-learning applications. There are 1M+ today; each Space is a git repo. This skill covers creating, building, debugging, and maintaining them. Before anything else: 1. Check the CLI is installed: . If not, .
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "huggingface-spaces" skill in my project. Please run this command in my terminal: # Install skill into your project (9 files) mkdir -p .claude/skills/huggingface-spaces && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/SKILL.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/SKILL.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/buckets.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/buckets.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/debugging.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/debugging.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/gradio.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/gradio.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/grants.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/grants.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/inference-providers.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/inference-providers.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/known-errors.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/known-errors.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/requirements.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/requirements.md" && mkdir -p .claude/skills/huggingface-spaces/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/huggingface-spaces/references/zerogpu.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/huggingface-spaces/references/zerogpu.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Build, deploy, and maintain applications on Hugging Face Spaces — Gradio / Docker / Static SDKs, ZeroGPU and dedicated hardware, model loading, debugging, buckets, inference providers, community grants. Use whenever the user asks to create or host an app on Hugging Face, port code onto ZeroGPU, fix a Space that won't build or run, or otherwise work with `hf spaces …`, `@spaces.GPU`, Space README frontmatter, or the `spaces` Python package.
requirements.txt
Short version: • Do NOT list: gradio, spaces, huggingface_hub (preinstalled and platform-managed; pinning them causes resolution failures or silently breaks the ZeroGPU runtime). • Do list if you use them: torchvision, torchaudio (not preinstalled), plus everything else (diffusers, transformers, accelerate, sentencepiece, …). • ZeroGPU only accepts torch 2.8.0, 2.9.1, 2.10.0, 2.11.0. Default to leaving torch unpinned (the runtime preinstalls the latest). Only pin when a dep forces it. • For prebuilt CUDA-extension wheels (flash_attn, xformers, pytorch3d, nvdiffrast, diff_gaussian_rasterization, torchmcubes): use the prebuilt Blackwell wheels at https://huggingface.co/datasets/multimodalart/zerogpu-blackwell-wheels/tree/main/wheels. Full mapping + caveats in references/requirements.md.
Hugging Face Spaces
Hugging Face Spaces host machine-learning applications. There are 1M+ today; each Space is a git repo. This skill covers creating, building, debugging, and maintaining them.
0. Getting ready
Before anything else: • Check the hf CLI is installed: which hf. If not, pip install -U huggingface_hub. • Check the user is logged in: hf auth whoami. If not, ask them to run ! hf auth login in this session — they'll need a write-scoped token from https://huggingface.co/settings/tokens. • Note whoami's canPay and isPro flags — they gate hardware choices below. The hf-cli skill teaches an agent every hf command and is the recommended companion to this one. Install it with hf skills add hf-cli (add --claude --global to install for Claude Code as well, user-level).
1. What a Space is
A Space is a git repo with three possible SDKs: • Gradio — most Spaces. Python, fast iteration, supports ZeroGPU. • Docker — arbitrary container. Use when you need a non-Python stack or a pre-built template (Streamlit, Argilla, Shiny, etc. — full list at https://huggingface.co/docs/hub/spaces-sdks-docker). Does not support ZeroGPU. • Static — plain HTML, or a React/Svelte/Vue project built at deploy time. Use for in-browser ML (transformers.js / WebGPU / WebAssembly / onnxruntime-web), project pages, interactive reports, or Spaces that orchestrate other Spaces. No hardware needed.
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster