Configuration

Maple uses a hierarchical configuration system with the following priority (highest to lowest):

  1. CLI arguments

  2. Environment variables

  3. Config file (~/.maple/config.yaml)

  4. Built-in defaults

Config File

Create a default config file:

maple config init

This creates ~/.maple/config.yaml:

# Maple Configuration

logging:
  level: INFO           # DEBUG, INFO, WARNING, ERROR
  file: null            # Optional log file path
  verbose: false

containers:
  memory_limit: 32g     # Container memory limit
  shm_size: 2g          # Shared memory size
  startup_timeout: 300  # Seconds to wait for container startup
  health_check_interval: 30

policy:
  default_device: cuda:0
  model_kwargs: {}
  model_load_kwargs: {}

env:
  default_num_envs: 1

daemon:
  host: 0.0.0.0
  port: 8000

eval:
  max_steps: 300
  save_video: false
  video_dir: ~/.maple/videos
  results_dir: ~/.maple/results

View Current Config

maple config show

Get Config Path

maple config path
# Output: /home/user/.maple/config.yaml

Environment Variables

Override any config value with environment variables:

Variable

Config Key

Example

MAPLE_DEVICE

policy.default_device

cuda:1

MAPLE_LOG_LEVEL

logging.level

DEBUG

MAPLE_LOG_FILE

logging.file

/var/log/maple.log

MAPLE_MEMORY_LIMIT

containers.memory_limit

64g

MAPLE_STARTUP_TIMEOUT

containers.startup_timeout

600

MAPLE_DAEMON_PORT

daemon.port

9000

MAPLE_MAX_STEPS

eval.max_steps

500

MAPLE_SAVE_VIDEO

eval.save_video

true

Example:

MAPLE_DEVICE=cuda:1 MAPLE_LOG_LEVEL=DEBUG maple serve

CLI Arguments

CLI arguments always override config and environment variables:

# These override everything
maple serve --port 9000 --device cuda:2
maple eval ... --max-steps 500 --save-video

Common Configuration Patterns

Multi-GPU Setup

Config file for a multi-GPU machine:

policy:
  default_device: cuda:0

# Run different policies on different GPUs
# Use CLI override: maple serve policy model --device cuda:1

High Memory Models

For large models (30B+):

containers:
  memory_limit: 64g
  shm_size: 4g
  startup_timeout: 600  # More time for large models

Debugging

Verbose logging:

logging:
  level: DEBUG
  file: ~/.maple/logs/maple.log
  verbose: true

Production Evaluation

For batch evaluation runs:

eval:
  max_steps: 500
  save_video: true
  video_dir: /data/eval_videos
  results_dir: /data/eval_results

containers:
  health_check_interval: 60  # Less frequent checks

Per-Project Configuration

You can specify a custom config file:

maple --config ./project_config.yaml serve

This is useful for project-specific settings without modifying your global config.