maple.backend.policy.base

Base class for policy backends.

This module provides the abstract base class for policy backends that manage vision-language-action models. Policy backends handle the complete lifecycle of policy containers including:

  • Pulling model weights from HuggingFace

  • Managing Docker containers with GPU support

  • Loading models with various configurations

  • Serving inference requests via HTTP API

  • Health monitoring and cleanup

Key features: - Docker-based containerization for isolation - GPU device management and CUDA configuration - Automatic port mapping and health checks - Image encoding utilities for observations - Retry logic for network requests - Configuration management with defaults

Classes

PolicyBackend()

Abstract base class for Docker-based policy backends.

PolicyHandle(policy_id, backend_name, ...)

Handle representing a running policy container instance.