Back to Events
Past Main or above

Deploying an Agent to AWS Lambda

May 5, 2026, 02:00 Europe/Berlin

Continue with the workshop writeup

Open the canonical pages, recording, materials, and code repo.

View workshop writeup

We start from the FastAPI service we deployed to Railway in the previous workshop. We strip out FastAPI and swap it for a custom AWS Lambda runtime. The runtime handles both the static frontend and the streaming agent API. We deploy one container image as a Lambda Function URL with SSE streaming.

A coding agent (Codex) does most of the code-writing, and the exact prompts I used are quoted verbatim.

This was a freestyle session, so it also surfaces a fair amount of meta-discussion. We cover how to work with agents, when to trust them, and when to slow down and read the code.

Links

These materials are related:

The shift versus the previous workshop

Here's where Lambda fits in the request path:

flowchart LR UI["Frontend UI vanilla JS, SSE"] LAMBDA["Lambda Function URL"] RUNTIME["Custom Lambda runtime backend/lambda_runtime.py"] AGENT["Agent loop"] SEARCH["FAQ search tool minsearch"] OPENAI["OpenAI Responses API"] UI -->|GET / and assets| LAMBDA UI -->|POST /ask, /ask/stream| LAMBDA LAMBDA --> RUNTIME RUNTIME --> AGENT AGENT -->|tool call| SEARCH AGENT -->|model call| OPENAI RUNTIME -->|JSON or streamed SSE| LAMBDA

The agent loop, the search tool, the renderer abstraction, and the frontend are unchanged from the previous workshop.

We change the web layer and the deployment pipeline:

  • FastAPI is gone. A custom Lambda runtime (backend/lambda_runtime.py) handles routing, static file serving, and SSE streaming directly against the Lambda Runtime API.
  • The Dockerfile is rebased on public.ecr.aws/lambda/python:3.14 instead of python:3.14-slim.
  • The ./deploy.sh script handles deployment. It builds a container image and pushes it to ECR. Then it deploys a CloudFormation stack that creates the Lambda function and a Function URL with RESPONSE_STREAM invoke mode.
  • Railway and the GitHub Actions promotion workflow are gone.

Moving to Lambda changes what you pay for. With Railway or Render you pay for a server that has to be up all the time. With a Lambda Function URL you only pay per invocation, which fits tools and small agents that run occasionally.

Extra material

Additional pages outside the main flow:

Hosted by

Alexey Grigorev

Alexey Grigorev

Chief Agent Officer at AI Shipping Labs

Software engineer and machine learning practitioner with 15+ years of experience building production ML systems. I focus on practical, production-grade ML and AI systems, from early prototypes to reliable systems in production.

I'm the founder of DataTalks.Club, a free community that connects tens of thousands of practitioners worldwide, and the creator of the Zoomcamp series, free, code-first programs that have reached 100,000+ learners globally.

At AI Shipping Labs, I'm building the kind of environment that would have accelerated my own career growth. After years of teaching at scale, I wanted something more focused: a space for action-oriented builders who want to turn AI ideas into real projects. The community gives members the structure, accountability, and peer support to ship practical AI products consistently, even alongside their main jobs.

alexey@aishippinglabs.com