Run on AWS
Let’s run the LLM OS in production on AWS.
AWS Setup
Update Credentials
To run on AWS, you need one of the following:
- The
~/.aws/credentials
file with your AWS credentials - or
AWS_ACCESS_KEY_ID
+AWS_SECRET_ACCESS_KEY
environment variables
To create the credentials file, install the aws cli and run aws configure
Update region and subnets
Add 2 subnets to the workspace/settings.py
file (required for ECS services)
Please check that the subnets belong to the selected aws_region
Update Secrets
Streamlit App Password
Update the streamlit app password in workspace/secrets/prd_app_secrets.yml
RDS database password
Update the RDS database password in workspace/secrets/prd_db_secrets.yml
Create AWS resources
Create AWS resources using:
This will create:
- ECS Cluster for the application.
- ECS Task Definitions and Services that run the application on the ECS cluster.
- LoadBalancer to route traffic to the application.
- Security Groups that control incoming and outgoing traffic.
- Secrets for managing application and database secrets.
- RDS Database for Knowledge Base and Storage.
Press Enter to confirm and grab a cup of coffee while the resources spin up.
- The RDS database takes about 5 minutes to activate.
- These resources are defined in the
workspace/prd_resources.py
file. - Use the ECS console to view services and logs.
- Use the RDS console to view the database instance.
LLM OS App
Open the LoadBalancer DNS provided when creating the Streamlit App
- Enter the
APP_PASSWORD
from theprd_app_secrets.yml
file (default:admin
) - Enter a username.
- Add blog post to knowledge: https://blog.samaltman.com/what-i-wish-someone-had-told-me and ask: what did sam altman wish he knew?
- Test Web search: Whats happening in france?
- Test Calculator: What is 10!
- Test Finance: What is the price of AAPL?
- Test Finance: Write a comparison between nvidia and amd, use all finance tools available and summarize the key points
- Test Research: Write a report on Hashicorp IBM acquisition
LLM OS API
Enable FastApi
Update the workspace/settings.py
file and set prd_api_enabled=True
Create FastApi resources
Press Enter to confirm
View API Endpoints
- Open the LoadBalancer DNS + the
/docs
endpoint to view the API Endpoints. - Test the
v1/assitants/chat
endpoint with
- Integrate with your front-end or product.
Update Production
Follow this guide to update your production application. You'll need to:
- Create a new image
- Update the ECS Task Definition and Services.
Delete AWS resources
Play around and then delete AWS resources using:
or delete individual resource groups using:
Next
Congratulations on running your LLM OS on AWS. Next Steps:
- Read how to update workspace settings
- Read how to create a git repository for your workspace
- Read how to manage the production application
- Read how to format and validate your code
- Read how to add python libraries
- Read how to add a custom domain and HTTPS
- Read how to implement CI/CD
- Chat with us on discord
Was this page helpful?