This repository hosts a retrieval QA solution for WPVH Eindhoven AI chat, developed using the Mistral LLM model via the Ollama application.
Demo: https://vimeo.com/907558591/310a7a27d4
-
Install Ollama: Visit Ollama.ai to install Ollama. For Windows, use the Docker version. You can find a tutorial here and the Docker image here.
-
Clone this Repository: Use
git clone
to download this repository. -
Navigate to the Directory: Use
cd vhubRetrievalQA
to navigate to the relevant directory. -
Create a System Prompt for the LLM Model: Run
ollama create vhubAgent -f ./Modelfile
inside the directory. Skip this step for Windows. -
Run Ollama: Use
docker exec -it ollama ollama run vhubAgent
for Docker ordocker exec -it ollama ollama run mistral
for Windows. -
Open a New Terminal Window: Navigate to the same directory using
cd vhubretrievalqa
. -
Enter Your Credentials: Open
keys.py
and enter your username and password for the vhub delta API. -
Run the Data Server: Execute
python dataServerWithRoomsCSVNew.py
. -
Run the Retrieval QA Server: Open a new terminal window and run
python ollamaWithDataCSV.py
.
The above steps will launch a chat accessible at localhost:5003
. Use the app to chat about data from WPVH sensors. The chat history is displayed, but the model is not aware of it.
- Use the
clear data
button to prevent overwhelming the data server. After clearing, some time will be needed to fill the dataframe with new values. - The code uses threads, limited to 100, keeping the number of actively updating sensors around 100. If you increase this number in
dataServerWithRoomsCSVNew
by changingsemaphore = threading.Semaphore(100)
, it will become more demanding. There are 191 sensors in thesensor_list.txt
file. To get all of them concurrently updating, the Semaphore Object must also reach 191. However, this number creates too many concurrent threads and causes bugs in the program, such as saving wrong values and injecting empty values into the dataframe.
For deployment options and requirements, refer to this Google Document.