☁️ Lesson 9.4: Deployment Options (Local, Web, Cloud Hosting)
Module 9: Tools, Plugins, and Deployment
Course: Build Your Own AI Chat System (Like ChatGPT or DeepSeek) Using Free Open-Source Tools
🎯 Lesson Objective:
By the end of this lesson, learners will be able to deploy their chatbot in different environments—locally, on the web, or in the cloud—depending on their needs and technical ability.
🧠 Why Deployment Matters
Building a chatbot is great—but deployment is what makes it usable by:
-
Clients
-
Team members
-
Students or the public
Whether you’re showcasing a portfolio, building internal tools, or selling a product, deployment gives your chatbot a real home.
🚀 Deployment Options Overview
| Method | Description | Best For |
|---|---|---|
| Localhost | Runs on your own computer | Development & testing |
| Internal Server / Intranet | Local network deployment | Small teams & private orgs |
| Free Cloud Hosting | Limited cloud usage | Portfolios, MVPs |
| Full Cloud Deployment | Scalable, global access | Businesses & production apps |
1️⃣ Local Deployment (Your Own Computer)
Tools:
-
Streamlit, Gradio, Ollama, LangChain
Steps:
streamlit run app.py
# OR
python chatbot.py
Pros:
-
Free
-
Great for testing
Cons:
-
Only works while your PC is on
-
No public access unless you use tunneling
Bonus Tip: Use ngrok to expose locally:
ngrok http 8501
2️⃣ Team-Only Deployment (Internal Server / LAN)
Host on a Raspberry Pi, Ubuntu server, or virtual machine on your network.
Steps:
-
Install required tools (Python, Ollama, etc.)
-
Run chatbot on a fixed port
-
Access using local IP (e.g.,
192.168.1.100:8501)
Pros:
-
No internet dependency
-
Good for sensitive company data
Cons:
-
Only accessible on same network unless VPN is set up
3️⃣ Free Cloud Hosting Options
| Platform | Supports | Limitations |
|---|---|---|
| Streamlit Cloud | Python/Streamlit apps | Limited compute, 1GB |
| Hugging Face Spaces | Gradio + Streamlit | 3 GB RAM, slow LLMs |
| Render | Web services | Sleep after inactivity |
Example: Deploy to Streamlit Cloud
-
Push your app to GitHub
-
Go to streamlit.io/cloud
-
Connect GitHub repo
-
Add
requirements.txt(e.g., streamlit, langchain, ollama, chromadb) -
Deploy!
4️⃣ Full Cloud Deployment (Production-Ready)
Use platforms like:
-
AWS EC2 + FastAPI
-
DigitalOcean + Docker
-
Railway, Vercel, Heroku (paid plans)
Why Use This:
-
Custom domains (e.g.,
chat.yoursite.com) -
Team collaboration
-
Can scale with user growth
Common Setup:
-
Dockerize your chatbot
-
Add API authentication
-
Use background tasks (e.g., Celery) for async tools
-
Add SSL, monitoring, and autoscaling
🧪 Try It Yourself Activity
Task: Choose one deployment method and put your chatbot online or on a local network.
Optional Challenges:
-
Use ngrok to share your localhost bot temporarily
-
Push to GitHub and deploy via Streamlit Cloud
-
Set up a Raspberry Pi and deploy your AI assistant as a private server for home or office
💡 Tips & Best Practices
-
For quick demos, use Streamlit Cloud or Hugging Face
-
Use
.envfiles for API keys and secrets (never commit to GitHub!) -
Keep
requirements.txtclean and lightweight -
Monitor memory usage, especially if using local LLMs
-
Back up your vector store (Chroma, FAISS) regularly
🧠 Recap:
You’ve now learned how to:
-
Deploy your chatbot locally for personal use
-
Host it privately for a team or internal project
-
Share it publicly using free cloud services
-
Prepare it for scaling on production cloud infrastructure
85
