What Are Hugging Face Spaces?
Hugging Face Spaces is a hosting platform for machine learning applications. It sits alongside the two pillars you already know from the Hugging Face ecosystem — Models and Datasets — and completes the triad: you publish your data, you publish your trained model, and then you publish a live demo that lets anyone try it in their browser.
That's the simple version. The reality is more interesting. Spaces has evolved from a basic demo hosting service into a full-stack application platform with GPU hardware tiers, containerized deployments, dynamic GPU allocation, and an integrated AI app directory that millions of developers browse every month.
Think of it as the closest thing to "Heroku for ML" that exists today — except it's free to start, deeply integrated with the Hugging Face Hub, and purpose-built for AI workloads rather than general-purpose web apps.
Why Spaces Matters
The AI landscape in 2026 is defined by a fundamental tension: models are getting more powerful, but the barrier to actually using them is getting higher. Training a model requires GPU clusters. Running inference at scale requires infrastructure. And demonstrating that your model works requires a user interface.
Spaces collapses all three barriers into one platform. You don't need to provision a server, configure a web framework, or deploy a frontend. You write a few lines of Python, push your code to Hugging Face, and your demo is live at huggingface.co/spaces/yourusername/your-app within minutes.
For researchers, this is transformative. A published model card tells people what your model does. A published Space shows them. The difference between telling and showing is the difference between a paper that gets cited and a model that gets used.
The Three SDKs
When you create a Space, you choose one of three SDKs. Each targets a different use case and developer workflow.
Gradio
The default and most popular option. Gradio lets you build a UI for your model in pure Python — no HTML, no CSS, no JavaScript. You define inputs (text, image, audio), outputs, and Gradio generates the interface. It's the fastest path from model to demo, and it's what 80% of Spaces use. Gradio Spaces are also the only ones compatible with ZeroGPU, Hugging Face's serverless GPU tier.
Static HTML
For frontends built with any web framework — React, Vue, vanilla HTML/JS, or even a compiled web app. You upload your static files, and Hugging Face serves them from their CDN. No backend, no server, just a hosted website. Useful when your ML inference happens client-side or via an external API.
Docker
Full control. You write a Dockerfile, Hugging Face builds and runs it. This is for apps that need custom dependencies, non-Python backends, databases, or anything beyond what Gradio or static HTML can handle. Docker Spaces support all hardware tiers including GPUs, and they give you the same flexibility as deploying to any container platform.
Note: Streamlit was previously a built-in SDK option, but Hugging Face deprecated it in favor of Docker. If you want to deploy a Streamlit app, you use the Docker SDK with the Streamlit template.
Hardware Tiers
Spaces isn't just a hosting platform — it's a compute platform. Hugging Face provides several hardware tiers, from free CPU to dedicated GPUs:
| Tier | Hardware | Cost | Best For |
|---|---|---|---|
| Free CPU | Shared CPU | Free | Lightweight demos, API wrappers, static content |
| ZeroGPU | T4 GPU (serverless) | Free (limited compute hours) | GPU inference demos, Gradio-only |
| CPU Basic | Dedicated CPU | ~$0.06/hr | Reliable CPU demos, non-GPU workloads |
| T4 GPU | NVIDIA T4 (16GB) | ~$0.40/hr | Standard GPU inference, fine-tuned models |
| A10G GPU | NVIDIA A10G (24GB) | ~$1.27/hr | Larger models, image generation, batch inference |
| A100 GPU | NVIDIA A100 (40GB) | ~$2.92/hr | Large language models, training demos, heavy workloads |
The ZeroGPU tier is particularly worth calling out. It provides serverless GPU access — your Space spins up a T4 GPU when someone interacts with it, and shuts down when idle. You only pay for active compute time, and free-tier users get a generous allocation. It's the closest thing to "free GPU hosting" that exists at scale.
What People Build on Spaces
With over 600,000 public Spaces, the variety is staggering. Here are categories and examples that illustrate the platform's range:
Image Generation
Stable Diffusion demos, anime style transfer, face restoration (GFPGAN), and upscaling tools. The most popular Spaces are often image generators — users love being able to type a prompt and see results instantly. EpicRealismXL, for example, is a text-to-image generator that has attracted millions of interactions.
Language Models
Chat interfaces for LLMs, text summarization, translation, and code generation. Almost every major LLM release gets a Space demo within hours. The Cohere North Mini Code Demo and various Gemma challenge Spaces are recent examples of official model demos.
Audio and Music
Text-to-speech, voice cloning, music generation, and audio separation. Spaces like MusicGen and various TTS demos let users hear model output in real time — something a model card alone can't convey.
Computer Vision
Object detection, pose estimation, background removal, OCR, and image captioning. BLIP (Bootstrapping Language-Image Pre-training) from Salesforce AI Research was one of the early viral Spaces — users uploaded photos and got natural language descriptions.
Developer Tools
Code generation assistants, API testing tools, and ML evaluation benchmarks. DeepSite's InstantCoder demo showed how Spaces can be used for app generation from prompts — a meta-demo of AI building AI tools.
Research Demos
Academic labs and individual researchers use Spaces to demonstrate paper results. The "Spaces of the Week" curation by the Hugging Face team highlights standout research demos — from multimodal models to novel architectures.
Our Use Case: IconShop SVG Generator
This brings us back to our own work. We've been training an SVG icon generation model based on the IconShop paper by Wu et al. (2023). As we documented in our previous posts, we trained a 16-layer transformer decoder on the FIGR-SVG dataset over two days of GPU compute, producing a model that generates vector icons from text prompts.
We published the model weights to Hugging Face Hub. But publishing weights is only half the story. Anyone can download a checkpoint file — far fewer people will actually run inference on it. The friction of setting up the environment, loading the model, and writing inference code is a significant barrier.
A Space eliminates that barrier entirely. Here's what our IconShop demo Space would look like:
The demo would be straightforward: a Gradio interface with a text input for the prompt, controls for temperature and top-p sampling, and an SVG output display that renders the generated icon in real time. Users could generate multiple variants, download the SVG files, and share their results.
Here's the rough architecture:
iconshop-space/
├── app.py # Gradio interface
├── requirements.txt # Dependencies (torch, gradio, transformers)
├── model/ # Model weights (loaded from HF Hub)
│ ├── checkpoint.pth
│ └── config.json
├── inference.py # Model loading and generation logic
└── README.md # Space description
The Gradio app itself is minimal — perhaps 50 lines of Python:
import gradio as gr
from inference import load_model, generate_icon
model = load_model("thinksmart/iconshop-svg-generator")
def generate(prompt, temperature, top_p):
svg = generate_icon(model, prompt, temperature=temperature, top_p=top_p)
return svg
demo = gr.Interface(
fn=generate,
inputs=[
gr.Textbox(label="Prompt", placeholder="e.g., bottle, star, clock"),
gr.Slider(0.1, 1.0, value=0.4, label="Temperature"),
gr.Slider(0.1, 1.0, value=0.5, label="Top-p"),
],
outputs=gr.HTML(label="Generated SVG Icon"),
title="IconShop SVG Generator",
description="Generate vector icons from text prompts using our trained transformer model."
)
demo.launch()
That's it. Deploy this to a ZeroGPU Space, and anyone in the world can try our model without installing anything. No API keys, no setup, no dependencies. They go to a URL, type a prompt, and see an icon appear.
Why does this matter for us as AI researchers? Three reasons:
- Credibility. A live demo proves the model works. A model card claims it does — a Space demonstrates it. There's a fundamental difference between saying "our model generates icons" and letting someone generate one themselves.
- Discovery. Spaces are indexed by Hugging Face's AI app directory. People browsing for "SVG" or "icon generation" will find our demo. That's organic traffic we wouldn't get from a model page alone.
- Feedback loop. Every interaction with the Space is data. We can see which prompts produce good results, which ones fail, and use that to improve the model. A Space turns passive viewers into active testers.
Spaces as a Research Tool
Beyond demos, Spaces serve a deeper purpose in the AI research workflow. They're the bridge between academic research and practical utility. Here's how they fit into the research lifecycle:
🔬 Reproducibility
A Space with your model gives others a way to verify your results without downloading weights and setting up an environment. Reproducibility is the foundation of scientific credibility — Spaces make it frictionless.
📊 Evaluation
Use Spaces to run interactive evaluations. Build a Space that lets users compare your model's output against baselines, or that systematically tests edge cases. The best evaluations aren't automated benchmarks — they're human-in-the-loop tests.
🎓 Education
Spaces are teaching tools. A Space that visualizes attention patterns, shows training loss curves, or lets students experiment with hyperparameters is more effective than any textbook chapter.
🤝 Collaboration
Share a Space with collaborators instead of sending screenshots. Everyone sees the same output, runs the same prompts, and has a shared reference point for discussion.
ZeroGPU: The Game Changer
One of the most significant recent additions to Spaces is ZeroGPU — Hugging Face's serverless GPU tier. Here's why it matters:
Traditional GPU hosting charges you by the hour, whether your Space is being used or not. If you deploy a demo on a T4 GPU and nobody visits it for three days, you've still paid for 72 hours of compute. ZeroGPU flips this model: the GPU is provisioned on-demand when someone interacts with your Space, and deprovisioned when idle. You only pay for active compute time.
For research demos, this is ideal. Most Spaces have bursty traffic — a spike when you share a link, then quiet periods. ZeroGPU matches that usage pattern perfectly. Free-tier users get a generous allocation of serverless GPU hours, which is more than enough for a research demo.
The catch: ZeroGPU currently works only with Gradio Spaces. If you need Docker or static HTML with GPU access, you'll need to use a paid hardware tier. But for most ML demos, Gradio is sufficient.
Best Practices for Building Spaces
⚡ Optimize for First Load
Users judge a Space in the first 10 seconds. Pre-load your model at startup, not on the first inference call. Use Gradio's examples parameter to give users instant results they can see without typing anything.
📱 Design for Mobile
Gradio handles responsive design by default, but custom CSS can break it. Test your Space on mobile before you share it. A demo that only works on desktop loses half your audience.
🔒 Add Rate Limiting
Popular Spaces get abused. Add rate limiting, queue management, or input validation to prevent someone from hammering your GPU with thousands of requests. Gradio has built-in queue support — enable it.
📝 Write a Clear Description
Your Space's README is its landing page. Explain what the model does, how to use the interface, and what to expect. Include example prompts and known limitations. A good description converts browsers into users.
🔗 Link to Your Model
Connect your Space to your model page on Hugging Face. This creates a two-way link — people visiting your model see the demo, and people using the demo can find the weights. It's cross-promotion within the ecosystem.
📈 Monitor Usage
Hugging Face provides basic usage analytics for Spaces. Watch your metrics — active users, compute hours, error rates. If your Space is timing out, you need a bigger GPU. If nobody's using it, you need better marketing.
Beyond Demos: Spaces as Production Apps
While Spaces started as a demo platform, the line between demo and production is blurring. Several companies now use Spaces as the frontend for their AI products — not because it's the most scalable architecture, but because it's the fastest way to get to market.
The workflow looks like this: build a prototype on Spaces → validate demand → migrate to production infrastructure. Spaces becomes your MVP platform. For AI startups, this is a significant advantage — you can test a product idea in a weekend instead of a month.
Hugging Face acknowledges this use case. Their PRO and Enterprise tiers offer dedicated hardware, custom domains, and higher resource limits specifically for teams running production workloads on Spaces.
The Bottom Line
Hugging Face Spaces has become the default platform for ML demos, and for good reason. It removes the infrastructure friction that used to separate a trained model from a public demo. You write Python, you push code, your demo is live.
For us, the next step is clear. We've trained our IconShop SVG generator. We've published the weights. Now we need to build the Space — a live, interactive demo that lets anyone generate vector icons from text prompts. It's not just a marketing move. It's a research move. A Space turns our model from a static artifact into a living, breathing demonstration of what AI research looks like in practice.
The best AI researchers don't just train models. They build tools that let other people experience those models. Spaces is the tool that makes that possible.
References
- Hugging Face Spaces — The AI App Directory
- Spaces Overview — Official documentation
- Gradio Spaces — Building demos with Gradio
- Docker Spaces — Custom container deployments
- ZeroGPU — Serverless GPU allocation for Spaces
- Featured Spaces — Curated weekly selections
- "IconShop: Text-Guided Vector Icon Synthesis with Autoregressive Transformers" — Wu, Su, Ma, Liao (2023)
- Training Our First SVG Icon Generation Model — Our hands-on IconShop training post
- How to Publish Your First Model to Hugging Face — Publishing our IconShop model to the Hub