Python version 3.11+ and Docker are required.
-
Ensure the
ENVvariable in.envis set to"LOCAL".Set
OPENAI_API_KEYto your OpenAI API key.Optionally, change the
DB_PASSWORD. -
In your terminal, run the following commands:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt docker-compose -f docker-compose-db.yml up -d chmod +x startup.sh ./startup.sh init-db -
In your web browser, go to the chat interface address:
http://0.0.0.0:8000.
- To update the web app with new changes, press
CTRL+Cin the terminal to end the process, then re-run./startup.sh. - To reinitialize the database, run
./startup.shwith theinit-dbflag:./startup.sh init-db.
Docker is required. Note that at the moment, this fully Dockerized version does not perform as well as the development version above and is not recommended.
-
Ensure the
ENVvariable in.envis set to"DOCKER".Set
OPENAI_API_KEYto your OpenAI API key.Optionally, change the
DB_PASSWORD. -
In your terminal, run the following command:
INIT_DB=true docker-compose up --build -
In your web browser, go to the chat interface address:
http://0.0.0.0:8000.
- To update the web app with new changes, run
docker-compose down, thendocker-compose up.
- Simply type a message to the LLM in the bottom box, then press
ENTERor click the send icon.
-
The system prompt for the LLM can be customized by modifying the
system_prompt.txtfile. -
The LLM, parameters, and models used for classification tasks can be customized in the
.envfile.Moderation Info: Moderation results for the message. Dependent classes on a scale 0-1.Topic Classification Info: Topic classification results for the message. Independent classes on a scale 0-1. -
The
MESSAGE_HISTORY_LIMITvariable in the.envfile can be tuned to adjust the "memory" capabilities of the LLM. It defines the number of message exchanges that are kept in the context window. The total number of messages is 2x this value.
User information and chat history are stored in a PostgreSQL database.
-
Use database viewer (such as PgAdmin) to connect to the database.
-
Set the connection parameters using the following
.envvariables:Hostname/address:
DB_HOST_LOCALPort:
DB_HOST_PORTUsername:
DB_USERPassword:
DB_PASSWORD -
Connect to the database.
- The users table contains user profile data.
- The message_history table contains chat message history data.
