Deploying Locally Trained Models to SageMaker

Introduction & Lesson Overview

Welcome to your first lesson on deploying models with SageMaker! You've already built a solid foundation by training machine learning models both locally and in the cloud using SageMaker. Now it's time to take the next crucial step in your machine learning journey: making your models available for real-world predictions through deployment.

In this lesson, you'll learn how to deploy a model that you trained on your local machine to a SageMaker endpoint. This is an excellent starting point because you can use the familiar models you've already created while learning the essential deployment concepts that apply to all SageMaker deployments.

By the end of this lesson, you'll understand how to package your local model artifacts, upload them to Amazon S3, configure a SageMaker deployment environment, and create a working endpoint that can serve predictions. This foundational knowledge will prepare you for more advanced deployment scenarios later in the course.

Understanding SageMaker Endpoints

Before we dive into deployment, let's understand what a SageMaker endpoint actually is. Think of an endpoint as a web service that hosts your trained model and can answer prediction requests. It's like having a smart assistant that you can ask questions about your data, and it responds with predictions based on what your model learned during training.

SageMaker offers two main types of endpoints, and choosing the right one depends on your specific needs:

Real-time endpoints work like having a dedicated server that's always running and ready to serve your model. You choose exactly what type of computer (instance type) and how many computers you want, and AWS keeps them running 24/7 just for your model. This gives you very predictable performance - your model will always respond quickly because the resources are always there waiting. However, since these servers run continuously, you pay for them even when nobody is making prediction requests. Think of it like renting a dedicated office space that you pay for whether you're using it or not.

Serverless endpoints are like having a smart assistant that only appears when you need them. You don't need to worry about what type of computer to use or how many - AWS figures all of that out automatically. When someone makes a prediction request, AWS instantly provides the computing power needed. When there are no requests, everything scales down to zero and you don't pay anything. It's like having a taxi service where you only pay when you actually take a ride.

For this lesson, we'll use serverless endpoints because they're much simpler to get started with. You don't need to make decisions about server types or worry about costs when you're not using the endpoint. This lets us focus on learning the core concepts of model deployment without getting distracted by infrastructure details. Plus, serverless endpoints are perfect for learning and experimentation since they automatically handle all the technical complexity behind the scenes.

Sign up

Join the 1M+ learners on CodeSignal

Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal