Install all the requirements in virtual env of your choice (using conda, virtualenv or plain pip)
pip install -r requirements.txt
Supply env variables for the DB
export PGHOST=localhost
export PGUSER=postgres
export PGPASSWORD=passwd
export PGDATABASE=ira
Supply env variables related to OpenAI and Pinecone:
export OPENAI_API_KEY=sk-xxxx
export HUGGINGFACE_API_KEY=hf_xxxx
export AUTH_KEY="random-admin-key"
export BASE_URL=http://localhost:8083
export VECTORSTORE=pinecone
export ENV_PREFIX=local
export PINECONE_ENVIRONMENT=asia-southeast1-gcp
export PINECONE_API_KEY=api-key
export PINECONE_INDEX=hotline-dev
export LLM_MODEL_NAME=gpt-3.5-turbo
export ENGINE_TYPE=langchain
Better keep all these variables together locally in one file like ~/.irarc to be able to activate it with one command:
. ~/.irarc
python ira_chat/main.py
DEBUG_DB=true python ira_chat/main.py
DEBUG_PROMPT=true python ira_chat/main.py
Before the start, it needs to create a first organization with a domain to be able to access the API:
org_name=my-local-org
psql ira -c "INSERT INTO organizations (name, display_name, created_at, updated_at) values ('$org_name', '$org_name', now(), now())"
psql ira -c "INSERT INTO organization_domains (domain, org_id) values ('$org_name.localhost', (select id from organizations where name = '$org_name'))"
In order to access the organization locally with domain in form xxx.localhost, this host must be added into the
/etc/hosts file, add this to the end:
127.0.0.1 my-local-org.localhost
Now the API server is available at http://localhost:8083 and
the organization API is available at http://my-local-org.localhost:8083
docker run -it --rm -e PGHOST=192.168.88.54 -e PGUSER=postgres -e PGPASSWORD=passwd \
-e PGDATABASE=ira kuberlab/ira-chat-api:latest
Swagger documentation is at http://localhost:8083/docs
Content type
Image
Digest
sha256:ac9c739b4…
Size
645.7 MB
Last updated
1 day ago
docker pull kuberlab/ira-chat-api