maple.server.daemon

MAPLE Daemon - Core orchestration server.

This module implements the main MAPLE daemon which provides a FastAPI-based HTTP server for managing policy and environment containers, running evaluations, and coordinating the entire MAPLE workflow.

The daemon handles: - Policy and environment lifecycle (pull, serve, stop) - Episode execution with policy-environment interaction - Health monitoring of running containers - State persistence via SQLite - Graceful shutdown and cleanup - Adapter-based transformation between policies and environments

Key components: - FastAPI application with REST endpoints - Container registry and health monitoring - Policy and environment backend management - Run orchestration with video recording - Signal handling for graceful shutdown

Classes

ActBatchRequest(*, policy_id, image, instruction)

Request model for batched policy inference.

ActRequest(*, policy_id, image, instruction)

Request model for single policy inference.

EnvInfoRequest(*, env_id)

Request model for getting environment information.

PullPolicyRequest(*, spec)

Request model for pulling a policy.

ResetEnvRequest(*, env_id[, seed])

Request model for resetting an environment.

RunRequest(*, policy_id, env_id, task[, ...])

Request model for running a policy on an environment task.

ServeEnvRequest(*, name[, device, num_envs, ...])

Request model for serving environment containers.

ServePolicyRequest(*, spec[, device, ...])

Request model for serving a policy container.

SetupEnvRequest(*, env_id, task[, seed, ...])

Request model for setting up an environment with a task.

StepEnvRequest(*, env_id, action)

Request model for stepping an environment.

VLADaemon(port, device[, health_check_interval])

MAPLE daemon server for managing policies, environments, and evaluations.