# Where to host a Gradio demo in 2026 so it wakes fast: Hugging Face Spaces vs Render vs Modal

Gregale · Updated 2026-11-30

When Hugging Face Spaces, Render, Modal and Gregale put an idle Gradio demo to sleep and how fast each wakes it, with a CPU demo that restores in 75 ms.

**A Gradio demo is visited in bursts: a link goes round, people try it,
then nobody opens it for days.** Hosts handle that differently.
Hugging Face Spaces puts free hardware to sleep after 48 hours, Render Free
after 15 minutes, and Modal 60 seconds after the last connection closes.
Gregale parks the app to a snapshot on disk and restores it on the next
request: our demo was running again 75 ms into the wake.

_Gregale publishes this page. Every limit and price names its vendor and comes
from that vendor's own docs or pricing page, or Gradio's, checked on November 28 and 30, 2026. The
Gregale numbers are from our own test on November 30, described below._

## At a glance

| Host                                | When an idle demo sleeps                                | How it wakes                                  | Cost for a small demo                                        |
| ----------------------------------- | ------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------ |
| **Hugging Face Spaces** (CPU Basic) | After 48 hours without use                              | The next visitor restarts it                  | Free hardware, but a new Gradio Space needs PRO ($9 a month) |
| **Hugging Face Spaces** (paid CPU)  | Never by default; you can set a sleep time              | The next visitor restarts it                  | CPU Upgrade: $0.03 an hour (8 vCPU, 32 GB)                   |
| **Render** (Free web service)       | After 15 minutes without inbound traffic                | The next request; about one minute to spin up | Free, 750 instance hours a month                             |
| **Modal**                           | 60 seconds after its last connection closes, by default | The next request starts a container           | Per second; $30 a month of free credits                      |
| **Gregale** (Hobby)                 | Parked after its idle timeout                           | The next request restores a memory snapshot   | $10 a month for 5 apps, 200 GB-RAM-hours included            |

## Hugging Face Spaces

Spaces is where most Gradio demos live, and it is the only host here with
GPUs on tap. Creating a Gradio or Docker Space now requires a paid plan, PRO
at $9 a month for a personal account; static Spaces stay free. The default
CPU Basic hardware (2 vCPU, 16 GB) has no hourly cost and sleeps after 48
hours without use, and the next visitor restarts it. Paid hardware never
sleeps unless you set a sleep time, and a sleeping Space isn't billed.

## Render

A Gradio app runs on Render as an ordinary Python web service. Free web
services spin down after 15 minutes without inbound traffic, and the next
request spins the service back up, which takes about one minute while Render
shows a loading page. Each workspace gets 750 free instance hours a month.

## Modal

Modal serves a Gradio app from a container, by mounting it on a FastAPI app
behind `@modal.asgi_app()`. Containers stop after 60 idle seconds by default
(`scaledown_window` changes it), and you pay per second for CPU and memory.
The Starter plan includes $30 of credits a month. Gradio needs every
request from one visitor to reach the same container, so Gradio's own guide
caps the app at one container with `max_containers=1`.

## Gregale

Gregale runs the app from your repository and parks it once nobody is using
it. The next request restores it from a snapshot of its memory, so the
Python process, Gradio and the model already loaded come back as they were,
without importing or loading anything again.

Two things to set up:

- **Load the model at import time.** Gregale takes the snapshot after the app
  starts, so a model loaded at module level is in memory when the app is
  restored. A model loaded on the first request would load again after every
  wake.
- **Give the health check a route of its own.** Gregale answers the app's
  health path at its edge for outside visitors. A Gradio route such as
  `/gradio_api/info`, which Gradio's client reads first, must reach the app,
  so mount Gradio on FastAPI and add `/healthz`:

```python
import os

import gradio as gr
import uvicorn
from fastapi import FastAPI

app = FastAPI()

@app.get("/healthz")
def healthz():
    return {"ok": True}

app = gr.mount_gradio_app(app, demo, path="/")

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", "7860")))
```

```yaml
# gregale.yaml
access: public
hosting:
  health: /healthz
```

Gradio and its dependencies took 356 MB of app layer in our test, more than
the Free plan's 256 MB, so a Gradio app needs Hobby. Hobby allows 512 MB
of packages; PyTorch alone is larger, so a model that needs it needs Pro or
a GPU host you call from the demo.

## A demo with a real model and no GPU

[gregale-dev/gradio-digits](https://github.com/gregale-dev/gradio-digits) is
a sketchpad: draw a digit and a small neural network guesses it. The network
was trained with scikit-learn on its bundled 8x8 digits (97.8% on held-out
images), and only its weights ship, an 18 KB file the app runs with numpy:

```python
def predict(x):
    hidden = np.maximum(x @ W1 + B1, 0)   # ReLU
    logits = hidden @ W2 + B2
    p = np.exp(logits - logits.max())
    return p / p.sum()
```

Swap `predict` for your own model: a scikit-learn model loaded with
`joblib`, an ONNX model with `onnxruntime`, or a call to a hosted model API.
Deploy it with:

```bash
git clone https://github.com/gregale-dev/gradio-digits
cd gradio-digits
gregale deploy --name my-gradio-demo
```

## What we measured

We deployed that repository on Gregale on 2026-11-30, at 512 MB:

- **Deploy:** 86 seconds from `gregale deploy` to a verified release.
- **Waking a parked demo:** restored from its snapshot in 75 and 77 ms; the
  page's first byte left Gregale's edge 230 and 259 ms after the request
  arrived.
- **A prediction through `gradio_client`:** a drawn zero came back as `0`.

## Which one to pick

- **A model that needs a GPU, or a demo for the Hugging Face community:**
  Spaces, on paid hardware with a sleep time.
- **A side project where a one-minute first load is fine:** Render Free.
- **Short bursts of heavy compute:** Modal, billed per second.
- **A CPU demo that should open quickly whenever someone follows the link,
  and cost nothing in between:** Gregale Hobby.

## Sources

Checked on November 28 and 30, 2026:
[Hugging Face Spaces overview](https://huggingface.co/docs/hub/spaces-overview),
[Spaces hardware, billing and sleep time](https://huggingface.co/docs/hub/spaces-gpus),
[Hugging Face pricing](https://huggingface.co/pricing),
[Render free instances](https://render.com/docs/free),
[Modal pricing](https://modal.com/pricing),
[Modal cold starts and scaledown_window](https://modal.com/docs/guide/cold-start),
[Deploying Gradio with Modal](https://www.gradio.app/guides/deploying-gradio-with-modal),
[Gregale plans](https://gregale.dev/docs/plans.md) and
[How scaling to zero works](https://gregale.dev/docs/scale-to-zero.md).

## Questions

### Is Hugging Face Spaces still free for Gradio demos?

The CPU Basic hardware has no hourly cost and sleeps after 48 hours without use, but creating a Gradio or Docker Space requires a paid plan: PRO at $9 a month for a personal account.

### Where can I host a Gradio app so it wakes up quickly?

Use a host that restores an idle app instead of starting it again. On Gregale, our Gradio demo was restored from a memory snapshot in 75 ms and sent the first byte of its page about 250 ms after the request; Render Free takes about one minute to spin up, and Hugging Face Spaces restarts a sleeping Space for the next visitor.

### How much memory does a Gradio app need?

Gradio and its dependencies took 356 MB of installed packages in our test, more than the 256 MB Gregale Free allows, so a Gradio app needs Hobby. A model that needs PyTorch is larger still and belongs on Pro or a GPU host the demo calls.

### Why does gradio_client fail with a KeyError on named_endpoints?

Gradio’s client first reads /gradio_api/info. If that path is set as the app’s health check on Gregale, the edge answers it for outside visitors and the client gets the edge’s health response instead. Mount Gradio on FastAPI and give the health check its own /healthz route.

Canonical URL: https://gregale.dev/articles/host-gradio-demo-scale-to-zero

