Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

huggingface-zerogpu

Skill by sickn33

Hugging Face ZeroGPU is a skill with rules and patterns for ML demos on Gradio Spaces that run on ZeroGPU hardware. It is for developers who write or review code that uses @spaces.GPU, duration and quota settings, or ZeroGPU-specific code limits.

  • Score 92
  • 51k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install huggingface-zerogpu

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/huggingface-zerogpu ~/.claude/skills/huggingface-zerogpu

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install huggingface-zerogpu in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill gives an AI assistant rules and patterns for building ML demos on Hugging Face Spaces with ZeroGPU hardware. It covers the @spaces.GPU decorator, duration and quota tuning, process isolation, the CUDA availability model, concurrency safety, and CUDA build constraints. It applies to Gradio SDK Spaces only, because Docker and Static Spaces cannot schedule onto ZeroGPU.

The skill points to reference files for cold starts, quota errors, concurrency, and CUDA dependencies such as flash-attn. It explains that models are usually loaded at module scope, that real GPU access happens only inside decorated functions, and that CUDA tensors should be moved to CPU before they are returned. It is aimed at developers writing or reviewing Gradio code for ZeroGPU Spaces. It is published by sickn33, sourced from the huggingface/skills repository, and licensed under Apache-2.0.

Written from the project's SKILL.md and checked against it.

What it can do

  • Write @spaces.GPU functionsApply the decorator correctly in Gradio Spaces, including duration and size options.
  • Tune duration and quotaChoose duration values and avoid illegal duration or quota exceeded errors.
  • Handle process isolationKeep arguments and return values picklable and return CPU tensors instead of CUDA tensors.
  • Explain the CUDA availability modelPlace model loading and device setup at module scope and use the device selection idiom.
  • Review concurrency safetyCheck handlers that run in parallel by default in ZeroGPU code.
  • Check CUDA build constraintsGuide installing CUDA-dependent packages such as flash-attn and pinning torch side-cars.
  • Avoid unsupported compile pathsPoint to ahead-of-time compilation (AoTI) on torch 2.8+ because torch.compile is not supported.

What you need

  • Gradio SDK Space
  • ZeroGPU hardware on Hugging Face Spaces

Try asking

  • Review my Gradio app and check how I use the @spaces.GPU decorator.
  • Set a duration for a 10-second ZeroGPU task so I avoid quota exceeded errors.
  • Why does my ZeroGPU function hang when it returns a CUDA tensor?

Good to know

  • Applies only to Gradio SDK Spaces. Docker and Static Spaces cannot schedule onto ZeroGPU.
  • torch.compile is not supported on ZeroGPU.
  • The default large size gives half of a physical GPU.
  • Backing GPU and tier limits change over time, so check the ZeroGPU docs.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/huggingface-zerogpu/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md19 KB
  • references/concurrency.md3 KB
  • references/cuda-and-deps.md5 KB
  • references/how-quota-works.md4 KB
  • references/how-zerogpu-works.md5 KB

Alternatives to huggingface-zerogpu

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

huggingface-zerogpu: common questions

Does this skill work on CPU or dedicated GPU Spaces?

The spaces package is a no-op off ZeroGPU, so @spaces.GPU becomes a passthrough on dedicated GPU and CPU tiers. The source says no code changes are needed when duplicating a Space to those tiers.

Why does my task fail with quota exceeded?

The platform checks the requested duration against the user's remaining quota, not the actual run time. Declaring a smaller realistic duration helps avoid premature rejections.

Can a ZeroGPU function return CUDA tensors?

The source says no. Returning CUDA tensors can hang, so convert them with tensor.cpu() or tensor.cpu().numpy() first.

How do I install huggingface-zerogpu?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is huggingface-zerogpu free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is huggingface-zerogpu safe to use?

It scores 92 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to huggingface-zerogpu?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

huggingface-zerogpu Install

Add to stack

Loading.