Terraform scripts to deploy in OCI a document Q&A app with langchain framework, Opensearch as vector store and Cohere AI as the LLM.
The app have endpoints to call REST services or you can use the gradio interface with the same functionality.
- Terraform
- ssh-keygen
-
Follow the instructions to add the authentication to your tenant https://medium.com/@carlgira/install-oci-cli-and-configure-a-default-profile-802cc61abd4f.
-
Clone this repository:
git clone https://github.com/anshoracle/oci-genai-document-qna
-
Set three variables in your path.
- The tenancy OCID,
- The comparment OCID where the instance will be created.
- A cohere token.
- The "Region Identifier" of region of your tenancy.
export TF_VAR_tenancy_ocid='<tenancy-ocid>'
export TF_VAR_compartment_ocid='<comparment-ocid>'
export TF_VAR_cohere_token='<cohere-token>'
export TF_VAR_region='<oci-region>'
- If you're using a Linux OS, you may need to execute the following command to obtain execution permissions on the shell script:
chmod a+x generate-keys.sh
- Execute the script generate-keys.sh to generate private key to access the instance.
sh generate-keys.sh
To build the terraform solution, simply execute:
terraform init
terraform plan
terraform apply
Create a tunel to the machine like this.
ssh -i server.key -L 7860:localhost:7860 opc@<ip-address>
- Author - Carlos Giraldo, Oracle
- Author - Anshuman Panda, Oracle
- Last Updated Date - September 26th, 2023