Installing GPT Gateway / LLM with Local AI (public)
Deploying on AWS
Use Deep Learning Base OSS Nvidia Driver GPU AMI.
See image description to make sure it supports desired instance. e.g. G4dn or G6.
Take most recent option, usually released in last month. - date at end of image name. E.g. 20240520.Gateway: Select G4dn.xlarge for Gateway or similar
LLm - Select G6.xlarge for LLM or similarSelect a key pair you have access to or create a new one
Put in same VPC as other servers for the environment
See below for security group port requirements
110GB suggested SSD GP3 disk size
Gateway Only
docker login -u businessgpt -p dckr_pat_R1ru2t8mOxClFjkBHjFp_ZGvesc
Open port 8080/443 for Gateway API, 5432 for PostgreSQL (if using multiple gateway servers)
Put docker-compose.yml and compose.override.yml user home directory.
You can use an alternate override file (e.g. compose.override.GatewayInOne.yml), but make sure to rename it to compose.override.yml.
Put gateway-local-llm.env and postgresql.conf in the same directory and configure with relevant settings. If you forget to copy the postgresql.conf file, you’ll need to delete the postgres volume and restart the container.
LLM Only
Open port 5000 for API
Put docker-compose-llm.yml in user home directory. Rename it to docker-compose.yml.
Run “docker compose up -d” and fix any errors.
Create a service that runs docker compose on startup.
Modify docker-compose-app.service working directory to point to the path where the Gateway docker compose file is located.
E.g.WorkingDirectory=/home/<your-user>/gateway
Put docker-compose-app.service in user home directory.
sudo cp /home/ubuntu/docker-compose-app.service /etc/systemd/system/docker-compose-app.servicesudo systemctl daemon-reload
sudo systemctl start docker-compose-app.service
sudo systemctl enable docker-compose-app.serviceValidating deployment
nvidia-smi
docker stats
docker compose logs --tail=50 -f
sudo cp /var/lib/docker/volumes/ubuntu_gateway-data/_data/logs/gatewayQueueDocs/Gateway_2024-08-01.log .
Remove unused CUDA versions to clear disk space
sudo rm -rf /usr/local/cuda-12.3
sudo rm -rf /usr/local/cuda-12.5
sudo rm -rf /usr/local/cuda-12.6
Remove stopped containers and all unused images
docker system prune -a