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.
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-zerogpuRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/huggingface-zerogpu ~/.gemini/antigravity-cli/skills/huggingface-zerogpuAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install huggingface-zerogpu in Antigravity CLI
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
