diff --git a/litellm/proxy/lambda.py b/litellm/proxy/lambda.py new file mode 100644 index 0000000000..6b278c4118 --- /dev/null +++ b/litellm/proxy/lambda.py @@ -0,0 +1,4 @@ +from mangum import Mangum +from litellm.proxy.proxy_server import app + +handler = Mangum(app, lifespan="on") diff --git a/requirements.txt b/requirements.txt index 0abf3ed2b7..345d7ae95d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ pyyaml rq prisma celery -psutil \ No newline at end of file +psutil +mangum \ No newline at end of file diff --git a/template.yaml b/template.yaml index 448cc92411..baa7c2d17a 100644 --- a/template.yaml +++ b/template.yaml @@ -46,7 +46,7 @@ Resources: Properties: FunctionName: !Sub "${AWS::StackName}-llmlite" CodeUri: "./litellm" - Handler: proxy/lambda.lambda_handler + Handler: proxy/lambda.handler Runtime: python3.11 AutoPublishAlias: !Ref AliasParameter Role: !GetAtt LambdaExecutionRole.Arn