all posts

PandaStack vs Beam Cloud: which for AI code?

Ajay Kumar··9 min read

If you're weighing PandaStack against Beam Cloud (beam.cloud) for running AI or Python workloads, here's the honest one-liner: Beam is a serverless GPU and Python cloud built for running functions, containers, and ML workloads you wrote — with fast cold starts and first-class GPU. PandaStack is a Firecracker microVM sandbox platform built for running per-task, per-tenant, or untrusted code — the code an AI agent writes at runtime, the user script you don't fully trust, the multi-tenant job that needs a hard isolation boundary. They both say "run Python in the cloud," but the design centers on two different questions: 'how do I run my ML function cheaply on a GPU?' versus 'how do I safely run code I don't control?'

Disclosure: I'm Ajay, founder of PandaStack. I'll give specific numbers only for PandaStack, and describe Beam qualitatively — I'm not going to invent Beam's internals, latencies, or pricing. Beam is a good product built by serious engineers, and their platform moves fast. Treat every Beam characterization here as a starting point to verify against their current docs and pricing, not as gospel. The goal is to help you pick the right tool, not to win an argument.

PandaStack vs Beam Cloud: what are they actually for?

The cleanest way to tell these apart is to ask two questions: what is the unit of work, and who wrote the code running inside it?

  • Beam Cloud is a serverless compute platform oriented around Python functions, containers, and ML workloads. You define a function (often with a GPU attached), deploy it, and Beam handles packaging, scheduling, autoscaling, and fast cold starts. The unit of work is a function or container you authored. It shines for model inference and training, GPU jobs, batch processing, and turning Python code into deployable endpoints.
  • PandaStack is a microVM sandbox platform. You call an API to spin up an isolated environment — a full Linux guest with its own kernel — then exec commands, read/write files, snapshot it, fork it, or expose a port. The unit of work is an environment, and the code running inside it is frequently code you did not write: an LLM-generated script, a user's submission, an agent's tool call.

That framing drives almost every other difference — isolation model, GPU story, statefulness, and self-hostability all follow from 'serverless function you own and want on a GPU' versus 'isolated environment for code you don't control.' Verify Beam's exact product surface against their docs, since serverless platforms evolve their primitives quickly.

How does each isolate untrusted or agent code?

This is the difference that matters most if you're running AI-generated or third-party code, because the failure mode there isn't a slow job — it's a sandbox escape onto a shared host.

Every PandaStack sandbox, database, and app runs in its own Firecracker microVM. That means a real hardware-virtualization boundary (KVM) and a separate guest kernel per workload — not a shared-kernel container. If agent code does something hostile, it's confined to a VM with its own kernel, its own network namespace, and its own filesystem. This is the same isolation primitive AWS Lambda uses under the hood, exposed directly as a sandbox you drive from an SDK.

The key question for agent workloads isn't 'how fast does my function run' — it's 'what's the blast radius when the code inside misbehaves?' A shared-kernel container shares an attack surface with everything else on the host. A microVM gives each task its own kernel. That's why PandaStack puts a Firecracker microVM around every single workload, including managed databases and hosted apps.

Beam is oriented around running containers and serverless functions — that is, code you wrote and trust, scaled out. Serverless platforms use a range of isolation techniques (containers, secure-container layers, and in some cases microVMs) and Beam publishes its own approach; I won't put a specific boundary on Beam's arbitrary-code path here — check their security docs for exactly what they use. The honest distinction is one of design intent: Beam is built around running trusted ML/Python code fast and cheap; PandaStack is built from the ground up on the assumption that the code inside the box is untrusted and needs hardware-level isolation per task. If you're handing raw model output straight to a shell, that assumption is the whole ballgame.

The GPU story (being honest about it)

Let me be direct, because this is a real trade-off and it does not favor PandaStack. First-class, on-demand GPU is a core reason people choose Beam. If your workload is GPU-bound model serving, fine-tuning, batch inference, or training, Beam is purpose-built for that: attach an accelerator to a function, scale it, pay for what you use. PandaStack's moat is elsewhere — CPU microVM density, snapshot/fork of live state, and hardware isolation for untrusted code. Its templates (base, code-interpreter, agent, browser, postgres-16) target CPU-bound code execution, agent tool-use, headless browsers, and databases. Do not pick PandaStack expecting a GPU cloud; that's not what it is, and I'm not going to pretend otherwise.

So if 'run this model on an H100' is the sentence that describes your workload, that points at Beam (verify their current GPU catalog and pricing). If 'safely run whatever code my agent just generated, thousands of times a day, each in its own kernel' is the sentence, that points at PandaStack.

Cold-start: 49ms snapshot-restore vs serverless warm-up

Fast cold starts are a headline feature for Beam, and for good reason — serverless GPU is painful when every invocation waits on a container pull and a model load. Beam has invested heavily here. I'm not going to quote a number for Beam's cold start, because it varies by image size, GPU, model weights, and configuration; check their docs for current figures.

PandaStack attacks the same problem with a different mechanism: snapshot-restore of a microVM. There is no warm pool of idle VMs. PandaStack's p50 sandbox create is around 179ms, with roughly 49ms for the snapshot-restore step itself and a p99 near 203ms. The first spawn of a template does a cold boot (~3s) and captures a snapshot; every subsequent create restores that snapshot, patches networking, and resumes. A same-host fork lands in roughly 400–750ms; a cross-host fork in 1.2–3.5s. So you get full-VM isolation at latencies people usually associate with containers — the isolation is nearly free on the latency axis.

The architectural point: PandaStack's latency comes specifically from restoring a booted-and-snapshotted microVM, which is a different lever than keeping warm function containers around. Both approaches can feel instant; they get there differently.

Statefulness, snapshots, and forking

Serverless functions are designed to be stateless — that's the model, and it's a strength for scaling stateless work. PandaStack goes the other way for agent workflows: a sandbox is a live, stateful machine you can pause, snapshot, and branch.

  • snapshot() captures the full VM — memory and disk — so you can restore the exact running state later.
  • fork() branches a running sandbox using copy-on-write: memory via MAP_PRIVATE and the rootfs via XFS reflink, so a fork shares pages with its parent until it writes. Same-host fork lands in 400–750ms; cross-host in 1.2–3.5s.
  • hibernate() / wake() lets a sandbox sleep when idle and resume on the next request (auto-wake), which is how scale-to-zero works without losing in-memory state.

Why does this matter for agents? An agent loop often wants to try several branches from a common starting point — run three candidate solutions from the same setup state, keep the best. Forking a VM in sub-second time makes that cheap. A stateless function model makes you rebuild state on every call. If your workload is 'explore from a checkpoint,' PandaStack's snapshot/fork primitives are a structural advantage; if it's 'run this idempotent GPU job,' you don't need them and the stateless serverless model is simpler.

Self-hostable vs hosted

PandaStack's core is open source and designed to be self-hostable on your own KVM hosts. If you have a hard requirement to run untrusted workloads inside your own VPC, on your own hardware, or in a region a managed provider doesn't serve, that matters — you own the agent, the control plane, and the data path. Beam is a hosted cloud service; you run on their infrastructure (verify whether they offer any self-hosted or BYOC tier, as that can change). Neither model is universally better: hosted is less operational burden and no infra to run; self-hostable open source is more control and no vendor lock-in. Choose based on your compliance posture and how much infrastructure you actually want to own.

Side by side

The short version, one axis at a time. Remember: PandaStack numbers are concrete; Beam entries are qualitative and worth verifying against beam.cloud's current docs and pricing.

  • Isolation model — PandaStack: Firecracker microVM per sandbox, hardware-virtualized (KVM) with its own guest kernel; built for untrusted code. Beam: container/serverless-oriented for functions and ML workloads you own; verify their exact isolation boundary in their docs.
  • Self-host vs hosted — PandaStack: open source, self-hostable on your own KVM hosts (also managed). Beam: hosted cloud service; verify any self-host/BYOC option against their docs.
  • Cold start — PandaStack: ~179ms p50 create via snapshot-restore (~49ms restore step, ~203ms p99), ~3s first cold boot, no warm pool. Beam: fast cold starts are a headline feature; verify current figures against their docs.
  • GPU — PandaStack: no on-demand GPU; core moat is CPU microVM density, snapshot/fork, and isolation. Beam: first-class on-demand GPU is a core strength — verify the current GPU catalog and pricing.
  • Fork / snapshot state — PandaStack: full-VM snapshot plus copy-on-write fork (same-host 400–750ms, cross-host 1.2–3.5s) and hibernate/wake for scale-to-zero. Beam: stateless serverless model; verify whether stateful snapshot/fork primitives exist.
  • Pricing posture — PandaStack: usage-based, and self-hosting removes per-second platform margin entirely (you run it). Beam: usage-based serverless pricing weighted toward GPU seconds — describe qualitatively and verify exact rates on their pricing page.

What using PandaStack looks like

PandaStack ships a Python SDK (pandastack), a TypeScript SDK (@pandastack/sdk), and a CLI (pandastack). The client reads PANDASTACK_API_KEY from the environment and talks to https://api.pandastack.ai. Here's the canonical 'run untrusted code in an isolated VM' flow — create a sandbox, exec a command, branch it, then tear it down:

from pandastack import Sandbox

# Spin up an isolated Firecracker microVM.
# ~179ms p50 create via snapshot-restore (no warm pool).
sbx = Sandbox.create(
    template="code-interpreter",
    ttl_seconds=300,
    metadata={"task": "run-agent-snippet"},
)

try:
    # Execute code the agent generated -- confined to this VM's own kernel.
    result = sbx.exec(
        "python -c 'import sys; print(sys.version)'",
        timeout_seconds=30,
    )
    print(result.stdout, result.exit_code)

    # Branch the running state with copy-on-write (~400-750ms same-host)
    # to explore an alternate path from the same checkpoint.
    branch = sbx.fork()
    branch.exec("echo exploring an alternate path")

    # Persist a file, then snapshot the whole VM for later restore.
    sbx.filesystem.write("/work/out.txt", "hello from inside the microVM")
    sbx.snapshot()
finally:
    sbx.kill()

The shape to notice: you're not deploying a function, you're operating a machine. create, exec, filesystem.read/write, snapshot, fork, hibernate/wake, kill. That API surface is the tell for what PandaStack is optimized for — driving isolated environments, not serving GPU functions.

Pick Beam when… / Pick PandaStack when…

Here's the honest decision guide. These aren't head-on competitors so much as tools with overlapping silhouettes and different centers of gravity.

Pick Beam Cloud when

  • You need on-demand GPUs for inference, fine-tuning, or training — this is a core Beam strength and not a PandaStack feature.
  • Your unit of work is a Python function or container you wrote and trust, and you want it deployed as a fast serverless endpoint.
  • Your ML workloads benefit from a serverless, scale-out model where statelessness is fine and cold starts need to be small.
  • You'd rather not run any infrastructure yourself and are happy on a hosted platform — verify their current pricing and GPU catalog before committing.

Pick PandaStack when

  • You're running untrusted or AI-generated code and want a hardware-isolation boundary (its own kernel) per task, not a shared-kernel container.
  • Your agent benefits from stateful sandboxes — snapshot a setup, fork it cheaply (400–750ms same-host) to explore branches, hibernate/wake for scale-to-zero.
  • You need fast per-task isolation at CPU scale: ~179ms p50 create via snapshot-restore, with no warm pool to manage and up to 16,384 microVMs per agent host.
  • You want the surrounding platform: managed PostgreSQL 16, durable volumes, and git-driven app hosting to deploy what the agent builds.
  • You need to self-host on your own KVM hosts because of compliance, data-residency, or lock-in concerns — the core is open source.

And if you're building a serious AI product, using both is entirely reasonable: Beam for the GPU-heavy inference and training you own, PandaStack for the per-session isolated sandboxes where the agent runs the code it generates. 'AI sandbox vs serverless GPU' is a false binary more often than people assume — match each workload to the tool whose isolation, state, and hardware model actually fit it.

Comparing more of the field? See PandaStack vs Modal at /blog/pandastack-vs-modal for another serverless-Python-cloud comparison, and the full roundup of code execution sandboxes at /blog/best-code-execution-sandboxes for isolation model, hosted-vs-self-host, cold-start, and forking across the whole field.

Frequently asked questions

Is PandaStack a Beam Cloud alternative?

For one specific job, yes: running untrusted or AI-generated code in isolated, per-task environments. Each PandaStack workload runs in its own Firecracker microVM with its own kernel, created at ~179ms p50 via snapshot-restore (~49ms restore step). It is not a replacement for Beam's serverless GPU and ML-function workloads — if your unit of work is a Python function or model you own and want on a GPU, Beam is the better fit. Verify Beam's exact capabilities against their current docs.

Does PandaStack support GPUs like Beam Cloud does?

No. On-demand GPU provisioning for inference and training is a core Beam Cloud strength and is not a PandaStack feature. PandaStack's moat is CPU microVM density, snapshot/fork of live state, and hardware isolation for untrusted code. Its templates target CPU-bound code execution, agent tool-use, headless browsers, and managed databases. If your workload is GPU-bound, use Beam; many teams use Beam for GPU jobs and PandaStack for isolated agent sandboxes.

Can I self-host PandaStack instead of using a hosted cloud?

Yes. PandaStack's core is open source and designed to run on your own KVM hosts, so you can run untrusted workloads inside your own VPC or hardware without vendor lock-in. Beam Cloud is a hosted service that runs on its own infrastructure — verify whether they offer any self-hosted or BYOC tier, as that can change. Choose self-hosting for compliance, data-residency, or control requirements; choose hosted when you'd rather not own the infrastructure.

How do PandaStack and Beam Cloud compare on cold start?

PandaStack creates a sandbox at ~179ms p50 (with a ~49ms snapshot-restore step and ~203ms p99) by restoring a baked Firecracker microVM snapshot — no warm pool. Beam Cloud advertises fast cold starts as a headline feature for its serverless GPU/Python workloads, but the exact figures vary by image size, GPU, and model weights, so verify current numbers against Beam's own docs. Both feel fast; they use different mechanisms to get there.

Which is better for running code an AI agent generates?

For running code an agent writes at runtime, isolation is the deciding factor. PandaStack wraps every sandbox in a Firecracker microVM with its own kernel, so a hostile snippet is confined to one VM — and you can snapshot and fork that VM to explore multiple agent branches cheaply. Beam Cloud is oriented around trusted Python/ML functions you own and GPU workloads; verify its arbitrary-code isolation boundary in its security docs before handing it untrusted input.

Run code in a microVM in one API call.

49ms p50 cold start. Fork, snapshot, and scale to zero.

Start free
Written by Ajay Kumar, Founder, PandaStack.