Run and deploy a GPT-4 powered chatbot in minutes!
Utilizes ChromaDB for its vectorstore, with a Next.js frontend.
Install Docker Desktop for your platform.
Clone the repo or download the ZIP
git clone [github https url]
First run npm install yarn -g to install yarn globally (if you haven't already).
Then run:
yarn install
After installation, you should now see a node_modules folder.
.env file.env.example into .env
Your .env file should look like this:OPENAI_API_KEY=
CHROMA_AUTH_BASIC=
CHROMA_AUTH_TOKEN=
CHROMA_URL=
COLLECTION_NAME=[optional]
.env file.Depending on your setup, you may need to modify app/api/files/utilities.ts to connect to the right ChromaDB instance.
In a new terminal window, run Chroma in the Docker container:
docker run -p 8000:8000 ghcr.io/chroma-core/chroma:latest
You can run the app with npm run dev to launch the local dev environment, and then upload one or many PDF files to chat with. After uploading, you'll be able to chat with the model.
The terraform folder contains scripts originally from chromadb/examples. To deploy your ChromaDB to GCP, do as follows:
Install GCP CLI, log in via CLI, and create a new project. Note the project ID.
Install terraform CLI.
Update terraform/exportapply.sh with your project ID variable.
(Optional) Generate a keypair if you want to be able to SSH in to the GCP instance.
Run exportapply.sh in your terminal.
Run terraform output instance_public_ip. Take note of the output IP, and update your .env.
Run terraform output chroma_auth_token. Take note of your auth token, and update your .env.
(optional) It takes some time for the GCP instance to come up, so you can check on the status with
% export instance_public_ip=$(terraform output instance_public_ip | sed 's/"//g')
% curl -v http://$instance_public_ip:8000/api/v1/heartbeat
In general, keep an eye out in the issues and discussions section of this repo for solutions.
General errors
node -vConsole.log the env variables and make sure they are exposed..env file that contains your valid (and working) API keys, environment and index name.modelName in OpenAI, make sure you have access to the api for the appropriate model.env file from the project will be overwritten by systems env variable.process.env variables if there are still issues.Originally forked from https://github.com/mayooear/gpt4-pdf-chatbot-langchain/tree/feat/chroma