serve
Start the Maple daemon or serve policies/environments.
Synopsis
maple serve [OPTIONS]
maple serve policy NAME [OPTIONS]
maple serve env NAME [OPTIONS]
Description
The serve command has three modes:
Daemon mode: Start the background daemon
Policy mode: Load a policy into a container
Env mode: Start an environment container
Daemon Mode
Start the Maple daemon:
maple serve [OPTIONS]
Options
--port INTEGERPort to run daemon on (default: from config, typically 8000)
--device TEXTDefault GPU device (default: from config, typically cpu)
--detach, -dRun daemon in background
Examples
# Start daemon in foreground
maple serve
# Start on specific port
maple serve --port 9000
# Run in background
maple serve --detach
# Use specific GPU
maple serve --device cuda:1
Policy Mode
Load a policy into a Docker container:
maple serve policy NAME [OPTIONS]
Arguments
NAMEPolicy specification (e.g.,
openvla:7b,smolvla:libero)
Options
--port INTEGERDaemon port to connect to (default: from config, typically 8000)
--device, -d TEXTGPU device for this policy (default: from config, typically cpu)
--host-port, -p INTEGERBind container to specific host port
--mdl-kwargs, -a STRModel-specific loading parameters
Examples
# Serve default variant
maple serve policy openvla
# Serve specific variant
maple serve policy openvla:7b
# Use Flash Attention
maple serve policy openvla:7b --mdl-kwargs '{"attention_implementation" : "flash_attention_2"}'
# Bind to specific port
maple serve policy openvla:7b --host-port 8080
# Use different GPU
maple serve policy openvla:7b --device cuda:1
Output
✓ Serving policy: openvla:7b
Policy ID: openvla-7b-a1b2c3d4
Port: http://localhost:50123
Device: cuda:0
Parameters :
attention_implementation: sdpa
Environment Mode
Start environment container(s):
maple serve env NAME [OPTIONS]
Arguments
NAMEEnvironment name (e.g.,
libero,simplerenv)
Options
--port INTEGERDaemon port to connect to
--num-envs, -n INTEGERNumber of parallel environment instances
--host-port, -p INTEGERBind container to specific host port (only with num_envs=1)
Examples
# Start single environment
maple serve env libero
# Start multiple parallel environments
maple serve env libero --num-envs 4
# Bind to specific port
maple serve env libero --host-port 8081
Output
✓ Serving env: libero (1 instance(s))
• libero-x1y2z3w4 → http://localhost:50124
Notes
The daemon must be running before serving policies or environments
Policy IDs and Environment IDs are generated automatically
Use
maple statusto see all running policies and environmentsUse
maple policy stopormaple env stopto stop containers