Skip to main content
Sandboxes are ultra-fast, Python-native environments for running any workload - with GPUs, networking, and persistent storage - in seconds.

Features

  • Ultra Fast Boot Times: Sandboxes cold boot in 1–3 seconds, even with dependencies included.
  • Image Caching: Beam caches dependencies in your base image, so subsequent sandboxes boot faster. You can also build custom images for each app.
  • Snapshots: Create Snapshots of the filesystem and restart Sandboxes from a previous state.
  • Preview URLs: Dynamically expose ports behind SSL-terminated, authenticated endpoints.
  • Session Management: Keep sandboxes running indefinitely, or configure them to shut down automatically after any period you choose.

Quick Start

Create a sandbox, run some code, and see the results:

Running a Node.js server

You can run arbitrary code on Beam. It doesn’t need to be Python! For example, let’s run a Node server. We’ll track the startup time too:

Core Features

Process Management

Run Python code, shell commands, or start long-running processes:

File System Operations

Upload local files, download results, and manage your workspace:

Dynamic Preview URLs

Expose ports to make your services accessible over the internet:

Key Concepts

SandboxInstance

When you create a sandbox, you get a SandboxInstance class that provides:
  • process: Run commands and code with real-time output
  • fs: Upload, download, and manage files
  • expose_port(): Make your services accessible to the internet
  • terminate(): Cleanup when you’re done

Lifecycle

  1. Create: Configure your environment (CPU, memory, packages, etc.)
  2. Launch: Start the sandbox with create()
  3. Use: Execute code, manage files, expose services
  4. Terminate: Clean up with terminate() (or let it auto-terminate)

What’s Next?

Now that you understand what Sandbox can do, let’s dive deeper into each capability: