Skip to main content
Beam is a serverless platform for deploying and running containerized applications in secure cloud sandboxes. Built for AI agents and compute-intensive workloads, Beam provides on-demand scalability with automatic resource management. Learn more at beam.cloud.

Installation

First, install the Beam provider package:

Prerequisites

Before using the Beam provider, you need to:
  1. Sign up for a Beam account at https://beam.cloud
  2. Get your Beam Token and Workspace ID from the dashboard
  3. Set them as environment variables:

Configuration

VibeKit uses a builder pattern with method chaining for type safety and flexibility. Configure your Beam provider and VibeKit instance:

Using the provider directly

Using configuration object

Configuration Options

The createBeamProvider function accepts these configuration options:

Required Options

  • token (string): Your Beam authentication token from the dashboard
  • workspaceId (string): Your Beam workspace ID

Optional Options

  • image (string): Custom Docker image. If not provided, it will be auto-selected based on the agent type:
    • claudesuperagentai/vibekit-claude:1.0
    • codexsuperagentai/vibekit-codex:1.0
    • opencodesuperagentai/vibekit-opencode:1.0
    • geminisuperagentai/vibekit-gemini:1.1
    • groksuperagentai/vibekit-grok-cli:1.0
    • Default: ubuntu:22.04
  • cpu (number): Number of CPU cores to allocate (default: 2)
  • memory (number | string): Memory allocation, e.g., 1024 or “1Gi” (default: “1Gi”)
  • keepWarmSeconds (number): How long to keep the sandbox warm after inactivity (default: 300 seconds / 5 minutes)

ENV variables and secrets

Configure your Beam provider using environment variables:
Reference them in your code:

Unique Features

Automatic Image Selection

Beam automatically selects the appropriate pre-built Docker image based on your agent type, ensuring optimal compatibility and performance without manual configuration.

Serverless Scalability

  • On-demand resources - Sandboxes spin up automatically when needed
  • Automatic scaling - Resources scale based on workload
  • Pay-per-use - Only pay for actual compute time used
  • No infrastructure management - Beam handles all server provisioning and maintenance

Performance Optimization

  • Fast cold starts - Optimized container initialization
  • Keep-warm configuration - Keep sandboxes warm between requests for faster response times
  • Configurable resources - Adjust CPU and memory per workload
  • Port exposure - Dynamically expose ports for web services

Advanced Usage

Custom Docker Image

Use your own Docker image with pre-installed dependencies:

High-Performance Configuration

For compute-intensive workloads:

Background Command Execution

Run long-running processes in the background:

Exposing Multiple Ports

Expose multiple services running on different ports:

System Requirements

  • Node.js 18+ - Runtime environment
  • Beam account - Active account with API credentials
  • Internet connection - Required for cloud sandbox execution

Limitations

  • Pause/Resume: Beam doesn’t directly support pause/resume operations. The sandbox remains active until terminated. Use keepWarmSeconds to manage idle timeouts and optimize costs.
  • Beta SDK: The Beam TypeScript SDK is currently in beta. Some features may change in future releases.
  • Cold start time: Initial sandbox creation may take a few seconds. Use keepWarmSeconds to maintain warm sandboxes for faster subsequent executions.

Troubleshooting

Authentication errors:
Sandbox creation timeout:
Port exposure issues:
Image pull errors:

Cost Optimization Tips

  1. Use keep-warm wisely: Set keepWarmSeconds based on your usage pattern
    • High frequency: 600+ seconds (10+ minutes)
    • Low frequency: 300 seconds (5 minutes) or less
  2. Right-size resources: Start with minimal resources and scale up as needed
  3. Clean up promptly: Always call kill() when done to avoid unnecessary charges

Support

For issues related to:

Next Steps