configs
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| BaseExecutionEnvironmentConfig exxec_config.configs Base execution environment configuration. |
|
|
| BeamExecutionEnvironmentConfig exxec_config.configs Beam execution environment configuration. |
||
| CloudflareExecutionEnvironmentConfig exxec_config.configs Cloudflare sandbox execution environment configuration. |
||
| DaytonaExecutionEnvironmentConfig exxec_config.configs Daytona execution environment configuration. |
||
| DockerExecutionEnvironmentConfig exxec_config.configs Docker execution environment configuration. |
||
| E2bExecutionEnvironmentConfig exxec_config.configs E2B execution environment configuration. |
||
| HopxExecutionEnvironmentConfig exxec_config.configs Hopx execution environment configuration. |
||
| LocalExecutionEnvironmentConfig exxec_config.configs Local execution environment configuration. |
||
| MicrosandboxExecutionEnvironmentConfig exxec_config.configs Microsandbox execution environment configuration. |
||
| MockExecutionEnvironmentConfig exxec_config.configs Mock execution environment configuration. |
||
| ModalExecutionEnvironmentConfig exxec_config.configs Modal execution environment configuration. |
||
| PyodideExecutionEnvironmentConfig exxec_config.configs Pyodide execution environment configuration. |
||
| SRTExecutionEnvironmentConfig exxec_config.configs Sandboxed execution environment using Anthropic's sandbox-runtime. |
||
| SpritesExecutionEnvironmentConfig exxec_config.configs Sprites execution environment configuration. |
||
| SshExecutionEnvironmentConfig exxec_config.configs SSH execution environment configuration. |
||
| VercelExecutionEnvironmentConfig exxec_config.configs Vercel execution environment configuration. |
🛈 DocStrings¶
Execution environment configuration.
BaseExecutionEnvironmentConfig
¶
Bases: Schema
Base execution environment configuration.
Source code in src/exxec_config/configs.py
cwd
class-attribute
instance-attribute
¶
cwd: str | None = Field(
default=None, title="Working Directory", examples=["/home/user/project", "/tmp/workspace"]
)
Working directory for the environment (None means use default/auto).
default_command_timeout
class-attribute
instance-attribute
¶
default_command_timeout: float | None = Field(
default=None, gt=0.0, title="Default Command Timeout", examples=[30.0, 60.0, 120.0]
)
Default timeout for individual command execution in seconds. None means no timeout.
dependencies
class-attribute
instance-attribute
¶
dependencies: list[str] | None = Field(
default=None, title="Dependencies", examples=["numpy", "pandas"]
)
List of packages to install (pip for Python, npm for JS/TS).
env_vars
class-attribute
instance-attribute
¶
env_vars: dict[str, str] | None = Field(
default=None, title="Environment Variables", examples=[{"API_KEY": "secret", "DEBUG": "1"}]
)
Environment variables to set for all executions.
inherit_env
class-attribute
instance-attribute
¶
If True, inherit environment variables from os.environ (default False for security).
BeamExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Beam execution environment configuration.
Executes code in Beam cloud sandboxes for scalable, serverless execution environments.
Source code in src/exxec_config/configs.py
cpu
class-attribute
instance-attribute
¶
cpu: float | str = Field(
default=1.0, ge=0.1, le=64.0, title="CPU Cores", examples=[0.5, 1.0, 2.0, "1500m"]
)
CPU cores allocated to the container.
keep_warm_seconds
class-attribute
instance-attribute
¶
Seconds to keep sandbox alive, -1 for no timeout.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
memory
class-attribute
instance-attribute
¶
Memory allocated to the container in MiB.
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> BeamExecutionEnvironment
Create Beam execution environment instance.
Source code in src/exxec_config/configs.py
CloudflareExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Cloudflare sandbox execution environment configuration.
Executes code in a Cloudflare Worker sandbox deployment via HTTP API.
Source code in src/exxec_config/configs.py
account_id
class-attribute
instance-attribute
¶
Cloudflare account ID (optional).
api_token
class-attribute
instance-attribute
¶
API token for authentication (optional).
base_url
class-attribute
instance-attribute
¶
Base URL of the Cloudflare Sandbox Worker deployment.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
session_id
class-attribute
instance-attribute
¶
Explicit session ID (auto-generated if None).
timeout
class-attribute
instance-attribute
¶
HTTP request timeout in seconds.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> CloudflareExecutionEnvironment
Create Cloudflare execution environment instance.
Source code in src/exxec_config/configs.py
DaytonaExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Daytona execution environment configuration.
Executes code in remote Daytona sandboxes for cloud-based development environments.
Source code in src/exxec_config/configs.py
api_key
class-attribute
instance-attribute
¶
API key for authentication.
api_url
class-attribute
instance-attribute
¶
api_url: str | None = Field(
default=None, title="API URL", examples=["https://api.daytona.io", "http://localhost:3986"]
)
Daytona API URL (optional, uses env vars if not provided).
image
class-attribute
instance-attribute
¶
image: str = Field(
default="python:3.13-slim",
title="Container Image",
examples=["python:3.13-slim", "node:20-alpine", "ubuntu:22.04"],
)
Container image.
keep_alive
class-attribute
instance-attribute
¶
Keep sandbox running after execution.
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
target
class-attribute
instance-attribute
¶
target: str | None = Field(
default=None, title="Target Configuration", examples=["local", "docker", "kubernetes"]
)
Target configuration.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> DaytonaExecutionEnvironment
Create Daytona execution environment instance.
Source code in src/exxec_config/configs.py
DockerExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Docker execution environment configuration.
Executes code in Docker containers for strong isolation and reproducible environments.
Source code in src/exxec_config/configs.py
image
class-attribute
instance-attribute
¶
image: str = Field(
default="python:3.13-slim",
title="Docker Image",
examples=["python:3.13-slim", "node:20-alpine", "ubuntu:22.04"],
)
Docker image to use.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> DockerExecutionEnvironment
Create Docker execution environment instance.
Source code in src/exxec_config/configs.py
E2bExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
E2B execution environment configuration.
Executes code in E2B sandboxes for secure, ephemeral execution environments.
Source code in src/exxec_config/configs.py
keep_alive
class-attribute
instance-attribute
¶
Keep sandbox running after execution.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
template
class-attribute
instance-attribute
¶
template: str | None = Field(
default=None, title="E2B Template", examples=["python", "nodejs", "custom-template-id"]
)
E2B template to use.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> E2bExecutionEnvironment
Create E2B execution environment instance.
Source code in src/exxec_config/configs.py
HopxExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Hopx execution environment configuration.
Executes code in Hopx cloud VM sandboxes for secure, ephemeral execution environments.
Source code in src/exxec_config/configs.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
api_key
class-attribute
instance-attribute
¶
Hopx API key (or use HOPX_API_KEY env var).
base_url
class-attribute
instance-attribute
¶
Hopx API base URL.
internet_access
class-attribute
instance-attribute
¶
Enable internet access in the sandbox.
keep_alive
class-attribute
instance-attribute
¶
Keep sandbox running after execution.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
region
class-attribute
instance-attribute
¶
Preferred region for sandbox creation.
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
template
class-attribute
instance-attribute
¶
template: str | None = Field(
default=None, title="Hopx Template", examples=["code-interpreter", "base"]
)
Hopx template name to use.
template_id
class-attribute
instance-attribute
¶
Hopx template ID (alternative to template name).
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> HopxExecutionEnvironment
Create Hopx execution environment instance.
Source code in src/exxec_config/configs.py
LocalExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Local execution environment configuration.
Executes code in the same process. Fastest option but offers no isolation.
Source code in src/exxec_config/configs.py
executable
class-attribute
instance-attribute
¶
executable: str | None = Field(
default=None,
title="Python Executable",
examples=["/usr/bin/python3", "python3.13", "/opt/conda/bin/python"],
)
Python executable to use (if None, auto-detect based on language).
isolated
class-attribute
instance-attribute
¶
Whether to run code in a subprocess.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
root_path
class-attribute
instance-attribute
¶
Path to become the root of the filesystem.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> LocalExecutionEnvironment
Create local execution environment instance.
Source code in src/exxec_config/configs.py
MicrosandboxExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Microsandbox execution environment configuration.
Executes code in lightweight microVMs for strong isolation.
Source code in src/exxec_config/configs.py
api_key
class-attribute
instance-attribute
¶
API key for authentication (uses MSB_API_KEY env var if None).
cpus
class-attribute
instance-attribute
¶
Number of virtual CPUs.
image
class-attribute
instance-attribute
¶
image: str | None = Field(
default=None, title="Docker Image", examples=["python:3.13-slim", "node:20-alpine"]
)
Custom Docker image (uses default for language if None).
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
memory
class-attribute
instance-attribute
¶
Memory limit in MiB.
namespace
class-attribute
instance-attribute
¶
Prefix for the sandbox name (a unique suffix is appended).
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> MicrosandboxExecutionEnvironment
Create Microsandbox execution environment instance.
Source code in src/exxec_config/configs.py
MockExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Mock execution environment configuration.
For testing purposes. Uses an in-memory filesystem and configurable results. Dicts are passed as **kwargs to ExecutionResult/ProcessOutput constructors.
Source code in src/exxec_config/configs.py
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 | |
code_results
class-attribute
instance-attribute
¶
code_results: dict[str, dict[str, Any]] | None = Field(
default=None,
title="Code Results",
examples=[{"print('hello')": {"stdout": "hello", "success": True}}],
)
Map of code string to ExecutionResult kwargs dict.
command_results
class-attribute
instance-attribute
¶
command_results: dict[str, dict[str, Any]] | None = Field(
default=None,
title="Command Results",
examples=[{"ls": {"stdout": "file1.txt", "success": True}}],
)
Map of command string to ExecutionResult kwargs dict.
default_result
class-attribute
instance-attribute
¶
default_result: dict[str, Any] | None = Field(
default=None, title="Default Result", examples=[{"stdout": "", "success": True}]
)
Default ExecutionResult kwargs when no specific match is found.
deterministic_ids
class-attribute
instance-attribute
¶
Use sequential IDs instead of UUIDs for processes (useful for snapshot testing).
files
class-attribute
instance-attribute
¶
files: dict[str, str] | None = Field(
default=None,
title="Files",
examples=[{"/test/hello.txt": "Hello, World!", "/data/config.json": '{"key": "value"}'}],
)
Map of file paths to contents to pre-populate in the in-memory filesystem.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> MockExecutionEnvironment
Create mock execution environment instance.
Source code in src/exxec_config/configs.py
ModalExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Modal execution environment configuration.
Executes code in Modal serverless sandboxes for scalable cloud execution.
Source code in src/exxec_config/configs.py
app_name
class-attribute
instance-attribute
¶
app_name: str | None = Field(
default=None, title="App Name", examples=["my-app", "anyenv-execution"]
)
Modal app name (creates if missing).
cpu
class-attribute
instance-attribute
¶
CPU allocation in cores.
gpu
class-attribute
instance-attribute
¶
GPU type.
idle_timeout
class-attribute
instance-attribute
¶
Idle timeout in seconds.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
memory
class-attribute
instance-attribute
¶
Memory allocation in MB.
timeout
class-attribute
instance-attribute
¶
Timeout for the sandbox.
workdir
class-attribute
instance-attribute
¶
Working directory in sandbox.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> ModalExecutionEnvironment
Create Modal execution environment instance.
Source code in src/exxec_config/configs.py
PyodideExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Pyodide execution environment configuration.
Executes Python code in WASM via Deno for sandboxed browser-like execution.
Source code in src/exxec_config/configs.py
allow_env
class-attribute
instance-attribute
¶
Environment variable access.
allow_ffi
class-attribute
instance-attribute
¶
Foreign function interface access.
allow_net
class-attribute
instance-attribute
¶
Network access (True=all, list=specific hosts, False=none).
allow_read
class-attribute
instance-attribute
¶
File read access.
allow_run
class-attribute
instance-attribute
¶
Subprocess execution (limited in WASM).
allow_write
class-attribute
instance-attribute
¶
File write access.
deno_executable
class-attribute
instance-attribute
¶
deno_executable: str | None = Field(
default=None, title="Deno Executable", examples=["deno", "/usr/local/bin/deno"]
)
Path to deno executable (auto-detected if None).
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Sandbox Lifetime", examples=[300.0, 600.0, 3600.0]
)
How long the sandbox stays alive in seconds.
startup_timeout
class-attribute
instance-attribute
¶
Timeout for Pyodide initialization in seconds.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> PyodideExecutionEnvironment
Create Pyodide execution environment instance.
Source code in src/exxec_config/configs.py
SRTExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Sandboxed execution environment using Anthropic's sandbox-runtime.
Executes code locally with OS-level sandboxing for network and filesystem restrictions.
Requires srt CLI: npm install -g @anthropic-ai/sandbox-runtime
dependencies are installed with pip install outside the sandbox (they come from
this configuration, not from the sandboxed code).
Source code in src/exxec_config/configs.py
executable
class-attribute
instance-attribute
¶
executable: str | None = Field(
default=None, title="Executable", examples=["/usr/bin/python3", "python3.13"]
)
Executable to use (auto-detect if None).
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
sandbox
class-attribute
instance-attribute
¶
sandbox: SandboxConfig = Field(default_factory=SandboxConfig)
Sandbox restrictions configuration.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> SRTExecutionEnvironment
Create sandboxed execution environment instance.
Source code in src/exxec_config/configs.py
SpritesExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Sprites execution environment configuration.
Executes code in Sprites (Fly.io) cloud VMs for secure, ephemeral execution.
Source code in src/exxec_config/configs.py
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | |
base_url
class-attribute
instance-attribute
¶
Sprites API base URL.
cpus
class-attribute
instance-attribute
¶
Number of CPUs for the sprite.
keep_alive
class-attribute
instance-attribute
¶
Keep sprite running after exiting context manager.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
name
class-attribute
instance-attribute
¶
Sprite name (auto-generated if None).
ram_mb
class-attribute
instance-attribute
¶
RAM in MB for the sprite.
region
class-attribute
instance-attribute
¶
Preferred region for sprite creation.
storage_gb
class-attribute
instance-attribute
¶
Storage in GB for the sprite.
timeout
class-attribute
instance-attribute
¶
Default command timeout in seconds.
token
class-attribute
instance-attribute
¶
Sprites API token (or use SPRITES_TOKEN env var).
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> SpritesExecutionEnvironment
Create Sprites execution environment instance.
Source code in src/exxec_config/configs.py
SshExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
SSH execution environment configuration.
Executes code on a remote machine via SSH connection.
Source code in src/exxec_config/configs.py
host
class-attribute
instance-attribute
¶
Remote host to connect to.
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
password
class-attribute
instance-attribute
¶
SSH password (if not using key auth).
port
class-attribute
instance-attribute
¶
SSH port.
private_key_path
class-attribute
instance-attribute
¶
private_key_path: str | None = Field(
default=None, title="Private Key Path", examples=["~/.ssh/id_rsa", "/path/to/key"]
)
Path to SSH private key file.
sandbox_timeout
class-attribute
instance-attribute
¶
sandbox_timeout: float = Field(
default=300.0, gt=0.0, title="Connection Timeout", examples=[300.0, 600.0, 3600.0]
)
SSH connection timeout in seconds.
username
class-attribute
instance-attribute
¶
SSH username.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> SshExecutionEnvironment
Create SSH execution environment instance.
Source code in src/exxec_config/configs.py
VercelExecutionEnvironmentConfig
¶
Bases: BaseExecutionEnvironmentConfig
Vercel execution environment configuration.
Executes code in Vercel cloud sandboxes for serverless execution.
Source code in src/exxec_config/configs.py
image
class-attribute
instance-attribute
¶
Vercel Container Registry image reference (uses Vercel default if None).
language
class-attribute
instance-attribute
¶
language: Language = Field(
default="python", title="Programming Language", examples=["python", "javascript", "typescript"]
)
Programming language to use.
memory
class-attribute
instance-attribute
¶
Memory in MB for the sandbox.
ports
class-attribute
instance-attribute
¶
List of ports to expose.
project_id
class-attribute
instance-attribute
¶
Vercel project ID (uses environment if None).
team_id
class-attribute
instance-attribute
¶
Vercel team ID (uses environment if None).
timeout
class-attribute
instance-attribute
¶
Timeout for the sandbox.
token
class-attribute
instance-attribute
¶
Vercel API token (uses environment if None).
vcpus
class-attribute
instance-attribute
¶
Number of virtual CPUs for the sandbox.
get_provider
¶
get_provider(
lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None,
) -> VercelExecutionEnvironment
Create Vercel execution environment instance.