Thanks to projects of https://github.com/chatchat-space/Langchain-Chatchat and https://github.com/infiniflow/ragflow Inspired me a lot, so I designed this project to integrate OCI AI Services into this project. Our whole OCI Sehub AI team contributed to this project.
To help customers leverage services in OCI easier.
os should be linux with g++, gcc, cmake with or without GPU
git clone https://github.com/munger1985/kbot.git
cd kbot/
sudo apt update -y
sudo apt install libgl1 -y
sudo apt-get install poppler-utils -y
sudo apt install tesseract-ocr -y
sudo yum install mesa-libGL -y
sudo yum install poppler-utils -y
sudo yum install tesseract -y
conda create -n kbot python=3.10 -y
conda activate kbot
pip install -r req*.txt
config oci api key, and config.py make sure your home directory, e.g. KB_ROOT_PATH should make it right. or auth using instance principal without api key need to add policy below
allow dynamic-group <xxxx> to manage generative-ai-family in tenancy
xxxx is your dynamic-group that indicated your vm or other resources
rename the .secrets.toml.example to .secrets.toml, follow the format and configure your secrets such as vectordb and llms in .secrets.toml
python main.py --port 8899
python main.py --port 8899 --hf_token xxx
python main.py --port 8899 --ssl_keyfile tls.key --ssl_certfile tls.crt
python main.py --port 443 --ssl_keyfile /home/ubuntu/qq/dev.oracle.k8scloud.site.key --ssl_certfile /home/ubuntu/qq/dev.oracle.k8scloud.site.pem
[Unit]
Description=Kbot Service
After=network.target
[Service]
# User and group under which the script should run
User=ubuntu
# The working directory, the directory where main.py locates.
WorkingDirectory=/home/ubuntu/kbot
# the path should be kbot conda environment path, use 'which pip' to get prefix url before /pip
Environment="PATH=/home/ubuntu/.conda/envs/kbot/bin:$PATH"
# The command to execute
ExecStart=/home/ubuntu/anaconda3/envs/kbot/bin/python /home/ubuntu/kbot/main.py
# Restart policy
#Restart=always
#RestartSec=5
# Environment variables (if needed)
[Install]
WantedBy=multi-user.target
You can create a file called kbot.service, put it in /etc/systemd/system
Then you can systemctl start kbot or systemctl stop kbot to control this service up and down.
We have an Apex built frontend, will be released in another repo. you can refer to the swagger document once you started the API server.
docker build -t kbot .
if you don't need oss llm, ignore --hf_token xxx if you dont have gpu, ignore --gpus all
docker run --gpus all -e port=8899 -p 8899:8899 kbot --hf_token <your huggingface token> --port 8899
docker run -e port=8899 -p 8899:8899 kbot --hf_token <your huggingface token> --port 8899
docker run -e port=8899 -p 8899:8899 sin.ocir.io/sehubjapacprod/munger:kbot --port 8899
- -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
the script is in autoStart.sh
crontab -e
@reboot /bin/bash /home/ubuntu/kbot/autoStart.sh
cd kbot export PYTHONPATH=.:$PYTHONPATH fastapi run main.py --root-path /api/v1 --port 8093
contact me or any other oracle staffs jingsong.liu@oracle.com