Deploying for free
Shipping AI Apps · 10 questions
Short notes
Key idea
You can put a demo AI app online at no cost on free hosting tiers. Pick the platform by what you're shipping (a Streamlit or Gradio demo, or an API), and be clear about the free tier's limits: sleeping apps, small memory and usage caps.
Syntax
Typical free options:
- Streamlit Community Cloud: connect a GitHub repo with a Streamlit app; add secrets in settings.
- Hugging Face Spaces: Gradio, Streamlit or Docker apps, with free CPU.
- Render / similar: web services from a repo; free instances sleep when idle.
- Google Cloud Run: a container with a monthly free allowance, scaling to zero.
Checklist: requirements.txt pinned, secrets set on the platform, a health check, a README with the link.
Example
A Streamlit RAG demo goes on Community Cloud: push to GitHub, choose the repo and app.py, paste the API key into Secrets. A shareable link for your portfolio in about 10 minutes.
Traps
- API keys committed to a public repo are found by bots fast; use the platform's secrets.
- Free apps sleep; the first visitor waits for a cold start.
- A public demo can run up your LLM bill; add rate limits and a spending cap.
- Large models won't fit in free memory; call an API instead.
Want the full lesson with step-by-step examples, a project and a certificate? Shipping AI Apps course, ₹180 →
- Question 1easy
In the free deployment from this lesson, which part holds the Gemini API key?
- Question 2easy
Where should the API key be set for the deployed API?
- Question 3medium
Which start command lets a hosting platform reach your FastAPI app?
- Question 4medium
Your free API answers the first question after a quiet hour in 50 seconds, then quickly. What's happening?
- Question 5hard
Write
allow(visitor, now)that keeps a list of request times per visitor, drops times older than 60 seconds, and returns False if 3 or more remain (otherwise recordsnowand returns True). Store the results forrequestsinresult.Store your answer in
result.
Deploying for free
Deploying for free
Deploying for free
Deploying for free
Deploying for free
5 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.