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_KEYetc.) 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(orpyproject.tomlfor Streamlit)- An entry file (
app.pyorstreamlit_app.py) - A
.gitignoreexcluding.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
---
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. 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