Skip to content
Uditaagarwal1Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Climate Academy Chatbot (Server Deployment)

Project layout

  • src/chatbot/
  • src/chatbot/server.py Flask app factory and routes
  • src/chatbot/config.py centralized environment settings
  • src/chatbot/capacity.py Redis rate-limit and queue controls
  • src/chatbot/llm.py provider adapters (Groq/Gemini/Ollama)
  • src/chatbot/rag.py retrieval and prompt assembly
  • scripts/ingest.py index build script
  • wsgi.py Gunicorn entrypoint
  • deploy/gunicorn.conf.py Gunicorn production config
  • deploy/chatbot.service systemd service template
  • deploy/chatbot-celery.service optional Celery worker systemd template

Quick run (without Docker)

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.py

Optional async worker for queued chat jobs:

PYTHONPATH=src python -m chatbot.celery_worker

Production (Linux server)

  1. Install runtime packages:
sudo apt update
sudo apt install -y python3 python3-venv python3-pip redis-server nginx
  1. 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
  1. Enable Redis:
sudo systemctl enable redis-server
sudo systemctl start redis-server
  1. 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
  1. Install Nginx config:
sudo cp nginx.conf /etc/nginx/nginx.conf
sudo nginx -t
sudo systemctl restart nginx
  1. Open your server URL on port 80.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages