# Best serverless platforms for AI agent tool calls (2026): AWS Lambda alternatives

Source: https://archil.com/compare/best-serverless-platforms-for-ai-agents

Serverless runtimes for AI agents' tool calls and generated code, compared: Archil serverless tool calls, Modal, Amazon Bedrock AgentCore Runtime, E2B, Vercel, Cloudflare, AWS Lambda, Daytona, Google Cloud Run, Northflank and Fly.io. Isolation per call, start time, time limits, state between calls and price, from each vendor's docs.

[All comparisons](https://archil.com/compare)

# Best serverless platforms for AI agent tool calls, and AWS Lambda alternatives (2026)

The best serverless platform for an AI agent's tool calls runs each call in its own VM, starts it in milliseconds, keeps the agent's files between calls and bills nothing while the agent waits on the model. Archil's serverless tool calls do that: every call gets a fresh Firecracker microVM with a durable disk mounted, starts in 37 ms at the median and costs $0.05 per 1,000 calls, but each call is capped at 5 minutes. For the agent loop itself, or for work longer than that, the usual alternatives to custom AWS Lambda scripts are Amazon Bedrock AgentCore Runtime (8-hour sessions), Modal (24-hour functions and GPUs) and Lambda itself, which now allows 30 minutes per invocation.

Updated November 2026. Competitor facts are from each vendor's own docs and pricing pages.

## The short list

1.  [Archil serverless tool calls](#archil-serverless-tool-calls): Best for an agent's bash, Python and Node tool calls and generated code, where each call must be isolated but see the same files
2.  [Modal](#modal): Best for Python agents that need GPUs, or that mix tool execution with inference and batch jobs on one platform
3.  [Amazon Bedrock AgentCore Runtime](#amazon-bedrock-agentcore-runtime): Best for hosting the agent loop itself inside AWS, as a managed replacement for Lambda-based agents
4.  [E2B](#e2b): Best for code-interpreter tools that keep a sandbox alive across a conversation and pause it between user turns
5.  [Vercel Functions and Sandbox](#vercel-functions-and-sandbox): Best for agents built into a Vercel app, with the loop in a Function and generated code in a Sandbox
6.  [Cloudflare Workers and Sandbox](#cloudflare-workers-and-sandbox): Best for JavaScript or Python agents on Cloudflare that run small pieces of generated code at very low cost
7.  [AWS Lambda](#aws-lambda): Best for teams that already run agents as Lambda functions and want to stay there, with trusted tools and event triggers
8.  [Daytona](#daytona): Best for fast-starting development sandboxes that an agent keeps for a whole task
9.  [Google Cloud Run](#google-cloud-run): Best for teams on Google Cloud that want to host the agent loop as a container, with GPUs available
10.  [Northflank](#northflank): Best for teams that want agent sandboxes next to their services and databases, in Northflank's cloud or their own
11.  [Fly.io Machines](#fly-io-machines): Best for agents that run as long-lived processes close to users, in many regions

## Side by side

| Platform | Isolation | Time limit | Published start time | State between calls | Price basis | GPUs |
| --- | --- | --- | --- | --- | --- | --- |
| Archil serverless tool calls | Fresh Firecracker microVM per call | 5 min per call; Archil sandboxes run 24 h sessions | 37 ms median queue, 82 ms end to end; 331 ms on a new disk's first call | Durable disks mounted in every call | $0.05 per 1,000 calls at 2 vCPU and 4 GiB, execution included; up to 32 vCPU and 64 GiB | No |
| Modal | gVisor, or a VM runtime with its own kernel | Functions 5 min by default, up to 24 h; Sandboxes the same | Containers boot in about 1 s | Volumes; warm containers stay up 60 s after the last call by default | Per second: $0.0000131 per core, $0.00000222 per GiB; Sandboxes 3x | Yes, T4 to B300 |
| Amazon Bedrock AgentCore Runtime | Dedicated microVM per session | 8 h per session; 15 min idle timeout by default | Not stated | Memory and disk for the session; optional session storage up to 1 GB | Per second, from $0.0895 per vCPU-hour and $0.00945 per GB-hour; no CPU charge during I/O wait | Not documented |
| E2B | One Firecracker microVM per sandbox | 1 h per session on Hobby, 24 h on Pro | Not stated | Pause keeps files and memory, with no expiry | $0.000014 per vCPU-second, $0.0000045 per GiB-second | No |
| Vercel Functions and Sandbox | Sandbox: Firecracker microVM | Functions 300 s (Hobby), 800 s (Pro), 1,800 s in beta; Sandbox 45 min (Hobby), 24 h (Pro) | Not stated | Persistent sandboxes save the filesystem on stop | Active CPU $0.128 per hour plus memory (iad1); Sandbox creations $0.60 per million | Not documented |
| Cloudflare Workers and Sandbox | Workers and Dynamic Workers: isolates; Sandbox: microVM per instance | Workers CPU 10 ms (Free), 30 s default up to 5 min (Paid); Sandbox inactivity timeout up to 6 h | Not stated | Sandbox files end when the instance stops; snapshots in beta | Workers $0.30 per million requests, $0.02 per million CPU ms; Containers per vCPU-, GiB- and disk-second | Not documented |
| AWS Lambda | Firecracker; warm environments reused across invocations | 30 min per invocation; durable functions up to 1 year; Lambda MicroVMs 8 h | Not stated | `/tmp` survives only in a warm environment; EFS or S3 Files mounts | $0.20 per million requests, $0.0000166667 per GB-second (x86, us-east-1) | Not documented |
| Daytona | Containers by default; VM sandboxes with their own kernel | No lifetime limit unless you set one | Sub-90 ms sandbox creation | Filesystem on stop; VM sandboxes pause with memory | Per second: $0.0504 per vCPU-hour, $0.0162 per GiB-hour | Yes |
| Google Cloud Run | Gen1 gVisor; gen2 microVM | Requests 60 min; jobs 7 days | Not stated | Mounted storage; Cloud Run sandboxes (Preview) are ephemeral | Per vCPU-second and GiB-second, rounded up to 100 ms | Yes, L4 and RTX PRO 6000 |
| Northflank | CPU sandboxes in microVMs; GPU sandboxes under gVisor | No time limit | Boots in under a second | Volumes; pause wipes ephemeral storage | Per second: $0.01667 per vCPU-hour, $0.00833 per GB-hour | Yes |
| Fly.io Machines | Firecracker microVMs | No limit stated | Starting a stopped Machine takes well under a second | Root filesystem when stopped; suspend keeps memory (2 GB or less) | Per second while running | Yes; Fly says it is scaling back GPU plans |

## What to look for

-   ### A fresh VM boundary for every call
    
    Code an agent writes is untrusted. It should run behind a VM boundary (Firecracker or another microVM, or gVisor), not a shared-kernel container, and ideally in an environment nothing else has touched. Function platforms such as AWS Lambda reuse a warm execution environment across invocations, so files in `/tmp` and global state from one call can still be there for the next.
    
-   ### Time to start a call
    
    An agent may make dozens of tool calls per task, so start time adds up. Compare what each vendor publishes: Archil reports a median 37 ms queue time per call, Daytona sub-90 ms sandbox creation, Modal about one second for a container to boot.
    
-   ### Time limit per call
    
    Limits range from Cloudflare Workers' CPU-time budget (10 ms on Free, up to 5 minutes on Paid) through Archil's 5 minutes per call, Vercel Functions' 800 s on Pro and Lambda's 30 minutes, to 8-hour AgentCore sessions and 24-hour Modal functions. Work that outlasts the limit needs a sandbox or a durable workflow instead.
    
-   ### State between calls
    
    A tool call usually needs the files the last call wrote: a cloned repo, installed packages, a half-built report. Per-call runtimes either mount durable storage into every call (Archil, Lambda with EFS) or keep a sandbox alive between calls, which you then manage and pay for.
    
-   ### Price for short, bursty calls
    
    Most of an agent's wall-clock time is spent waiting on the model. Per-call or per-second billing with scale to zero means that wait costs nothing; a sandbox left running between calls bills for it. Check the minimum charge per call and whether memory bills while the CPU is idle.
    
-   ### Where the agent loop runs
    
    The loop (prompt, model call, tool call, repeat) can run in your backend, a durable workflow, or a hosted agent runtime such as AgentCore, and only the tool calls need an isolated machine. See [two places to run an agent](https://archil.com/guides/building-agents/two-places-to-run-an-agent).
    

## Each option in detail

### 1. Archil serverless tool calls

[docs.archil.com](https://docs.archil.com/compute/serverless-execution)

**Best for:** an agent's bash, Python and Node tool calls and generated code, where each call must be isolated but see the same files

A [serverless tool call](https://archil.com/product/tool-calling) runs one command in a fresh Firecracker microVM with one or more [Archil disks](https://archil.com/product/filesystem) mounted under `/mnt/archil`, then shuts the VM down. Nothing carries over between calls except what the command wrote to the disk, and those writes are committed before the call returns, so the next call sees them. Calls start from a pool of ready microVMs: Archil measured a median 37 ms queue time and 82 ms end to end, including about 40 ms of internet round trip, and 331 ms for the first call on a new disk ([latency](https://docs.archil.com/compute/serverless-execution#latency)). The same disk mounts in an [Archil sandbox](https://archil.com/product/sandboxes) when work needs longer than one call allows.

#### Strengths

-   Every call gets its own microVM with its own kernel, so one call's leftovers can't affect the next
-   $0.05 per 1,000 calls at the default 2 vCPU and 4 GiB, with execution included; calls up to 32 vCPU and 64 GiB bill as multiples of the default
-   Files persist on a durable disk; a call can mount several disks, read-only or limited to a subdirectory
-   Any public amd64 OCI image via `baseImage`, or a private image built with the images API
-   Per-call egress rules, such as deny-all except a package registry, on Developer and up
-   Hundreds of calls in parallel by default, raisable to thousands

#### Tradeoffs

-   5 minutes per call, then it returns `504`; longer work belongs in an [Archil sandbox](https://archil.com/compare/best-platforms-for-long-running-ai-agents), which has no per-command timeout
-   A custom image or size boots on demand, so its queue time is higher than the 37 ms figure
-   Public tool calls run in three AWS regions (us-east-1, us-west-2, eu-west-1); other clouds need [BYOC](https://docs.archil.com/reference/byoc)
-   No GPUs
-   Called from your code through the SDK, REST API or CLI; there is no function hosting or documented event trigger, so the loop runs in your backend or an Archil sandbox
-   100 KiB command input with no stdin, and the first 4 MiB of stdout and stderr returned; larger data goes through files on the disk
-   Disks mount in shared mode by default, so a command calls `archil checkout` before changing files other clients also use

### 2. Modal

[modal.com](https://modal.com/docs/guide/sandboxes) · [Archil vs Modal](https://archil.com/compare/modal)

**Best for:** Python agents that need GPUs, or that mix tool execution with inference and batch jobs on one platform

Modal runs Functions and Sandboxes in containers isolated with gVisor, or in a VM runtime with its own kernel. Functions default to a 5-minute timeout and can be set up to 24 hours ([timeouts](https://modal.com/docs/guide/timeouts)); Sandboxes also default to 5 minutes, up to 24 hours. Containers boot in about one second, and memory snapshots shorten cold starts further ([cold starts](https://modal.com/docs/guide/cold-start)). CPU bills at $0.0000131 per physical core per second and memory at $0.00000222 per GiB per second, with Sandboxes at 3x those rates ([pricing](https://modal.com/pricing)).

#### Strengths

-   GPUs from T4 to B300, billed per second
-   Functions run for up to 24 hours, much longer than Lambda
-   Starter plan includes $30 a month of credit

#### Tradeoffs

-   Cold starts are about a second, slower than per-call microVM pools
-   Warm containers are reused for 60 s by default, so successive calls can share a container
-   GPU Sandboxes require gVisor; Volumes need explicit commit and reload, see [Archil vs Modal](https://archil.com/compare/modal)

### 3. Amazon Bedrock AgentCore Runtime

[docs.aws.amazon.com](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html)

**Best for:** hosting the agent loop itself inside AWS, as a managed replacement for Lambda-based agents

AgentCore Runtime hosts an agent behind MCP, HTTP, A2A or AG-UI. Each session gets its own microVM, lasts up to 8 hours and ends after 15 idle minutes by default; when it ends, the microVM is terminated and memory sanitized. Sessions default to 2 vCPU and 8 GB, up to 8 vCPU and 32 GB ([limits](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/bedrock-agentcore-limits.html)). Pricing is per second, from $0.0895 per vCPU-hour and $0.00945 per GB-hour, and CPU isn't billed during I/O wait, so time spent waiting on a model is cheap ([pricing](https://aws.amazon.com/bedrock/agentcore/pricing/)). For generated code, the separate [AgentCore Code Interpreter](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html) runs Python, JavaScript and TypeScript for 15 minutes by default, up to 8 hours.

#### Strengths

-   A microVM per session, with memory sanitized at the end
-   8-hour sessions; CPU charges drop to zero while the agent waits on I/O
-   IAM, VPC and billing stay in one AWS account

#### Tradeoffs

-   Session state is lost when the session ends; optional session storage keeps at most 1 GB of files
-   Code Interpreter is described as a containerized environment, with 2 vCPU, 8 GB and 10 GB of disk per session
-   Synchronous requests time out at 15 minutes; longer work streams (up to 60 minutes) or runs asynchronously

### 4. E2B

[e2b.dev](https://e2b.dev/docs) · [Archil vs E2B](https://archil.com/compare/e2b)

**Best for:** code-interpreter tools that keep a sandbox alive across a conversation and pause it between user turns

Every E2B sandbox is a Firecracker microVM restored from a snapshot rather than booted ([e2b-dev/runtime](https://github.com/e2b-dev/runtime)). A session lasts up to 1 hour on Hobby and 24 hours on Pro; pausing keeps the filesystem and memory, with no expiry. Billing is $0.000014 per vCPU-second and $0.0000045 per GiB-second while running, at 1 to 8 vCPU and 1 to 8 GiB ([pricing](https://e2b.dev/pricing)).

#### Strengths

-   Pause and resume keep memory and files indefinitely
-   Open-source runtime and established code-interpreter SDKs
-   $100 of one-time credit on Hobby

#### Tradeoffs

-   You manage the sandbox's lifecycle; a sandbox left running between calls bills for the wait
-   Pausing takes about 4 s per GiB of memory
-   At most 8 vCPU and 8 GiB, and no GPUs; see [Archil vs E2B](https://archil.com/compare/e2b)

### 5. Vercel Functions and Sandbox

[vercel.com](https://vercel.com/docs/sandbox) · [Archil vs Vercel Sandbox](https://archil.com/compare/vercel-sandbox)

**Best for:** agents built into a Vercel app, with the loop in a Function and generated code in a Sandbox

Vercel Functions run for up to 300 s on Hobby and 800 s on Pro, with 1,800 s in beta, and up to 2 vCPU and 4 GB ([limits](https://vercel.com/docs/functions/limitations)). They bill Active CPU, so time waiting on a model isn't billed as CPU, plus provisioned memory. Vercel Sandbox runs each sandbox in a Firecracker microVM, for 5 minutes by default and up to 45 minutes on Hobby or 24 hours on Pro, with up to 8 vCPU on Pro and 32 on Enterprise. It costs $0.128 per Active CPU hour, $0.0212 per GB-hour of memory and $0.60 per million sandbox creations in iad1 ([pricing](https://vercel.com/docs/sandbox/pricing)).

#### Strengths

-   Active CPU pricing for Functions and Sandbox
-   Persistent sandboxes save the filesystem on stop and restore it on resume
-   10,000 concurrent sandboxes on Pro, in 19 regions

#### Tradeoffs

-   Functions are too short and too small for heavy tool work; that goes in a Sandbox you create and stop
-   Sandbox resume restores files, not memory or processes; see [Archil vs Vercel Sandbox](https://archil.com/compare/vercel-sandbox)

### 6. Cloudflare Workers and Sandbox

[developers.cloudflare.com](https://developers.cloudflare.com/sandbox/)

**Best for:** JavaScript or Python agents on Cloudflare that run small pieces of generated code at very low cost

Workers run in isolates with 128 MB of memory and a CPU-time budget: 10 ms per request on Free, 30 s by default and up to 5 minutes on Paid, with no wall-clock limit while the client stays connected ([limits](https://developers.cloudflare.com/workers/platform/limits/)). [Dynamic Workers](https://developers.cloudflare.com/dynamic-workers/) load code at runtime to sandbox code you don't trust, such as an agent's generated JavaScript. For full Linux, the Sandbox SDK runs on Containers, each instance a microVM with its own kernel, up to 4 vCPU, 12 GiB and 20 GB of disk.

#### Strengths

-   Workers bill $0.30 per million requests and $0.02 per million CPU ms, with no charge for wall-clock duration
-   Dynamic Workers are priced for many short-lived pieces of code: 1,000 a month included, then $0.002 per Dynamic Worker per day
-   Sandbox instances are microVMs with their own kernel and network

#### Tradeoffs

-   Isolates run JavaScript, Python and WebAssembly, not arbitrary binaries
-   A Sandbox's files end when the instance stops; snapshots are in beta and expire after 30 days, or mount an R2 bucket
-   Sandbox and Dynamic Workers need the Workers Paid plan

### 7. AWS Lambda

[docs.aws.amazon.com](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)

**Best for:** teams that already run agents as Lambda functions and want to stay there, with trusted tools and event triggers

A Lambda invocation can now run for up to 30 minutes, with 128 MB to 10,240 MB of memory (one vCPU's worth at 1,769 MB) and up to 10,240 MB of `/tmp`. Lambda runs on Firecracker, but it reuses a warm execution environment across invocations of the same function: globals and `/tmp` carry over, and a failed invoke doesn't clear `/tmp` ([execution environment](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html)). Pricing is $0.20 per million requests and $0.0000166667 per GB-second on x86 in us-east-1 ([pricing](https://aws.amazon.com/lambda/pricing/)). [Durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) run a workflow for up to a year without compute charges while waiting, and [Lambda MicroVMs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-microvms-guide.html) give sandboxes with full OS capabilities for up to 8 hours.

#### Strengths

-   Event sources, IAM and VPC networking you may already use
-   Durable functions keep the agent loop's state for up to a year
-   Mounts Amazon EFS or Amazon S3 Files for shared files

#### Tradeoffs

-   Warm reuse means untrusted code from one call can leave state for the next; keeping callers apart needs tenant isolation mode or Lambda MicroVMs
-   Several products to assemble: functions, durable functions, MicroVMs and storage are separate
-   Duration billing makes long, large calls expensive compared with flat per-call pricing (see below)

### 8. Daytona

[daytona.io](https://www.daytona.io/docs/en/sandboxes) · [Archil vs Daytona](https://archil.com/compare/daytona)

**Best for:** fast-starting development sandboxes that an agent keeps for a whole task

Daytona advertises sub-90 ms sandbox creation. Sandboxes run as Linux containers by default, with VM sandboxes (their own kernel) as an option ([isolation](https://www.daytona.io/docs/en/isolation)). Billing is per second at $0.0504 per vCPU-hour and $0.0162 per GiB-hour, with $200 of free compute ([pricing](https://www.daytona.io/pricing)).

#### Strengths

-   Fast sandbox creation
-   GPU sandboxes with up to 8 GPUs
-   No sandbox lifetime cap unless you set one

#### Tradeoffs

-   The default sandbox is a container, a weaker boundary than a microVM for untrusted code
-   Sandboxes top out at 4 vCPU, 8 GB and 10 GB of disk by default per organization; pause is for VM sandboxes only
-   A sandbox per task rather than per call; see [Archil vs Daytona](https://archil.com/compare/daytona)

### 9. Google Cloud Run

[docs.cloud.google.com](https://docs.cloud.google.com/run/docs/about-execution-environments)

**Best for:** teams on Google Cloud that want to host the agent loop as a container, with GPUs available

Cloud Run serves requests for up to 60 minutes and runs jobs for up to 7 days, on instances of up to 8 vCPU and 32 GiB ([quotas](https://docs.cloud.google.com/run/quotas)). The first-generation environment uses gVisor; the second is a microVM. It bills per vCPU-second and GiB-second, rounded up to the nearest 100 ms, with a monthly free tier ([pricing](https://cloud.google.com/run/pricing)). [Cloud Run sandboxes](https://docs.cloud.google.com/run/docs/code-execution), in Preview, run untrusted code inside a container workload with egress blocked by default.

#### Strengths

-   Requests of up to an hour and jobs of up to a week
-   L4 and RTX PRO 6000 GPUs, scaling to zero
-   Ordinary containers, so existing agent services move over unchanged

#### Tradeoffs

-   Instances serve many requests, so per-call isolation for generated code depends on the sandboxes feature, which is in Preview
-   Durable files need mounted storage, such as an [Archil disk on Cloud Run](https://docs.archil.com/guides/platforms/cloud-run)

### 10. Northflank

[northflank.com](https://northflank.com/docs/v1/application/sandboxes/sandboxes-on-northflank-cloud)

**Best for:** teams that want agent sandboxes next to their services and databases, in Northflank's cloud or their own

Northflank runs CPU sandboxes in microVMs and GPU sandboxes under gVisor, booting in under a second, with no session time limit. Billing is per second at $0.01667 per vCPU-hour and $0.00833 per GB-hour on Northflank's cloud ([pricing](https://northflank.com/pricing)). Pausing scales a sandbox to zero; durable state goes on a volume.

#### Strengths

-   Low per-second rates and no time limit
-   GPUs, and the same runtimes in your own cloud account

#### Tradeoffs

-   A sandbox platform, not per-call execution: you create, pause and delete sandboxes
-   Pause wipes ephemeral storage, and volumes keep billing while paused

### 11. Fly.io Machines

[docs.fly.io](https://docs.fly.io/machines/overview)

**Best for:** agents that run as long-lived processes close to users, in many regions

Fly Machines are fast-launching VMs billed per second while running; suspend uses Firecracker snapshots and resumes in a few hundred milliseconds ([suspend](https://docs.fly.io/reference/suspend-resume)). Starting a stopped Machine takes well under a second, and a stopped Machine bills only its root filesystem at $0.15 per GB-month ([pricing](https://docs.fly.io/about/pricing)).

#### Strengths

-   Suspend and resume with memory
-   Cheap to keep stopped Machines around
-   Many regions

#### Tradeoffs

-   A VM platform you orchestrate yourself, not a tool-call API
-   Suspend requires 2 GB of memory or less; creating a Machine can take low double-digit seconds

## The agent loop and its tool calls are different workloads

The loop is long-lived and mostly waits on the model. It needs a durable home that survives restarts: your backend, a durable workflow (Lambda durable functions, Temporal, Vercel Workflow), or a hosted runtime such as AgentCore Runtime. Tool calls are short, run untrusted code, and need isolation plus the agent's files.

Splitting them keeps API keys out of the sandbox and lets each run where it fits. Archil's [AI SDK integration](https://docs.archil.com/integrations/ai-sdk) gives an agent bash and file tools that run as serverless calls on a disk, wherever the loop runs. For loops that run for hours, see [best platforms for long-running AI agents](https://archil.com/compare/best-platforms-for-long-running-ai-agents).

## What a tool call costs: Lambda vs Archil

Lambda bills duration, so short, small calls are cheap. A 100 ms call at 1 GB costs about $0.0019 per 1,000 calls ($0.0000166667 per GB-second plus $0.20 per million requests, before the free tier), well under Archil's $0.05 per 1,000.

Agent tool calls are often longer: installing packages, running tests, building. At 4 GB, about the size of Archil's default 2 vCPU and 4 GiB, Lambda costs about $0.067 per 1,000 one-second calls and $0.67 per 1,000 ten-second calls. Archil's price stays $0.05 per 1,000 at any length up to the 5-minute limit, so it is cheaper for calls longer than about 0.75 s at that size.

## Moving agents off custom Lambda scripts

Map each piece to a managed home. The loop goes to AgentCore Runtime, Lambda durable functions or your own backend. Tool calls that run generated code go to a per-call microVM such as Archil, or a sandbox such as E2B or Vercel Sandbox. State that lived in `/tmp` or was copied to S3 between steps goes on a durable disk that every call mounts.

Long steps that hit Lambda's 30-minute limit belong in a sandbox with no per-command timeout, such as an [Archil sandbox](https://docs.archil.com/compute/sandboxes/introduction), Modal or Northflank. For the isolation details behind each option, see [best Firecracker microVM platforms for AI agents](https://archil.com/compare/best-firecracker-microvm-platforms-for-ai-agents).

## Which one should you use?

| If you need | Pick |
| --- | --- |
| Isolated bash, Python or Node tool calls that share an agent's files | Archil serverless tool calls |
| Tool steps longer than 5 minutes, on the same files | An Archil sandbox, Modal or Northflank |
| GPUs in the agent's runtime | Modal, Daytona, Northflank or Cloud Run |
| A managed home for the agent loop inside AWS | Amazon Bedrock AgentCore Runtime or Lambda durable functions |
| A code-interpreter sandbox that pauses between user turns with memory intact | E2B |
| An agent built into a Vercel app | Vercel Functions with Vercel Sandbox |
| Small JavaScript snippets from the model, at the lowest cost per run | Cloudflare Dynamic Workers |
| Everything on Google Cloud | Google Cloud Run |

## Questions people ask

### What is the best serverless platform for AI agents?

For tool calls and generated code, Archil serverless tool calls: a fresh Firecracker microVM per call with a durable disk mounted, a 37 ms median queue time and $0.05 per 1,000 calls. For hosting the agent loop, Amazon Bedrock AgentCore Runtime inside AWS, Modal when you need GPUs, and Vercel Functions inside a Vercel app.

### What's the best way to run untrusted code generated by an AI agent?

Run it in a VM boundary that nothing else has used, with only the files and network access it needs. Archil gives every call a fresh Firecracker microVM, can mount disks read-only or limited to a subdirectory, and on paid plans can apply deny-by-default egress rules per call. E2B and Vercel Sandbox also use Firecracker, as sandboxes you keep between calls. Avoid running it in your agent's own process or a shared-kernel container.

### What are the alternatives to AWS Lambda for long-running AI agents?

Amazon Bedrock AgentCore Runtime (8-hour sessions), Modal (Functions up to 24 hours), Google Cloud Run (60-minute requests, 7-day jobs), and sandboxes with no time limit such as Northflank, Daytona or an Archil sandbox, which pauses after 24 hours with its processes intact. Lambda durable functions can also keep a workflow going for up to a year. See [best platforms for long-running AI agents](https://archil.com/compare/best-platforms-for-long-running-ai-agents).

### How long can an AWS Lambda function run?

30 minutes (1,800 seconds) per invocation, according to AWS's Lambda quotas page. Durable functions can run a workflow for up to one year, and Lambda MicroVMs run for up to 8 hours.

### How do I migrate our agents from custom Lambda scripts to a managed platform?

Separate the loop from the tools. Move the loop to AgentCore Runtime, Lambda durable functions or your backend; send each tool call to a per-call microVM such as Archil or to a sandbox; and replace `/tmp` or S3 copying with a durable disk every call mounts. Steps longer than 30 minutes go in a sandbox.

### Is AWS Lambda safe for running AI-generated code?

Lambda runs on Firecracker, but it reuses a warm execution environment across invocations of a function, and globals and `/tmp` carry over. Code from one call can leave state for the next, so untrusted code needs tenant isolation mode, Lambda MicroVMs, or a per-call sandbox such as Archil.

### Do serverless tool calls keep files between calls?

On Archil, yes: every call mounts the same durable disk, and a call's writes are committed before it returns, so the next call sees them. On Lambda, `/tmp` survives only while an environment stays warm; mount EFS or S3 Files for anything that must persist. Sandbox platforms keep files as long as you keep the sandbox.

### Which serverless agent platforms have GPUs?

Modal, Daytona, Northflank and Google Cloud Run document GPUs. Archil and E2B don't offer them, and AgentCore Runtime doesn't document them.

## How we chose

We compared platforms teams use to run an AI agent's tool calls and generated code, and where they host the agent loop: isolation per call, published start times, time limits, state between calls and price for bursty calls. Competitor facts come from each vendor's own docs and pricing pages as of the date above; where a vendor doesn't publish something, the table says so. Cost examples are arithmetic on list prices, not measurements. Archil makes Archil, and ranks it first for tool calls because each call gets a fresh microVM with durable files at a flat price. It isn't the pick for GPU work, for single steps longer than 5 minutes (use an Archil sandbox), or for hosting the agent loop; Modal and AgentCore Runtime are better there.

## Related

-   [Best platforms for long-running AI agents: Where to run an agent for hours: sandboxes, serverless functions and containers.](https://archil.com/compare/best-platforms-for-long-running-ai-agents)
-   [Best Firecracker microVM platforms for AI agents: Which sandboxes put agent code in a microVM, and what each keeps.](https://archil.com/compare/best-firecracker-microvm-platforms-for-ai-agents)
-   [Modal vs E2B vs Daytona vs Archil: Ranked for agent loops: isolation, state between steps, forking and price.](https://archil.com/compare/modal-vs-e2b-vs-daytona)
-   [How fast is a serverless tool call?: Archil's per-call latency, with a script to reproduce it.](https://archil.com/article/how-fast-is-a-serverless-tool-call-for-an-ai-agent)
-   [How to run agent tool calls without keeping a VM open: Per-call execution against a persistent disk.](https://archil.com/article/how-to-run-agent-tool-calls-without-keeping-a-vm-open)

Or see [every comparison](https://archil.com/compare).
