- Build a SageMaker model package that associates a model artifact (model.tar.gz) with a container image.
- Create an endpoint configuration and endpoint using the Boto3 SDK.
- Create and test an endpoint using the SageMaker SDK and compare using the Predictor / runtime invocation.


- The following code is intended to run in Jupyter Notebook cells in SageMaker Studio.
- It covers: imports, uploading a local model artifact to S3, fetching the correct container image URI, registering the model (model package), creating an endpoint configuration with Boto3, creating the endpoint, waiting for it to become InService, and invoking the endpoint.
sagemaker.image_uris.retrieve to get the correct ECR image URI for the current region.
Model class. Calling model.create() registers this model in SageMaker (visible under Inference -> Models).



sagemaker-runtime). Note: Boto3’s SageMaker client handles creation/describing of endpoints and endpoint configurations; sagemaker-runtime is used for invoking inferences.
If you want granular control over the endpoint configuration and lifecycle, use Boto3 (as shown). The SageMaker Python SDK provides higher-level abstractions for model + endpoint creation and also the Predictor class for inference, which can make development faster and code more concise. Choose the approach that best fits your automation, control, and CI/CD needs.
Creating endpoints incurs AWS costs while instances are running. Use minimal instance sizes for testing, delete endpoints when not in use, and ensure IAM roles used by Studio have just the permissions needed for deployment.
Summary
- Uploaded a local model artifact to S3, retrieved the appropriate container image URI, and registered a SageMaker model package.
- Created an endpoint configuration and endpoint using Boto3, polled until the endpoint became InService, and invoked the endpoint using the SageMaker runtime with CSV input.
- The SageMaker Python SDK provides higher-level operations and a Predictor class for simplified inference flows; comparing both patterns helps determine which integrates best with your automation strategy.
- Amazon SageMaker Documentation
- Boto3 SageMaker client reference
- SageMaker Python SDK documentation
- SageMaker runtime (invoke_endpoint) API