Skip to main content
Modal provides serverless container infrastructure with GPU support. Best for ML/AI workloads and Python development.

Setup

Authentication

Get your tokens from modal.com/settings/tokens.
Or pass credentials directly:

Usage with deepagents

Standalone usage

Configuration

GPU support

Modal supports NVIDIA GPUs for ML workloads:

Volumes and secrets

Mount Modal Volumes for persistent storage and inject secrets as environment variables:

Initial files

Pre-populate the sandbox with files during creation:

Accessing the Modal SDK

For advanced features not exposed by BaseSandbox, access the underlying Modal SDK:

Reconnecting to existing sandboxes

Factory functions

Error handling

Error codes

Environment variables