Professional Documents
Culture Documents
vm setup for chatbot oracle
vm setup for chatbot oracle
vm setup for chatbot oracle
Unauthorized reproduction or distribution prohibited. Copyright© 2024, Oracle University and/or its affiliates.
The chatbot code is developed using the PyCharm IDE community edition. PyCharm allows
creating Projects. Each project is a virtual environment in which required libraries can be
installed. It also has a PythonTerminal from where the server can be run.
Steps Purpose
Install libraries using Python Packages tab. Install following libraries,
a
pip install oci
as
pip install oracle-ads
)h
pip install langchain
pip install chromadb
. om
pip install faiss-cpu
ide a.c
pip install streamlit
pip install python-multipart
Gu indr
pip install pydantic
pip install pypdf
us ch ed
his ah
Setup the Generative AI service access Download the private key and config files
to te ay
et m
from IAM , User section and copy these to
se d@ il S
.oci folder in your local home directory.
Create Chroma server Open demo-chroma-create.py and run it.
en ye m
Running Chroma Server To run the chroma server use the following
lic sa am
Running Streamlit application To run the files that use Streamlit use the
fer ub ed
The OU Chatbot can be deployed on the Ubuntu server with 1 OCPUs and 64 GB RAM.
a
Virtual machine, 1 core OCPU, 64 GB memory, 2 Gbps
as
network bandwidth.
)h
Download the ssh key for the VM and save it as ubuntu-
. om
vm-priv.key
Download IAM user private Download the IAM user private key and config from OCI
ide a.c
key and config file to account to local machine.
<<local-path>>/.oci directory
Gu indr
scp to .oci folder using scp. scp -r -I <<local-path>>/ubuntu-vm-priv.key <local-
us ch ed
his ah
path>/.oci/* ubuntu@<ip of your
to te ay
vm>:/home/ubuntu/.oci/
et m
ssh -i ubuntu-vm-priv.key ubuntu@<ip of your vm>
se d@ il S
login into the server
Create a src folder into the mkdir src
en ye m
(/home/ubuntu)
Copy code and data files – scp -r -i /<local-path>/ubuntu-vm-priv.key
le ak. uz
/<local-path>/demo-ou-chatbot-chroma-final.py
ab ar M
scp -r -i /<local-path>/ubuntu-vm-priv.key
tra m m
<local-path> /demo-chroma-create.py
n- m ha
scp -r -i /<local-path>/ubuntu-vm-priv.key
<local-path>/pdf-docs/*
ubuntu@<ip of your vm>:/home/ubuntu/src/pdf-
m
ed
docs/
Upgrade Ubuntu packages sudo apt update && sudo apt upgrade
mm
a
Run Chroma server nohup chroma run --path ./chromadb >> chroma.log &
as
)h
Run server that will accept cd src
user input and return response
. om
nohup streamlit run demo-ou-chatbot-chroma-final.py &
ide a.c
Test the server http://<ip addr of the server>:8501
Gu indr
us ch ed
his ah
to te ay
et m
se d@ il S
en ye m
lic sa am
le ak. uz
ab ar M
fer ub ed
ns ilm m
tra m m
n- m ha
no uza Mo
m
ed
mm
o ha
(m