Skip to content

UIUC-Chatbot/self-hostable-ai-ta-backend

 
 

Repository files navigation

AI TA Backend for UIUC's Course Assistant Chatbot

A Flask application hosting endpoints for AI TA backend.

License

This project is available under the CC BY-NC 4.0 License which restricts commercial use.

CC BY-NC 4.0 License Image

Commercial Use

For commercial use of this project, you must obtain a separate commercial license. Please contact [email protected] and [email protected] to inquire about commercial licensing terms.

Failure to obtain a commercial license for commercial use is a violation of the terms of this project.

Docker Deployment

  1. Duplicate .env.template and rename it to .env. E.g. cp .env.template .env
  2. Customize your env variables. Your vector database can be either Qdrant and Pinecone. The SQL database can be any of SQLite, Postgres, and Supabase. The object storage can be Minio or AWS S3.
  3. Run Docker Compose docker compose up --build
  4. Navitage to localhost:8000 (or whatever your $FLASK_PORT is)

To customize HTTP port used as the main entrypoint, set the FLASK_PORT variabel in your .env. It defaults to 8000.

Works on version: Docker Compose version v2.27.1-desktop.1

Works on Apple Silicon M1 aarch64, and x86.

🛠️ Technical Architecture

Architecture diagram

Documentation

See docs on https://docs.uiuc.chat

📣 Development

If you're interested in contributing, check out our official developer quickstart.

For local dev:

  1. Rename .env.template to .env and fill in the required variables
  2. Install Python requirements pip install -r requirements.txt
  3. Start the server for development (with live reloads) cd ai_ta_backend then flask --app ai_ta_backend.main:app --debug run --port 8000

Course metadata structure

'text': doc.page_content,
'readable_filename': doc.metadata['readable_filename'],
'course_name ': doc.metadata['course_name'],
's3_path': doc.metadata['s3_path'],
'pagenumber': doc.metadata['pagenumber_or_timestamp'], # this is the recent breaking change!!
# OPTIONAL properties
'url': doc.metadata.get('url'), # wouldn't this error out?
'base_url': doc.metadata.get('base_url'),

About

A self-hostable version of the backend for http://UIUC.chat/.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.8%
  • Jupyter Notebook 1.6%
  • Other 0.6%