GeekHub Learn
Module
Lesson 10.22 of 5 in this module2 min read Module 10: Deploying AI Apps

Streamlit Cloud and Hugging Face Spaces in depth

The two free platforms beginners use most. Master the secrets, the dependency files, the constraints.

These are the bicycles of AI deployment. Free, fast, slightly limited, perfect to learn on.

Streamlit Cloud:

  • Connect GitHub
  • Pick repo, branch, file
  • Add secrets (OPENAI_API_KEY etc.) in dashboard
  • Auto-deploys on every push
  • Free tier: 1 GB RAM, 1 GB storage, sleeps after inactivity

Hugging Face Spaces:

  • Connect or create a Space
  • Pick SDK: Streamlit, Gradio, Static, Docker
  • Add secrets in the Settings tab
  • Free tier: CPU 2 vCPU 16 GB; sleeps; GPU available at $0.60+/hr

For both, your repo needs:

  • requirements.txt (or pyproject.toml for Streamlit)
  • An entry file (app.py or streamlit_app.py)
  • A .gitignore excluding .env, chroma_db/, data/

For Spaces, also a README.md with frontmatter:

---
title: My PDF Chatbot
sdk: streamlit
sdk_version: 1.40.0
app_file: app.py
---

Visualize it

Side-by-side screenshots of both deployment dashboards with annotated secret-management areas.

Try it now

Deploy your Module 6 chatbot to Streamlit Cloud. Deploy your Module 9 PDF chatbot to Hugging Face Spaces.

Hands-on lab

Both deploys, both URLs in your README.

Try it now

When is Hugging Face Spaces preferable for a heavy model?

Common mistakes

  • Hardcoding secrets (free tier scanners catch them quickly)
  • Missing requirements.txt
  • Forgetting that ChromaDB persistence is ephemeral on free tiers (use external storage or accept it)

Debugging tip

If your free-tier deploy keeps "sleeping" mid-demo, switch to a different platform or pay for an always-on tier when demoing to recruiters.

Challenge

Add an "Embeddings on device" mode using sentence-transformers and deploy it to HF Spaces.

Where this shows up

  • AI demos
  • Open-source community tools
  • Hobby projects

From the field

Many open-source AI projects in 2026 maintain both a Streamlit Cloud and an HF Spaces deploy for redundancy and reach.

Recap

Both are free, GitHub-integrated, beginner-friendly. Master both.


Quick recall

3 prompts · think before you flip

Prompt 1 of 3

Where do you set secrets on Streamlit Cloud?

Quiz time

1 question · tap an answer to check it

  1. 1. To deploy a Gradio app for free with GPU access on demand, choose

Finished lesson 10.2?

Mark complete to update your module progress and unlock the streak.

Loading