AWS Lambda layers allow you to package libraries and dependencies that can be shared across multiple Lambda functions. This can help reduce deployment package sizes and make it easier to manage common dependencies across your serverless applications. In this blog post, we'll walk through how to create a Lambda layer for the LangChain library, which can be used for building applications with large language models.
First, we'll need to pull the AWS SAM build image for Python 3.10 from the public Amazon ECR registry. Open your terminal and run:
sudo docker pull public.ecr.aws/sam/build-python3.10:1.110.0-20240222205900