maple.backend.envs.base.EnvBackend.serve

EnvBackend.serve(num_envs: int = 1, device: str = 'cpu', host_port: int | None = None) List[EnvHandle]

Start environment container(s).

Launches one or more Docker containers for parallel environment execution. Each container gets a unique ID and is registered for cleanup tracking. Validates startup by waiting for health checks.

Parameters:
  • num_envs – Number of environment containers to start.

  • host_port – Optional specific port to bind (only valid with num_envs=1).

Returns:

List of EnvHandle instances for the started containers.