SkillsReviewed · Hugging Face

Hugging Face ZeroGPU skill

The huggingface-zerogpu skill guides coding assistants and developers building Gradio AI demos on shared GPUs, but some dependency and runtime-compiler advice conflicts within the text. It covers GPU decorators, quota requests, process boundaries, concurrent handlers and CUDA package compatibility.

Researched 15 Nov 2026

In short.

The huggingface-zerogpu skill is an instruction package for coding assistants and developers building Gradio demos on Hugging Face ZeroGPU, but conflicting setup advice needs clarification before deployment. Its strongest material explains quota admission, separate GPU workers, serialized session state, concurrent requests and CUDA wheel compatibility. Current hardware, supported runtime versions, hosting eligibility and prices are unknown from the supplied material. Nothing was executed, so installation, correctness and performance remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete supplied skills/huggingface-zerogpu folder: SKILL.md and all four reference files at revision 25910b3d0ba31a2ba102f901cdc9e008c278a69c, plus the repository-root LICENSE as a related notice outside that folder. The supplied aggregate content checksum is dda19735d51a525378a9dc8764bdb616546646ecb4c0c846525d51cf85f73cfc. Linked pages, sibling skills, other repository folders and external implementations are excluded. No code, installation, live service behavior, compatibility, performance or billing was tested.

The overview

Identity

huggingface-zerogpu is an assistant instruction skill in the huggingface/skills repository, rather than a GPU service or executable application. It contains SKILL.md and four supporting references covering concurrency, CUDA dependencies, quota behavior and worker mechanics.

Its original location is [https://github.com/huggingface/skills/tree/main/skills/huggingface-zerogpu]. The supplied content is fixed to revision 25910b3d0ba31a2ba102f901cdc9e008c278a69c. Its stated scope is Gradio SDK Spaces using ZeroGPU hardware; Docker and Static Spaces are outside that scope.

Assessment

The skill is most useful as a focused implementation and troubleshooting reference. It connects recognizable failures, such as quota rejections, stale session state and CUDA import errors, to specific design choices instead of offering only a basic decorator example.

Its usefulness is limited by inconsistent wording about the spaces dependency and runtime CUDA compiler availability. These issues warrant checking the applicable platform documentation before following the setup guidance. The supplied explanations are documentation claims; no installation or runtime behavior was tested.

Users

The intended users are coding assistants and developers writing or reviewing ZeroGPU applications, especially text, image, audio or video demos that use PyTorch and Gradio. It is particularly relevant when moving a demo from a local GPU to shared, request-based GPU execution.

Beginners receive explanations of why common patterns fail, but the examples assume familiarity with Python functions, decorators, package dependencies and Gradio events. Experienced developers get more detail on serialization boundaries, ABI compatibility and worker reuse. It does not provide a complete introduction to Python or Gradio.

Capabilities

The instructions cover placing GPU work inside @spaces.GPU, choosing static or input-dependent duration estimates, understanding large versus xlarge allocation, and keeping actual CUDA computation out of module initialization.

They also explain picklable inputs and outputs, moving returned CUDA tensors to CPU, explicitly returning updated gr.State values, avoiding shared mutable request data and generating unique output filenames. Dependency guidance covers prebuilt CUDA wheels, Python and torch compatibility, C++ ABI tags and version drift in torch-related packages.

The skill supplies examples and explanations. It does not itself provision a Space, install dependencies, select a model or establish that an application is correct.

Using it

Requirements

The deployment patterns target a Gradio SDK Space configured for ZeroGPU. Examples use the spaces package, PyTorch and model libraries such as Transformers. The source says Docker and Static Spaces cannot schedule onto ZeroGPU and treats Streamlit Spaces as Docker-based.

The application needs mutually compatible Python, torch and compiled-package versions. The source recommends explicitly setting python_version in the Space README and matching CUDA wheels to Python, torch, CUDA and C++ ABI expectations. Current supported versions, account eligibility and hosting permissions are not established here. No supported-assistant list or assistant-specific installer is supplied.

Mechanism

The source describes a long-lived web process and separate GPU workers. Under ZeroGPU, spaces patches PyTorch so module-level model transfers can be registered without attaching a real GPU to the web process. A startup packing step writes weights to disk; a cold worker then loads them through pinned host memory into GPU memory. Reused warm workers can retain weights until the scheduler reclaims them.

Arguments, results and yielded state cross the worker boundary through pickle serialization. Consequently, state mutations remain local until returned, and returning a CUDA tensor can trigger blocked CUDA initialization in the web process. The documented remedy is to return CPU data.

Scheduling checks declared duration against a visitor's per-call cap and remaining quota. The source distinguishes an excessive-duration error from quota exhaustion and says shorter declared durations receive higher priority within the node queue. These mechanisms were not independently verified.

Setup

Obtain the complete skill folder, preserving SKILL.md and its four reference files. The source provides no installation instructions for a particular assistant, so automatic discovery and activation depend on the assistant environment and are not assessed.

For application development, the source recommends installing spaces locally and importing it directly. Its detailed deployment guidance says the platform pins its own spaces version, so spaces must not appear in requirements.txt. With a hand-written requirements.txt, simply omit it; with uv, declare spaces in pyproject.toml so uv can resolve its transitive constraints such as psutil, then exclude it from the export; pip-tools and Poetry users should use the equivalent exclude mechanism. The supplied uv example is uv export --no-hashes --no-dev --no-emit-package spaces -o requirements.txt.

The document also calls for a supported python_version setting and compatible torch and CUDA-wheel pins. Its Python 3.12 example is not confirmation of current platform support. Resolve the contradictory dependency wording before treating this as a definitive installation recipe.

Example

An illustrative text-generation pattern loads a model pipeline once at module scope, performs inference in a generate(prompt) function decorated with @spaces.GPU, and returns generated text. For portability to CPU environments, the source also shows selecting the device through torch.cuda.is_available() rather than always hardcoding CUDA.

Its quota example uses @spaces.GPU(duration=15) for a hypothetical task taking about 10 seconds. The purpose is to avoid requesting the documented 60-second default for short work. Those numbers are explanatory examples, not measurements of any model. A working app would still need a model identifier, dependencies, Gradio interface and validated duration estimate.

Assessment & evidence

Limitations

There is a direct runtime-compiler contradiction: the skill description says nvcc is unavailable at build time and runtime, while the body says runtime nvcc has been mounted from a CUDA development image since July 2025. The supplied material cannot establish which statement matches the current service.

Dependency wording also needs care. An early passage criticizes hiding spaces from requirements.txt, while the dedicated dependency section explicitly says to omit it because the platform pins its own version. The later distinction between local dependency declaration and deployment export helps explain the intended approach, but the earlier wording remains misleading.

The source states that torch.compile is unsupported and points to ahead-of-time compilation instead. Its hardware, version and quota guidance depends on a changing service. There are no executed examples, benchmarks, reliability measurements or verified compatibility results.

Reasoning

The practical value comes from linking implementation choices to documented failure mechanisms. Declared duration affects admission before work starts; serialized state requires explicit updates; shared filenames can mix concurrent users' outputs; and mismatched compiled wheels can fail despite successful dependency resolution.

These explanations support using the skill to structure a ZeroGPU implementation or diagnose a specific error. They do not establish that following it improves latency, lowers bills or prevents every concurrency problem. Its stated protection for global model objects applies to read-only use; request-time mutation requires separate assessment.

Alternatives

For general Gradio components, layouts and event listeners, the source points to the sibling huggingface-gradio skill. Its contents are outside the supplied material, so its quality and coverage were not assessed.

The source also discusses dedicated GPU Spaces and local environments, where it says the spaces decorator becomes a passthrough outside ZeroGPU. These may suit different hosting needs, but comparative prices and performance are unknown. For compiled attention dependencies, it identifies kernels-community kernels as an alternative to manually matching raw wheel files; that compatibility claim was not tested.

Evidence

The supplied source consists of the complete SKILL.md, references/concurrency.md, references/cuda-and-deps.md, references/how-quota-works.md and references/how-zerogpu-works.md, plus the repository-root LICENSE. All are identified with revision 25910b3d0ba31a2ba102f901cdc9e008c278a69c.

This supports analysis of the skill's contents and internal consistency. Linked platform documentation, package metadata, upstream implementations and external compatibility tables were not supplied. Nothing was executed, so the examples and low-level implementation explanations remain untested.

Access & freshness

Costs

The supplied Apache 2.0 licence grants no-charge rights to use and redistribute the covered material subject to its conditions. That does not establish the price of hosting or GPU use.

The source describes large as a half-card allocation with 1x quota cost and xlarge as a full-card allocation with 2x quota cost. It says xlarge doubles declared duration for admission checks: duration=60 becomes a 120-second request. This is quota arithmetic, not a monetary quote or measured bill.

Current subscription prices, included allowances, pay-as-you-go rates and total deployment costs are unknown. The quota reference points to changing platform documentation rather than supplying current rates.

Rights

The supplied repository LICENSE is Apache License 2.0. It permits use, modification and redistribution subject to conditions including providing the licence, marking modified files and preserving applicable notices. If an applicable NOTICE file accompanies the work, its attribution notices must also be retained as required.

The licence includes a conditional contributor patent grant, provides no general trademark permission and disclaims warranties. It does not establish rights to external model weights, datasets or dependencies. The supplied notices consist of the repository LICENSE; no separate NOTICE text was supplied.

Freshness

The supplied snapshot was captured on 15 November 2026 at 17:16:18.757 UTC. That identifies the snapshot, not the resource's publication date or most recent edit. The dependency reference includes observations dated April 2026, which should not be treated as a current compatibility matrix.

The skill explicitly warns that backing GPUs, supported runtimes and tier thresholds change. Current GPU models, per-size memory, accepted Python and torch versions, quotas and billing rates remain unknown here. It directs readers to [https://huggingface.co/docs/hub/spaces-zerogpu], whose contents were not included.

Actions

Start with the complete skill folder and read the concurrency reference alongside the main instructions. Before deployment, resolve the runtime nvcc contradiction and confirm how the current Space environment supplies spaces. Check supported runtime versions and match any compiled wheels and torch-related packages to the chosen environment.

Validate the application with simultaneous requests, unique output paths, explicitly returned session state and CPU-converted tensor outputs. Establish realistic duration estimates and examine quota rejection and cold-worker behavior. These are recommended validation steps; no such checks were performed.

Evidence for this report

LICENSEnotice · checked 2026-11-15
skills/huggingface-zerogpu/SKILL.mdselected · checked 2026-11-15