From da4b150398f9e7790ed9c33e831441f1ddcf32a0 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 7 Mar 2024 16:49:39 -0800 Subject: [PATCH 1/4] (feat) init cloud form stack --- deploy/just_ec2.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 deploy/just_ec2.yaml diff --git a/deploy/just_ec2.yaml b/deploy/just_ec2.yaml new file mode 100644 index 00000000000..5c51233ddaf --- /dev/null +++ b/deploy/just_ec2.yaml @@ -0,0 +1,8 @@ +--- +Resources: + MyEC2Instance: + Type: "AWS::EC2::Instance" + Properties: + AvailabilityZone: "us-east-1a" + ImageId: "ami-0f403e3180720dd7e" # Replace with your desired AMI ID + InstanceType: "t2.micro" From 702e46b53d4f7a130eab4d0e6480291037896290 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 7 Mar 2024 17:50:14 -0800 Subject: [PATCH 2/4] (build) stack with db --- deploy/just_ec2.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy/just_ec2.yaml b/deploy/just_ec2.yaml index 5c51233ddaf..3097b6be0f0 100644 --- a/deploy/just_ec2.yaml +++ b/deploy/just_ec2.yaml @@ -1,8 +1,17 @@ --- Resources: - MyEC2Instance: + LiteLLMServer: Type: "AWS::EC2::Instance" Properties: AvailabilityZone: "us-east-1a" ImageId: "ami-0f403e3180720dd7e" # Replace with your desired AMI ID InstanceType: "t2.micro" + LiteLLMDB: + Type: "AWS::RDS::DBInstance" + Properties: + AllocatedStorage: 5 + Engine: "postgres" + MasterUsername: "litellmAdmin" # Replace with your desired master username + MasterUserPassword: "litellmPassword" # Replace with your desired secure password + DBInstanceClass: "db.t3.micro" + AvailabilityZone: "us-east-1a" From 2f960a965123b7bb73bffd5a86c3c9c3a36a2847 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 7 Mar 2024 17:51:12 -0800 Subject: [PATCH 3/4] (feat) auto-scale --- deploy/just_ec2.yaml | 49 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/deploy/just_ec2.yaml b/deploy/just_ec2.yaml index 3097b6be0f0..97060b6c3a7 100644 --- a/deploy/just_ec2.yaml +++ b/deploy/just_ec2.yaml @@ -1,17 +1,44 @@ ---- Resources: LiteLLMServer: - Type: "AWS::EC2::Instance" + Type: AWS::EC2::Instance Properties: - AvailabilityZone: "us-east-1a" - ImageId: "ami-0f403e3180720dd7e" # Replace with your desired AMI ID - InstanceType: "t2.micro" + AvailabilityZone: us-east-1a + ImageId: ami-0f403e3180720dd7e + InstanceType: t2.micro + + LiteLLMServerAutoScalingGroup: + Type: AWS::AutoScaling::AutoScalingGroup + Properties: + AvailabilityZones: + - us-east-1a + LaunchConfigurationName: !Ref LiteLLMServerLaunchConfig + MinSize: 1 + MaxSize: 3 + DesiredCapacity: 1 + HealthCheckGracePeriod: 300 + + LiteLLMServerLaunchConfig: + Type: AWS::AutoScaling::LaunchConfiguration + Properties: + ImageId: ami-0f403e3180720dd7e # Replace with your desired AMI ID + InstanceType: t2.micro + + LiteLLMServerScalingPolicy: + Type: AWS::AutoScaling::ScalingPolicy + Properties: + AutoScalingGroupName: !Ref LiteLLMServerAutoScalingGroup + PolicyType: TargetTrackingScaling + TargetTrackingConfiguration: + PredefinedMetricSpecification: + PredefinedMetricType: ASGCPUUtilization + TargetValue: 60.0 + LiteLLMDB: - Type: "AWS::RDS::DBInstance" + Type: AWS::RDS::DBInstance Properties: AllocatedStorage: 5 - Engine: "postgres" - MasterUsername: "litellmAdmin" # Replace with your desired master username - MasterUserPassword: "litellmPassword" # Replace with your desired secure password - DBInstanceClass: "db.t3.micro" - AvailabilityZone: "us-east-1a" + Engine: postgres + MasterUsername: litellmAdmin + MasterUserPassword: litellmPassword + DBInstanceClass: db.t3.micro + AvailabilityZone: us-east-1a \ No newline at end of file From 323f15aa2f6146f80e826019c431cf687e13091b Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 7 Mar 2024 18:06:59 -0800 Subject: [PATCH 4/4] (fix) litellm cloud formation stack --- .../cloudformation_stack/litellm.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename deploy/just_ec2.yaml => enterprise/cloudformation_stack/litellm.yaml (93%) diff --git a/deploy/just_ec2.yaml b/enterprise/cloudformation_stack/litellm.yaml similarity index 93% rename from deploy/just_ec2.yaml rename to enterprise/cloudformation_stack/litellm.yaml index 97060b6c3a7..c30956b9451 100644 --- a/deploy/just_ec2.yaml +++ b/enterprise/cloudformation_stack/litellm.yaml @@ -30,13 +30,13 @@ Resources: PolicyType: TargetTrackingScaling TargetTrackingConfiguration: PredefinedMetricSpecification: - PredefinedMetricType: ASGCPUUtilization + PredefinedMetricType: ASGAverageCPUUtilization TargetValue: 60.0 LiteLLMDB: Type: AWS::RDS::DBInstance Properties: - AllocatedStorage: 5 + AllocatedStorage: 20 Engine: postgres MasterUsername: litellmAdmin MasterUserPassword: litellmPassword