Lesson 12.4: Hosting Models on Cloud (Heroku, AWS – Basic Intro)
🔹 Why Host Models on the Cloud?
-
Makes ML models accessible from anywhere via the internet.
-
Supports scalability, allowing multiple users to access your model simultaneously.
-
Enables production-ready applications without relying on local machines.
🔹 Hosting on Heroku (Basic Steps)
-
Install Heroku CLI
-
Prepare Project
-
Include files:
app.py(Flask/Streamlit app),requirements.txt(dependencies),Procfile(specifies command to run app).
Example Procfile:
-
Deploy App
-
Access App
-
App will be live at
https://your-app-name.herokuapp.com
🔹 Hosting on AWS (Basic Overview)
-
Use AWS EC2 (Elastic Compute Cloud)
-
Launch a virtual server to host your ML app.
-
Install Python, Flask/Streamlit, and dependencies.
-
Run your app on a public IP or domain.
-
Other AWS Services
-
AWS SageMaker → Managed service to train, deploy, and monitor ML models.
-
AWS Lambda → Serverless deployment for small ML APIs.
🔹 Advantages
-
Cloud hosting → 24/7 accessibility.
-
Easy to share with users or clients.
-
Scalable → Supports high traffic.
🔹 Limitations
-
Requires internet connection.
-
Some cloud services may incur costs beyond free tiers.
-
Basic setup may need knowledge of Git and cloud consoles.
✅ Quick Recap:
-
Hosting on cloud → Makes your model accessible globally.
-
Heroku → Easy deployment for beginners.
-
AWS → More control, scalable, supports production environments.
