Skip to content

Instantly share code, notes, and snippets.

@gleeb
Created August 11, 2022 08:13
Show Gist options
  • Save gleeb/26b511e570f82af451dd4ef6ce8f1515 to your computer and use it in GitHub Desktop.
Save gleeb/26b511e570f82af451dd4ef6ce8f1515 to your computer and use it in GitHub Desktop.
sagemaker deploy serverless endpoint
import boto3
sm_client = boto3.client('sagemaker', region_name='us-east-1')
endpoint_config_name = 'titanic-survival-serverless-endpoint-config'
print(endpoint_config_name)
create_endpoint_config_response = sm_client.create_endpoint_config(
EndpointConfigName = endpoint_config_name,
ProductionVariants=[ {
"ModelName": "titanic-survival-v1",
"VariantName": "AllTraffic",
"ServerlessConfig": {
"MemorySizeInMB": 1024,
"MaxConcurrency": 20
}
} ])
endpoint_name = 'titanic-survival-serverless-endpoint'
print("EndpointName={}".format(endpoint_name))
create_endpoint_response = sm_client.create_endpoint(
EndpointName=endpoint_name,
EndpointConfigName=endpoint_config_name)
print(create_endpoint_response['EndpointArn'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment