Skip to main content
Sandboxes are configurable cloud environments. You control CPU, memory, GPU, dependencies, environment variables, and storage so each sandbox can be customized exactly to your needs.

Basic

Start with the simplest configuration:
This gives you a minimal environment that works well for simple scripts and running untrusted code. For most real work, you’ll want to customize the resources.

Advanced compute settings

You can increase CPU, memory, or assign a GPU - depending on your use case:

Customize your environment

See the Images section for more information on how to customize the runtime.

Persistent Storage

Beam supports two types of persistent storage: fast distributed volumes and cloud buckets you already manage.

Distributed Storage Volumes

Mount fast storage volumes to persist files between sessions:
Use volumes when you:
  • Are working on a project that spans multiple sessions
  • Need to share data between different sandbox instances
  • Want to keep work safe even if sandbox crashes

Cloud Buckets

For large datasets or team sharing, you can use your own buckets:
Use cloud buckets for:
  • Sensitive data
  • Connecting existing object storage
  • Long-term data storage in your own infrastructure

Session Management

Timeout Configuration

Set timeouts to control costs:
Start with shorter timeouts and increase as needed. You can always create a new sandbox if you need more time.

Manual vs Automatic Termination

Use manual termination for:
  • Long-running training jobs
  • Collaborative development sessions
  • When you need to pause and resume work

Environment Variables and Secrets

Environment Variables

Pass configuration to your applications:
Environment variables are good for:
  • Keeping sensitive data out of your code
  • Configuring applications for different environments
  • Sharing configuration across team members

Secrets Management

You can attach secrets to your sandbox using Beam’s secret management system - they will be exposed as environment variables inside the Sandbox:
You add secrets using the Beam CLI:
Use secrets for:
  • Database passwords
  • API keys and tokens
  • Private keys and certificates

Best Practices

Start Small, Scale Up

You only pay for what you use. Start small and scale up as needed.

Common Mistakes

Over-provisioning

Start with minimal resources and scale up as needed.

Including Unnecessary Packages

Only include packages you actually use.

Long Timeouts for Short Tasks

Try to match timeout to expected task duration. You can always extend the timeout dynamically like so:

What’s Next?

Now that you understand configuration, let’s put it to work: