all posts

Best Gradio Hosting Platforms (2026)

Ajay Kumar··10 min read

Gradio's whole pitch is that a working demo is forty lines of Python. That is true, and it is why so many machine-learning projects have one. The hosting question is where it gets complicated, because a Gradio app can be almost anything: a thin UI over a hosted model API that needs a fraction of a CPU, or a local model that will not start without 24 GB of VRAM. Those two deployments have almost nothing in common, and most roundups pretend they do.

So start here, before you compare anything: does your app run a model in-process, or does it call one over the network? If it calls out, you need cheap, boring web hosting and the GPU discussion is irrelevant. If it runs the model locally, GPU availability dominates every other criterion and most of this list drops away.

Disclosure: PandaStack is our project and appears below — and we do not offer GPUs, which I say up front because it disqualifies us for a real slice of Gradio apps. Numbers are quoted only for our own platform; everything else is described qualitatively from public docs.

Hugging Face Spaces — the default, and usually correct

Spaces is where Gradio comes from, and it shows. Push a repo with an app file and a requirements file and you have a running demo on a public URL, with the Gradio SDK detected automatically. There is a free CPU tier, paid GPU hardware you select per Space, and the whole thing sits inside the ecosystem where your model weights and datasets already live.

For a public research demo, a paper artifact, or anything you want discoverable, Spaces is the right answer and I would not talk anyone out of it. The reasons to look elsewhere are specific: you need the demo behind your company's auth, it has to sit inside your own network or cloud account, it is part of a larger product rather than a standalone page, or you need control over the runtime that a managed Space does not expose.

Modal, Replicate, RunPod — when the model runs in-process

If your Gradio app loads weights locally, your hosting choice is really a GPU choice, and the serverless-GPU providers exist for exactly this. Modal lets you attach a GPU to a Python function and expose a web endpoint from the same code, which suits Gradio well. Replicate is more model-centric — you package the model and get an API, with a demo page around it. RunPod is closer to renting the machine, which is cheaper per hour and more work per hour.

The thing to check on all three is what a cold start costs, because for a GPU app it is rarely the container start — it is loading multi-gigabyte weights into VRAM. A user clicking your demo link and waiting forty seconds will assume it is broken. Keeping something warm fixes it and costs money; there is no third option, and any platform that implies otherwise is measuring the wrong thing.

Render, Fly.io, Railway — CPU Gradio as an ordinary web app

For the large category of Gradio apps that are a UI over an API — an LLM wrapper, a data explorer, an annotation tool, a thin front end for something running elsewhere — a general-purpose PaaS is the sane choice. Gradio is a Python web server. It has no special requirements beyond binding the right host and port and having enough memory for its dependencies.

Two configuration details cause most of the failures here, and they are the same on every platform:

import os
import gradio as gr

def greet(name: str) -> str:
    return f"Hello, {name}"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")

if __name__ == "__main__":
    demo.launch(
        server_name="0.0.0.0",              # not 127.0.0.1 — must be reachable
        server_port=int(os.environ["PORT"]), # not the hard-coded 7860
    )

Gradio defaults to 127.0.0.1 and port 7860. Both defaults are correct for your laptop and wrong for every hosting platform, and together they account for most 'my app deployed successfully but the health check fails' reports. Set both explicitly and the problem disappears.

PandaStack — private demos that cost nothing while nobody is looking

PandaStack is our project: git-driven app hosting where each app runs in its own Firecracker microVM behind a stable URL. Python is first-class — the platform reads your .python-version or .tool-versions via mise, installs from requirements, poetry, uv, or pipenv, and runs the start command you give it.

The specific case we are good for is the internal demo. Most Gradio apps inside a company are looked at for ten minutes a week and idle the rest of the time, and paying for a provisioned instance around the clock for that is the actual cost problem. Our apps scale to zero and bill nothing while asleep; waking is a snapshot restore rather than a cold boot, so the first visitor after an idle period is not waiting on a full Python import cycle. Billing is $0.054 per active vCPU-hour and $0.0162 per working-set GiB-hour, per second, with egress not billed.

The isolation story is the second reason people pick us for this: each app is a real VM with its own guest kernel, so a demo that runs user-supplied code — and a striking number of Gradio apps do, via a file upload or a code box — is not sharing a kernel with anything else you run.

The disqualifier, stated plainly: no GPUs. If your Space needs an A100, we are the wrong platform and Modal, Replicate, RunPod, or a paid Space is the right one. We are for the CPU half of the Gradio world.

Two things people forget until production

Authentication. Gradio ships a simple auth parameter that gates the app behind a username and password, which is fine for keeping a link from being fully public but is not an SSO integration. If the demo shows anything sensitive, put a real proxy or your platform's access control in front of it and do not rely on the built-in mechanism as your only boundary.

File uploads. Gradio's file components write to a temporary directory, and on ephemeral hosting that directory vanishes when the process restarts — which is a feature for privacy and a bug if you assumed files persisted. Decide which you want. If uploads must survive, write them to object storage or a volume explicitly. If they must not, make sure your platform actually discards them rather than keeping them in a shared cache.

If your Gradio app accepts an arbitrary file and passes it to a parsing library — images, PDFs, archives, media — you are running untrusted input through C code with a long CVE history. That is a real attack surface, and it is the strongest argument for hosting the demo somewhere with a VM boundary rather than a shared kernel.

Choosing, briefly

Public demo, model in-process, wants to be discovered: Hugging Face Spaces. Model in-process and it is part of a product: Modal or Replicate, and budget for keeping something warm. Thin UI over an API, public or internal: any general-purpose PaaS — Render and Railway are the least friction. Internal, idle most of the time, or handling files you would rather isolate: that is the case we built for, and scale-to-zero is why it costs almost nothing between visits.

Frequently asked questions

Do I need a GPU to host a Gradio app?

Only if the model runs inside the app process. A Gradio interface that calls the OpenAI, Anthropic, or Hugging Face Inference API over the network is an ordinary Python web app and runs happily on a fraction of a CPU. If you load weights with transformers or diffusers at startup, you need the hardware those weights want, and no amount of hosting cleverness substitutes. Check what your app actually imports before paying for GPU hosting.

Why does my Gradio app work locally but fail its health check when deployed?

Almost always the host and port. Gradio's launch defaults are 127.0.0.1 and 7860 — loopback is unreachable from outside the container or VM, and 7860 is rarely the port the platform is probing. Pass server_name='0.0.0.0' and read the port from the PORT environment variable. If it still fails after that, check whether the app is spending its startup time loading a model: platforms give a health check a fixed window, and a ninety-second model load can exceed it.

Can I put a Gradio demo behind company SSO?

Not with Gradio's own auth parameter, which is a simple username and password check meant to keep casual visitors out. For real SSO you put an authenticating proxy in front — your platform's access control, an identity-aware proxy, or something like oauth2-proxy in the same deployment. Treat the built-in auth as a lock on a garden gate: useful, but not the thing you rely on for anything confidential.

How do I stop paying for a demo nobody is using?

Host it somewhere that scales to zero, and check what waking actually costs there. A Gradio app with a heavy dependency tree can take several seconds just to re-import on a genuine cold start, which is why platforms that restore a snapshot of the already-running process feel different from ones that start from scratch. The alternative — and it is a perfectly good one for a demo shown at a weekly meeting — is to keep the deployment scripted and only run it when someone needs it.

Keep reading

Run code in a microVM in one API call.

49ms p50 cold start. Fork, snapshot, and scale to zero.

Start free
Written by Ajay Kumar, Founder, PandaStack.