Search⌘ K
AI Features

- Model Function

Explore the process of deploying machine learning models as serverless AWS Lambda functions. Learn to package required Python libraries and the model into a zip file, upload it to S3, and configure Lambda runtime settings. Understand how to test functions and include dependencies via Lambda layers for scalable model serving.

In order to author a Lambda function that uses libraries outside the base Python distribution, you’ll need to set up a local environment that defines the function and includes all of the dependencies. Once your function is defined, you can upload the function by creating a zip file of the local environment, uploading the resulting file to S3, and configuring a Lambda function from the file uploaded to S3.

Getting started

The first step in this process is to create a directory with all of the dependencies installed locally.

While it’s possible to perform this process on a local machine, we will perform these tasks in our code widget below to provide a clean Python environment.

Creating the environment

The next step is to install the libraries needed for ...