2

I followed the aws documentation ( https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints-create.html#serverless-endpoints-create-config) to create a model and to use that model, i coded for a serverless endpoint config (sample code below) ,I have all the required values but this throws an error below and i'm not sure why

parameter validation failed unknown parameter inProductVariants [ 0 ]: "ServerlessConfig", must be one of : VairantName, ModelName, InitialInstanceCount , Instancetype...

response = client.create_endpoint_config(
   EndpointConfigName="abc",
   ProductionVariants=[
        {
            "ModelName": "foo",
            "VariantName": "variant-1",
            "ServerlessConfig": {
                "MemorySizeInMB": 1024,
                "MaxConcurrency": 2
            }
        } 
    ]
)

1 Answer 1

1

You are probably using old boto3 version. ServerlessConfig is a very new configuration option. You need to upgrade to the latest version (1.21.1) if possible.

Sign up to request clarification or add additional context in comments.

4 Comments

I'm doing this via lambda, with and import boto3 in my python code
@ozil boto3 in lambda is limited. It is not like the "real" boto3. You can check what version you have using print(boto3.__version__). You have to bundle your own boto3 or use container lambda with new boto3.
thanks, can you point to me any examples on how to use real boto3
@ozil The easiest way is to add it as a layer. There are prebuild public layers here (github.com/keithrozario/Klayers) which include boto3. You have to find boto3 layer arn for your region and python version, and add it to your function. I see it still not the newest version possible, but maybe it is new enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.