Steps to work on the ChatBot
-
This project is developed in GCP VM instance. Follow the steps from connect_vm_ssh.md to connect local VS code using SSH tunneling.
-
Clone this repo -
git clone https://github.com/jivaniyash/llama_cpp-chatbot.git
-
Create Virtual Env inside VM
sudo apt update sudo apt install virtualenv cd ./project virtualenv <env_name> source <env_name>/bin/activate # to activate environment
-
Install Dependencies
pip install -r requirements.txt -q
-
Run
streamlit run ./app.py
. It will start a UI interface running on default port3501
-
There are 3 LLMs explored which can be used in devices running on CPUs
-
Logs are recorded in
./logs/logs-<date-time>.log
file to debug the application. -
tools.py
contains functions accepted by the LLM format -
UI interface
- Select Model from Left Side Panel
- Click on
CLear Message
Button to clear the history & load model - Put a checkbox on
Use Tools
if you want LLM to call functions to call the tool. (Currently, only sample function is added to check the working of the model) - LLM generates a response with
stream=True
which is used for front-end applications to send the assistant prompt to the user as soon as the response is ready to deliver.