HubCloneHubClone
Hub / Spaces Overview

Join the HubClone community

and get access to the augmented documentation experience

  • Collaborate on models, datasets and Spaces
  • Faster examples with accelerated inference
  • Switch between documentation themes

to get started

Spaces Overview

A Space is a Git repository whose content is built and run as a web app. Every push triggers a rebuild, and the running app is served from the Space page.

Creating a new Space

Open New → Space, choose a name, a license and an SDK. The SDK decides how your app is built:

SDKWhen to use it
GradioPython demos with inputs and outputs in a few lines
DockerAny stack you can describe with a Dockerfile
StaticPlain HTML, CSS and JavaScript, no server

Hardware resources

Every Space starts on free CPU hardware. You can upgrade to larger CPUs or GPUs from the Settings tab; paid hardware is billed by the minute while the Space is running.

Managing secrets and environment variables

Store API keys as secrets in the Space settings — they are injected as environment variables at runtime and never shown in the repository. Non-sensitive configuration goes in variables.

Warning:

Secrets are not copied when someone duplicates your Space. Document the variables your app expects in its README.

Lifecycle management

Free Spaces go to sleep after a period without traffic and wake up on the next visit. Upgraded Spaces can be configured with a custom sleep time, or paused manually to stop billing.

Helper environment variables

At runtime the Space receives variables such as SPACE_ID and SPACE_HOST, which apps use to build absolute URLs or detect that they run on the Hub.