Skip to main content
This guide is for teams that run training, fine-tuning, or self-hosted inference on Lambda, the GPU cloud formerly called Lambda Labs. It maps On-Demand Cloud instances to Pods, filesystems to network volumes, firewall rules to exposed ports, 1-Click Clusters to Instant Clusters, and Lambda Cloud API calls to the Runpod REST API v2. At the end, your workloads run on Runpod, your data lives on a network volume, and your automation calls Runpod instead of Lambda.
This page is about Lambda the GPU cloud. If you’re moving functions off AWS Lambda, see Migrate from AWS to Runpod.
A coding agent can do most of this migration for you. See Migrate with a coding agent.

How Lambda maps to Runpod

The biggest change is the unit of compute. A Lambda instance is a virtual machine that you configure after it boots. A Runpod Pod is a container that starts from an image, so your environment moves into a Dockerfile or a template. Lambda sunset its hosted Inference API (the shutdown date was September 25, 2025), so this guide covers inference that you host yourself on instances. If you still have code that calls a Lambda-hosted model, Public Endpoints and Serverless vLLM are the Runpod options.

What’s different

What works differently

You get a container, not a VM. On Lambda you have a full virtual machine with its own kernel, systemd, and a Docker daemon. On a Pod, Runpod runs Docker for you and your image’s start command is the container’s main process. That has four practical consequences:
  • Docker and Docker Compose don’t run inside a Pod. If your instance runs docker run or docker compose up, deploy each image as its own Pod, or combine the services into one image with a start script.
  • Services you manage with systemctl need to start from your image’s start command instead. Official Runpod images start SSH and JupyterLab from /start.sh.
  • The container shares the host’s kernel and NVIDIA driver. You pick a host by CUDA version (--min-cuda-version) instead of installing a driver or kernel module.
  • Anything you installed by hand over SSH has to be captured in a Dockerfile, or reinstalled onto /workspace.
A Pod can stop without losing its volume. Lambda instances can be launched, restarted, or terminated, and Lambda’s docs recommend containers and backups to preserve state. A Pod can also be stopped: the GPU is released, the volume disk at /workspace is kept, and you pay for volume storage while it’s stopped. When you start it again, the GPUs on that host may be in use. See zero GPU Pods. Only /workspace persists. On a Lambda instance, the whole root volume lasts until you terminate. On a Pod, the container disk is cleared when the Pod stops, restarts, or has its configuration edited. Keep anything you need on the volume disk or a network volume. Ports are exposed, not firewalled. Lambda opens ports with firewall rules that can restrict the source IP range. A Pod exposes the ports you list, to the public internet, in one of two ways:
  • PORT/http gives you https://POD_ID-PORT.proxy.runpod.net. It’s HTTPS only and has a 100-second response timeout.
  • PORT/tcp gives you a public IP and a mapped external port that usually differs from the internal port. Request a port above 70000 to get matching internal and external ports, and read the assigned port from RUNPOD_TCP_PORT_70000.
SSH connects as root on a mapped port. Instead of ssh ubuntu@INSTANCE_IP, you use ssh root@POD_IP -p EXTERNAL_PORT, or the proxied ssh POD_USER@ssh.runpod.io form. The proxied form gives you a shell only. SCP, SFTP, rsync, and port forwarding need the direct connection. Storage has a provisioned size. A Lambda filesystem has no size to set and bills for the GiB you use. A network volume has a size from 10 GB to 4,096 GB that you choose and can grow later (contact support for more than 4 TB). A global volume (beta) is the usage-billed option on Runpod. Billing is prepaid. Lambda bills in one-minute increments and sends weekly invoices. Runpod bills per second against a credit balance. You need at least one hour of credit for a configuration to deploy it. When your balance reaches $0, Pods with a network volume are stopped and Pods without one are terminated, and a terminated Pod’s data can’t be recovered. Set up auto-pay or low balance notifications before you move production. Clusters start on demand, at a different size range. A 1-Click Cluster is reserved in weeks, covers 16 to 512 H100 or B200 GPUs, and includes three CPU head nodes. An Instant Cluster deploys on demand with 2 to 8 nodes (16 to 64 GPUs) of B200, H200, H100, or A100, and one of the GPU nodes is the primary node. Larger clusters go through Runpod sales. Availability depends on current stock in each data center.

What has no direct equivalent

On Runpod (Lambda features to plan around):
  • Docker, Docker Compose, and kernel access inside the machine. Use one image per Pod. To build images from inside a Pod, see Build Docker images with Bazel, or build in CI and push to a registry.
  • UDP and ICMP. Pods accept TCP and HTTP connections. Move UDP protocols to TCP, or keep that service elsewhere.
  • Source IP allowlists. Exposed ports are reachable by anyone who has the address. Require authentication in your service, keep internal services on global networking without exposing a port, or reach them through an SSH tunnel.
  • ARM instances (GH200). Runpod images must be linux/amd64. Rebuild ARM images for x86-64.
  • Several filesystems on one instance. runpodctl pod create attaches one network volume per Pod. The console attaches one network volume plus one global volume if you need a second mount. REST API v2 accepts up to four network volumes in mounts.network, all in the Pod’s data center, plus one global volume in mounts.global. The simplest plan is to merge your filesystems into one network volume with subdirectories.
  • Managed Kubernetes on a cluster. Instant Clusters come as Slurm, Ray, PyTorch training, or general application clusters. Port Kubernetes workloads to one of those, or to Pods and Serverless endpoints.
  • Fixed vCPU and RAM per instance type. Pod CPU and memory depend on the host. Use the REST v2 placement floors if your job needs a minimum.
On Lambda (Runpod features you can adopt):
  • Scale to zero. A Serverless endpoint runs your image only while requests are in flight. A self-hosted inference server that sits idle on an instance is a good candidate.
  • Stop and resume. Stop a Pod overnight and keep its volume.
  • Hosted models. Public Endpoints serve models over an API with no deployment.
  • Restricted API keys. Lambda API keys have full access to all API operations. Runpod keys can be read-only or restricted.

Requirements

  • A Lambda account with access to the workspaces you’re migrating, and a Lambda Cloud API key.
  • A Runpod account with credits and a Runpod API key.
  • An SSH key pair. You can reuse the public key you already use on Lambda.
  • curl and jq for the inventory commands.
  • Docker on your local machine or in CI, and a container registry, if you build a custom image.

Step 1: Take inventory of what you run on Lambda

Lambda’s docs describe two interfaces, the console and the Cloud API. The API gives you an inventory you can save and diff. Export your key first.
List every running instance with the fields you need to recreate it.
To list the nodes of one 1-Click Cluster, add the cluster_id query parameter. The Lambda API allows about one request per second, so run these commands one at a time. Next, export storage, SSH keys, and firewall configuration.
bytes_used tells you how large each network volume needs to be. Lambda updates it every few hours, so add headroom. The firewall files tell you which ports each workload serves: every TCP rule becomes an exposed port, and every UDP rule or source restriction needs a decision (see What has no direct equivalent). The API doesn’t know what’s installed inside each VM, so capture that over SSH. Run this on each instance you plan to move.
The snapshot is the input for your Dockerfile in Step 4. The environment section prints variable names only, so secret values stay out of that section. It runs in a non-interactive session, so also check ~/.bashrc for variables you export there, and review the container commands in the file before you share it. If you launched instances with cloud-init, find the user_data you passed at launch in your own scripts, because it’s write-only in the API. Finally, find the code and configuration that reference Lambda.
The pattern covers all three API hostnames (cloud.lambda.com, cloud.lambda.ai, and cloud.lambdalabs.com), the filesystem mount path, the S3 Adapter endpoints, and JupyterLab URLs. Also search for hardcoded instance IP addresses and for ubuntu@ in SSH configs and CI scripts.

Step 2: Set up Runpod

Create an account, add credits, and create an API key on the Credentials page. Then install the CLI and register your SSH key.
Lambda attaches exactly one SSH key per launch. Runpod injects every key on your account into your Pods, so add each teammate’s key once instead of editing authorized_keys. Keys must be in OpenSSH format (ssh-ed25519 AAAA...). If you saved Lambda keys in another format, convert them with ssh-keygen -i, or read the public key back from your private key with ssh-keygen -y -f KEY_FILE. Install the other tools as you need them:
  • Runpod SDK: pip install runpod installs the Python SDK and the rp CLI. Run rp login to store your key. See the SDK overview.
  • MCP server: lets a coding agent manage your Runpod resources. See MCP servers.
  • Terraform: see Migrate your Terraform.

Step 3: Choose where each workload lands

Use the inventory to place each workload. Most Lambda instances become Pods, and the exceptions are worth finding early. Then map each instance type to a Runpod GPU type. Lambda instance type names encode the GPU count and model, for example gpu_1x_a10 or gpu_8x_h100_sxm5gdr. Get the exact names you use from your inventory or from GET /api/v1/instance-types. On Runpod, the GPU model is the --gpu-id and the count is --gpu-count. The full list is in GPU types. Stock varies by data center and changes through the day, so check what’s deployable before you commit to a type.
The catalog also reports maxCount, the largest GPU count a single Pod of that type can have. If a multi-GPU instance type has no single-Pod match, consider an Instant Cluster. Pick the data center before you create storage. A network volume is pinned to one data center, and Pods that mount it run there, the same way a Lambda filesystem ties you to its region.

Step 4: Move your images and code

How much work this step takes depends on how you use the instance today.

If you already run containers on Lambda

Lambda instances ship with Docker and the NVIDIA Container Toolkit, so many teams already run docker run --gpus all. That image runs on a Pod with three checks:
  • Architecture: the image must be linux/amd64. Build with docker build --platform linux/amd64 if you build on an ARM machine.
  • Registry access: for a private image, add a registry credential with runpodctl registry create and pass its ID as --registry-auth-id. For Amazon ECR, see Use private ECR images.
  • Run flags: translate your docker run flags with the table below.

If you work directly on the VM with Lambda Stack

Pick the official PyTorch template closest to your Lambda Stack image and reinstall the rest of your environment on top. Run runpodctl template list --type official to see the current list. Check the PyTorch version in your snapshot against the template, because Lambda Stack updates its packages over time. For anything you run more than once, capture the environment in an image. This Dockerfile turns the snapshot from Step 1 into a Pod image.
Dockerfile
Remove torch, torchvision, and the nvidia-* packages from requirements.txt so pip doesn’t replace the CUDA build of PyTorch that the base image ships. The Ubuntu 24.04 base marks the system Python as externally managed, which is why the install uses --break-system-packages. The image keeps the base image’s /start.sh, so SSH and JupyterLab still start. Build for linux/amd64 and push the image to your registry.
If your instance starts a long-running process from systemd or cron, add a start script that launches the base services and then your process. See Create a custom template for the three startup patterns.

Paths and environment variables

Update anything that assumed the Lambda VM layout. Runpod sets RUNPOD_POD_ID, RUNPOD_PUBLIC_IP, RUNPOD_TCP_PORT_22, RUNPOD_GPU_COUNT, and other variables in every Pod. See the environment variable map.

Step 5: Move your data and models

Create the network volume first, in the data center you chose in Step 3. Size it from bytes_used in your filesystem inventory.
The command returns the volume ID you’ll attach to Pods. Network volumes are available on Secure Cloud. A volume can grow later but can’t shrink. Then start a transfer Pod with the volume attached. A CPU Pod is enough for copying data, and data transfer in and out of Runpod has no ingress or egress fee.
runpodctl ssh info prints the direct SSH command with the Pod’s public IP and external port. You need the direct form, because rsync doesn’t work over the proxied SSH connection. If the command reports no public IP, recreate the transfer Pod as a GPU Pod on Secure Cloud. Then connect and install the copy tools on the Pod with apt update && apt install -y rsync. Choose a transfer path based on where the data is.
This works in every Lambda region. The filesystem must be attached to a running instance, and Lambda only attaches filesystems at launch. If the filesystem isn’t mounted anywhere, launch a small instance with it attached.Connect to the Lambda instance with agent forwarding so it can authenticate to the Pod with your local key, then push the data.
The trailing slash on the source copies the directory’s contents into /workspace. If the transfer is interrupted, run the same command again and rsync continues where it stopped. Running inside tmux keeps the copy alive if your SSH session drops.A filesystem isn’t the only place data lives. Run the same command for anything you keep on the instance’s root volume, for example directories under /home/ubuntu, because the root volume is destroyed when you terminate the instance.
Verify the copy before you rely on it. Compare file counts and total size on both sides.
Delete hidden .Trash-* directories on the Lambda side before you copy if you used JupyterLab there, because they count toward size and aren’t needed. When the copy checks out, delete the transfer Pod with runpodctl pod delete POD_ID. The data stays on the network volume. After the migration, you can read and write the volume without a Pod through the S3-compatible API, in data centers that support it.

Step 6: Deploy on Runpod

Deploy a Pod

This is the direct replacement for launching an instance. The example recreates an 8-GPU H100 instance with a filesystem and two open ports.
A few things in the Runpod version have no line in the Lambda request. Ports are part of the Pod, not a separate firewall object. The container disk size is explicit, and it’s much smaller than a Lambda root volume, so large files belong on /workspace. The data center must be the one that holds the network volume. To use your own image from Step 4, replace the template with --image YOUR_REGISTRY/lambda-env:v1. In the console, the same flow is Pods, then Deploy. The create call returns before the container is up. Wait for it, then connect.
JupyterLab is at https://POD_ID-8888.proxy.runpod.net, and a service on port 8000 is at https://POD_ID-8000.proxy.runpod.net.

Deploy a self-hosted inference server

Lambda’s tutorials serve models with vLLM in Docker on an instance. On Runpod, the vLLM image is the Pod’s image, and the arguments after the image name become the start command.
On Lambda, the firewall kept port 8000 closed until you opened it. On Runpod, the proxy URL is public as soon as the Pod runs, so the example starts vLLM with --api-key. Pin the image to a version tag for production, and store the Hugging Face token as a secret. Requests through the proxy must respond within 100 seconds, so use streaming for long generations or expose the port as 8000/tcp. If the server sits idle for part of the day, deploy the vLLM worker on Serverless instead. It scales to zero and bills per second while workers run.
The endpoint serves an OpenAI-compatible API at https://api.runpod.ai/v2/ENDPOINT_ID/openai/v1. See Deploy vLLM on Serverless for model settings and gated models.

Deploy an Instant Cluster

For a 1-Click Cluster workload, create an Instant Cluster in the same data center as your network volume. In the console, open Instant Clusters, click Create Cluster, choose the cluster type (for example Slurm Cluster), the GPU type, the Pod count, and the network volume. With REST v2:
type is SLURM, RAY, TRAINING, or APPLICATION. The template ID in the example is the official PyTorch 2.8.0 template for clusters. Confirm the current ID with runpodctl template search pytorch --type official. Slurm Clusters need an official Runpod PyTorch image. What changes from a 1-Click Cluster:
  • No separate head nodes. The primary node (NODE_RANK=0) is one of the GPU nodes. On a Slurm Cluster it’s the controller, and you submit jobs there with sbatch.
  • Shared storage is the network volume at /workspace on every node, in place of the shared /home and /data on Lambda’s Slurm clusters.
  • Inter-node traffic uses ens1 to ens8. Set NCCL_SOCKET_IFNAME=ens1. Runpod sets PRIMARY_ADDR, NODE_ADDR, NUM_NODES, and WORLD_SIZE on every node. See the configuration reference.
  • No reservation window. The cluster bills while it exists, so delete it when the job finishes. Whether you can create it depends on current stock of that GPU in the data center.

Step 7: Update the code that calls Lambda

Clients of your services

Every client that reaches a service by instance IP needs the new address. For an OpenAI-compatible server, the change is the base URL and key.
client.py
The Pod’s public IP and external ports can change when a Pod is reset or recreated, and the proxy URL changes when the Pod ID changes. Put production traffic behind your own DNS name or configuration value instead of hardcoding either one. A Serverless endpoint URL stays the same across worker restarts.

Automation that calls the Lambda Cloud API

Scripts that launch, poll, and terminate instances translate one call at a time. This is a typical launch-and-wait script before and after.
launch.py
The differences that matter in code:
  • Response envelope: Lambda wraps results in data and errors in error.code. REST v2 returns the resource at the top level.
  • Batching: Lambda’s terminate and restart calls take a list of instance IDs. REST v2 acts on one Pod per request.
  • Capacity errors: both APIs reject a create when the GPU type has no stock. REST v2 places exactly the GPU type you ask for and doesn’t fall back to another type, so keep your retry or fallback logic.
  • SSH readiness: RUNNING means the container is up. The script also waits for ssh.direct, which appears once port 22 has a public mapping.
  • Rate limits: Lambda allows one request per second and one launch per 12 seconds. REST v2 reports its limits in RateLimit-Policy response headers.
The full route mapping is in the API map.

Step 8: Verify, cut over, and shut down

Test from outside Runpod, the way your users or jobs will reach the workload.
Then work through the cutover:
  1. Compare results. Run the same training step, evaluation, or inference request on both platforms and compare outputs and throughput. Differences usually trace back to a package version in the image.
  2. Run both in parallel. Keep the Lambda instance up while the Pod takes a share of jobs or traffic.
  3. Do a final data sync. Run the rsync from Step 5 again to pick up files written since the first copy.
  4. Shift traffic. Point DNS, client configuration, and schedulers at Runpod.
  5. Set cost guards on Runpod. Enable low balance notifications or auto-pay in Billing, stop or delete Pods that finish their work, and review spend with runpodctl billing pods. Accounts have a default spend limit of $80 per hour across all resources. Contact support if your workloads need more.
When Runpod has carried the workload for long enough that you trust it, stop billing on Lambda. Lambda bills instances until you terminate them and filesystems for as long as they exist, mounted or not.
Terminating a Lambda instance destroys its root volume, and deleting a filesystem destroys its data. Lambda can’t recover either one. Confirm your copy on Runpod first.
Lambda’s docs warn that sudo shutdown or sudo systemctl poweroff inside an instance doesn’t end billing, so always terminate through the API or console. 1-Click Cluster reservations run for their reserved term and can’t be extended, so time the cluster cutover to the end of the reservation. Afterward, delete SSH keys, firewall rulesets, and API keys you no longer need in the Lambda console, and check the Usage page for your last charges.

Migrate your Terraform

Lambda’s docs don’t cover a Terraform provider, and the Lambda providers on the Terraform Registry are community projects. If you use one, or you want to put the migrated resources under Terraform for the first time, the Runpod provider is built on REST API v2 and covers the same ground. This configuration creates the SSH keys, a network volume, and a Pod that mounts it.
main.tf
runpod_account_ssh_keys replaces the account’s whole key set, so list every key your team needs. Changing gpu_type_id, gpu_count, or data_center_ids replaces the Pod, which is why data belongs on the network volume. Set desired_state = "EXITED" to stop a Pod while keeping it in your configuration. See Manage Runpod infrastructure with Terraform and the provider reference for every argument.

Reference

API map

Lambda routes are relative to https://cloud.lambda.com/api/v1. Runpod routes are relative to https://api.runpod.io. Lambda can generate an SSH key pair for you through POST /ssh-keys. On Runpod, generate the pair locally with ssh-keygen and register the public key.

Configuration field map

Environment variable map

Lambda instances don’t document platform-set environment variables, so this table maps where values come from.

Status map

Migrate with a coding agent

A coding agent with the Runpod skills and MCP server can run the inventory, write the Dockerfile, create the Runpod resources, and rewrite your API calls. Install them first.
The MCP server signs in with OAuth (“Sign in with Runpod”), so you don’t need an API key to start. See Agent skills and MCP servers for supported agents and clients. Then give your agent this prompt from the root of the repository that holds your Lambda automation.

Troubleshooting

docker: command not found or the Docker daemon won’t start in a Pod. A Pod is already a container, and Runpod runs Docker for you. Deploy the image as the Pod’s image instead of running it inside another Pod, and split Docker Compose services into separate Pods. Files outside /workspace are gone after a stop, restart, or edit. The container disk is ephemeral. On Lambda the whole root volume lasted until terminate. Move data, model caches (HF_HOME), and virtual environments to /workspace, and put system packages in the image. sudo: command not found or scripts fail on /home/ubuntu. Pods run as root, and official images don’t need sudo. Remove sudo from scripts and replace /home/ubuntu with /root or /workspace. systemctl fails with a message about systemd not being the init system. The container’s main process is your image’s start command. Start services from a start script, as shown in Create a custom template. SSH asks for a password, or scp and rsync fail. A password prompt means the key isn’t registered: run runpodctl ssh list-keys and check that the public key is in OpenSSH format. If the shell works but scp and rsync fail, you’re on the proxied connection. Expose 22/tcp and use the direct command from runpodctl ssh info POD_ID. The service works on localhost but the proxy URL returns 502. The service is bound to 127.0.0.1, isn’t listening yet, or the port isn’t in the Pod’s port list. Bind to 0.0.0.0, check the port with ss -tlnp, and confirm the port is exposed as PORT/http. JupyterLab on official templates only starts when JUPYTER_PASSWORD is set. Requests through the proxy fail with 524 after 100 seconds. The HTTP proxy closes connections that take longer than 100 seconds to respond. Stream the response, return a job ID and poll, or expose the port as TCP. The container fails to start with a CUDA or driver error, or PyTorch reports no GPU. The host’s CUDA version is older than your image needs. On Lambda the driver was part of your VM. On Runpod it belongs to the host, so recreate the Pod with --min-cuda-version set to the version your image was built for. pip install fails with externally-managed-environment. The Ubuntu 24.04 PyTorch image protects the system Python. Use pip install --break-system-packages, or install into a virtual environment created with --system-site-packages so it can see the preinstalled PyTorch. The Pod can’t be created with the network volume attached. A Pod that mounts a network volume must run in the volume’s data center, and that data center needs stock of your GPU type. Check with runpodctl datacenter list, choose another GPU type that fits, or create the volume in a data center that has the GPU you need.

Next steps

Choose a Pod

Match GPU type, memory, and storage to your workload.

Network volumes

Share persistent storage across Pods, clusters, and endpoints.

Create a custom template

Package your environment as a reusable image and template.

Serverless overview

Move idle inference servers to endpoints that scale to zero.
Last modified on November 14, 2026