chatbot-ollama¶
Description¶
This service is a streamlit interface to interact with a large language model using the ollama API and langchain.
Ollama is an open source project that aims to provide a simple and easy to use app to download and use LLM models like llama2 or mistral locally.
On the Ollama official website, you can find the list of available models and the link to the github repository.
Before using this service, you need to vectorize a pdf document using the document-vectorizer service.
Environment variables¶
All environment variables are described in the .env
file.
The environment variables can be overwritten during the CI/CD pipeline described in the workflow.yml
GitHub workflow file.
Start the service locally with Python¶
In the chatbot-ollama
directory, start the service with the following commands.
Start the application.
Access the service app on http://localhost:80.
Start the service locally with minikube and the Docker image hosted on GitHub¶
Start the service with the following commands. This will start the service with the official Docker images that are hosted on GitHub.
In the chatbot-ollama
directory, start the service with the following commands.
Create a tunnel to access the Kubernetes cluster from the local machine. The terminal in which the tunnel is created must stay open.
Access the chatbot-ollama
app on http://localhost:9090/.
Then you must use the document-vectorizer service to vectorize a pdf document before using the chatbot-ollama app. See the document-vectorizer service documentation to deploy it locally.
Deploy ollama locally¶
add the following container to the chatbot-ollama.stateful
deployment file
Start the service locally with minikube and a local Docker image¶
Note: The service StatefulSet (chatbot-ollama.stateful.yml
file) must be deleted and recreated every time a new Docker image is created.
Start the service with the following commands. This will start the service with the a local Docker image for the service.
In the chatbot-ollama
directory, build the Docker image with the following commands.
In the chatbot-ollama
directory, start the service with the following commands.
Create a tunnel to access the Kubernetes cluster from the local machine. The terminal in which the tunnel is created must stay open.
Access the chatbot-ollama
app on http://localhost:9090/docs.
Access the Core engine documentation on http://localhost:8080/docs to validate the backend has been successfully registered to the Core engine.