All skills
huggingface avatar

/huggingface-spaces

@57d80c3 official
by Hugging Facehuggingface/skills11k stars
753

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.

Use this Skill: https://skilld.dev/gh/huggingface/skills/huggingface-spaces

This session only. Nothing lands on disk.

referencesgrants.md

≈801 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Community GPU grants

When a user has a good use case (open research demo, hobbyist project, educational tool, institutional showcase) and can't pay for the hardware it needs, they can request a free community grant from Hugging Face.

Free personal accounts already get 2 ZeroGPU Spaces, so a grant is now for the cases that go past that:

  • a dedicated GPU ZeroGPU can't cover (non-PyTorch main model with heavy init, model too big for 96 GB, always-on serving);
  • a Gradio Space beyond the free 2-ZeroGPU cap, without subscribing to PRO.

The flow

  1. Build the Space. If the user still has a free ZeroGPU slot, create it as --flavor zero-a10g and iterate normally with real inference before applying.

    If they're out of slots, create a Static Space instead (--space-sdk static — free for everyone) and push the app there; the SDK can be switched to gradio in the README frontmatter once the grant lands. Code the app for ZeroGPU anyway — import spaces, @spaces.GPU, module-scope .to("cuda"). In this mode you can't iterate-with-real-inference before the grant, so just get the code in place and submit.

    For a dedicated-GPU grant, get the app to BUILD cleanly and reach RUNNING (even if the runtime would OOM on real input), then submit.

  2. Submit a Community Tab discussion on the Space. Title:

    Apply for a GPU community grant: <Personal|Company|Academic> project

    Pick the closest fit. Body:

    Description of the app: one paragraph on what it does + who it's for.
    Justification: one paragraph on why this should run on ZeroGPU
    (open-source, research, educational, etc.). 

    If the user didn't give you a justification, a reasonable default is "Public open-source demo, can't cover the hardware cost — happy to provide more context if helpful."

  3. Wait. Open and publicly-facing applications by researchers, tinkerers, and institutions are typically approved. Approval can take days.

  4. Once approved, the hardware is attached automatically — no code change needed (a Static holding Space still needs its sdk: flipped to gradio). The user comes back and you can iterate / refine with real GPU access.

When to suggest this

  • The use case is a clear public ML demo (not a private tool) and the user is out of free ZeroGPU slots.
  • The model needs more than ZeroGPU offers — beyond 48 GB large / 96 GB xlarge, or a non-PyTorch runtime — and the user can't pay.

When NOT to suggest this

  • The user is on a free account and this is their 1st or 2nd Space — they can create it on ZeroGPU directly; no grant needed.
  • Private / commercial / closed-source projects — push the user toward PRO instead.
  • canPay=True users who just need paid hardware — they can attach it directly.

Posting the request programmatically

from huggingface_hub import HfApi

api = HfApi(token="hf_...")
api.create_discussion(
    repo_id="<ns>/<space>",
    repo_type="space",
    title="Apply for a GPU community grant: Personal project",
    description="<description and justification>",
)

The Community Tab must be enabled on the Space (default — keep it on).

Source: SKILL.md on GitHub

1 alert1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides a comprehensive developer toolkit for building, deploying, and maintaining machine learning applications on Hugging Face Spaces. It includes detailed instructions for handling hardware configurations, specialized model dependencies (particularly for 3D generation), and persistent storage. No malicious patterns were detected, and all external resources are used within the context of standard machine learning development workflows on the Hugging Face platform.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: CRITICAL · 3 issues

Signed by skilld at 57d80c3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 months ago
  • hugging-face
  • spaces
  • gradio
  • zerogpu
  • docker
  • static
  • ml-deployment
  • model-hosting
  • inference

README badge

README badge for huggingface/skills/huggingface-spaces

Builds and deploys machine-learning applications on Hugging Face Spaces using Gradio, Docker, or Static SDKs. Covers ZeroGPU allocation, hardware selection, model loading, debugging, and the `hf spaces` CLI workflow. Use this skill when creating a Space from scratch, migrating code to ZeroGPU, or troubleshooting a Space that won't build or run.

Generated from the current SKILL.md.

Does this skill work with Docker and Static Spaces, or only Gradio?
It covers all three SDKs — Gradio, Docker, and Static. However, ZeroGPU is Gradio-only; Docker and Static Spaces use different hardware or no hardware at all.
What do I need to use ZeroGPU?
You must be on a PRO, Team, or Enterprise plan to create a ZeroGPU Space. Visitors consume their own daily quota (~5 min free / 40 min Pro / 60 min Enterprise) when they use the Space.
Can I use TensorFlow or ONNX as the main model on ZeroGPU?
No. ZeroGPU is PyTorch-first; non-PyTorch frameworks as the primary inference path require a dedicated paid GPU. Small non-torch tools (preprocessors, utilities) inside a PyTorch pipeline are fine on ZeroGPU.
What versions of Python and PyTorch does ZeroGPU support?
ZeroGPU officially supports Python 3.10.13 and 3.12.12. For PyTorch, it accepts 2.8.0, 2.9.1, 2.10.0, and 2.11.0; the runtime preinstalls the latest if you leave torch unpinned.
Should I test my Space locally before pushing to Hugging Face?
Minimal local checks (like `python3 -m py_compile app.py`) are fine, but the Space environment is the only one that matters. Build a release candidate locally, push it, then use the live URL as your test loop.

Generated from the current SKILL.md. These answers refresh after source changes.