src/chatbot/src/chatbot/server.pyFlask app factory and routessrc/chatbot/config.pycentralized environment settingssrc/chatbot/capacity.pyRedis rate-limit and queue controlssrc/chatbot/llm.pyprovider adapters (Groq/Gemini/Ollama)src/chatbot/rag.pyretrieval and prompt assemblyscripts/ingest.pyindex build scriptwsgi.pyGunicorn entrypointdeploy/gunicorn.conf.pyGunicorn production configdeploy/chatbot.servicesystemd service templatedeploy/chatbot-celery.serviceoptional Celery worker systemd template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python scripts/ingest.py --html data/climate_academy.html --out index
gunicorn wsgi:app -c deploy/gunicorn.conf.pyOptional async worker for queued chat jobs:
PYTHONPATH=src python -m chatbot.celery_worker- Install runtime packages:
sudo apt update
sudo apt install -y python3 python3-venv python3-pip redis-server nginx- Prepare app:
cd /opt
sudo git clone <your-repo-url> chatbot
cd chatbot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python scripts/ingest.py --html data/climate_academy.html --out index- Enable Redis:
sudo systemctl enable redis-server
sudo systemctl start redis-server- Install systemd service:
sudo cp deploy/chatbot.service /etc/systemd/system/chatbot.service
sudo cp deploy/chatbot-celery.service /etc/systemd/system/chatbot-celery.service
sudo systemctl daemon-reload
sudo systemctl enable chatbot
sudo systemctl start chatbot
sudo systemctl enable chatbot-celery
sudo systemctl start chatbot-celery
sudo systemctl status chatbot
sudo systemctl status chatbot-celery- Install Nginx config:
sudo cp nginx.conf /etc/nginx/nginx.conf
sudo nginx -t
sudo systemctl restart nginx- Open your server URL on port 80.