This application is dockerized. Take a look at Dockerfile to see how it works.
A very simple docker-compose.yml has been included to support local development and deployment. Take a look at docker-compose.yml for more information.
-
Install the version of Python specified in .python-version pyenv is one popular option for installing Python, or asdf.
-
After installing and activating the right version of Python, install poetry and follow the instructions to add poetry to your path if necessary.
curl -sSL https://install.python-poetry.org | python3 -
-
If you are using an M1 mac, you will need to install postgres as well:
brew install postgresql
(The psycopg2-binary is built from source on M1 macs which requires the postgres executable to be present) -
You'll also need Docker Desktop installed and running
Note: Run everything from within the /app
folder:
- Set up an (empty) local secrets file:
touch .env
and copy the provided example Docker override:cp ../docker-compose.override.yml.example ../docker-compose.override.yml
- Download the embedding model into the
models
directory:git clone https://huggingface.co/sentence-transformers/multi-qa-mpnet-base-cos-v1 models/multi-qa-mpnet-base-cos-v1
- Run
make init start
to build the image and start the container. - Navigate to
localhost:8000/chat
to access the Chainlit UI. - Run
make run-logs
to see the logs of the running application container - Run
make stop
when you are done to delete the container.
Now that you're up and running, read the application docs to familiarize yourself with the application.
You can install ollama on macOSX by calling brew install ollama
, for other operating systems or the desktop app see the Ollama repository.
To download a model run ollama pull <model_name>
Ex: ollama pull llama2:7b
To start Ollama without the desktop app run ollama serve
To configure a local secret to enable Ollama locally add OLLAMA_HOST=http://host.docker.internal:11434
to your .env
file.
We use Jupyter notebooks for saving and sharing exploratory code. You can open and run these notebooks (and make a new one) with make notebook
. You will see output like:
To access the server, open this file in a browser:
file:///home/yourusername/.local/share/jupyter/runtime/jpserver-13-open.html
Or copy and paste one of these URLs:
http://20cb9005b18b:8888/tree?token=2d1215943f468b3aefb67b353bf1ff8599cee13c1da74172
http://127.0.0.1:8888/tree?token=2d1215943f468b3aefb67b353bf1ff8599cee13c1da74172
Copy and paste the provided URL that starts with http://127.0.0.1:8888 to access Jupyter.