TheLion-ai / Chattum

Other
8 stars 0 forks source link
logo

Chattum

Open-source bot platform based on Large Language Models

contributors last update license

View Demo · Report Bug · Request Feature


🤩 About the Project

Warning: This project is currently in alpha stage and may be subject to major changes

:camera: Demo

https://github.com/TheLion-ai/Chattum/assets/12778421/93dbf48e-9f03-47ed-9a0b-ac9899fedb3a

:space_invader: Tech Stack

Frontend
Backend
Database
DevOps

:toolbox: Getting Started

:bangbang: Prerequisites

Standalone deployment

:key: Environment Variables

To run this project, you will need to add the following environment variables to your .env file

MONGODB_URL = mongodb://<mongo_username>:<mongo_pass>@mongo:27017 #based on following
MONGO_INITDB_ROOT_PASSWORD = <mongo_username> #choose anything
MONGO_INITDB_ROOT_USERNAME = <mongo_pass> #choose anything

S3_ENDPOINT = 'http://minio:9000'
S3_BUCKET = <bucket_name> #choose anything e.g "chattum"
S3_ACCESS_KEY = <s3_access_key> #choose anything
S3_SECRET_KEY= <s3_access_key> #choose anything

OPENAI_API_KEY = <your_api_key> #for embeddings
API_KEY = <api_key> "choose anything, used for API protection"

:gear: Running the aplication

Run the app using docker-compose

docker-compose --env-file .env --profile standalone up

To visit the FastAPI documentation of the resulting service, visithttp://localhost:8000/docs with a web browser.

To access the UI, visit http://localhost:8501.

Logs can be inspected via:

docker-compose logs

Using external mongo datastabse

:key: Environment Variables

set your connection string in the env .env file

MONGODB_URL = <your_mongo_uri>

You can skip MONGO_INITDB_ROOT_PASSWORD and MONGO_INITDB_ROOT_USERNAMEas those variables are only important for mongo container that we will not hese

:gear: Running the aplication

Run the app using docker-compose

docker-compose --env-file .env --profile minio up

Using external s3 compatible service

:key: Environment Variables

set your s3 creditionals string in the .env file

S3_ENDPOINT = <s3_endpoint> #your s3 endpoint
S3_BUCKET = <bucket_name> # your bucket name
S3_ACCESS_KEY = <s3_access_key> #your access key id
S3_SECRET_KEY= <s3_access_key> #your secret access key

:gear: Running the aplication

Run the app using docker-compose

docker-compose --env-file .env --profile mongo up

Using both exteral mongo database and s3 service

:key: Environment Variables

Set your env variables for both s3 and mongo as described above

:gear: Running the aplication

Run the app using docker-compose

docker-compose --env-file .env up

:compass: Roadmap

:wave: Contributors

Contributions are always welcome!

:handshake: Contact

Aleksander Obuchowski

TheLion.AI

Development

Pre-commits

Install pre-commits https://pre-commit.com/#installation

If you are using VS-code install the extention https://marketplace.visualstudio.com/items?itemName=MarkLarah.pre-commit-vscode

To make a dry-run of the pre-commits to see if your code passes run

pre-commit run --all-files

Adding python packages

Dependencies are handeled by poetry framework, to add new dependency run

poetry add <package_name>

inside the /frontend or /backend directory

Debugging

To modify and debug the app, development in containers can be useful .

Testing

run_tests.sh

Running the aplication without docker

Frontend

Modify the BACKEND_URL variable in constants.py to localhost:5000

cd frontend

poetry install

poetry run poetry run streamlit run ui.py

Backend

cd backend

poetry install

poetry poetry run uvicorn api:app --host 0.0.0.0 --port 5000 --reload