Invoking an Amazon SageMaker model endpoint with the SageMakerRuntime client from boto3
With our model deployed in an inference endpoint using the SageMaker hosting services, we can now use the SageMakerRuntime
client from boto3
to invoke the endpoint. This will help us to invoke the SageMaker inference endpoint within any application code using boto3
or a similar SDK. For example, we can use this in an AWS Lambda function with Amazon API Gateway to build a serverless API endpoint that accepts an HTTP request containing the number of months of management experience of a professional and returns a response with the predicted monthly salary of that individual.
In this recipe, we will use the invoke_endpoint()
function from the SageMakerRuntime
client from boto3
to trigger an existing SageMaker inference endpoint. We can use the deployed endpoint from the Deploying your first model in Python recipe.
Getting ready
This recipe continues on from Deploying your first model in Python...