gr00t/eval/run_gr00t_server.py) runs a policy as a network server, allowing multiple clients to send observations and receive actions over TCP.
Usage
Parameters
Policy configuration
str
default:"None"
Path to the model checkpoint directory for GR00T policy inference.Either
model-path or dataset-path must be provided.EmbodimentTag
default:"NEW_EMBODIMENT"
Embodiment tag identifying the robot configuration. See embodiment tags.
str
default:"cuda"
Device to run the model on:
cuda, cuda:0, cuda:1, or cpu.Replay policy configuration
str
default:"None"
Path to a dataset for replay policy (replays recorded trajectories instead of running inference).Use this for debugging or baseline comparisons.
str
default:"None"
Path to a JSON file containing modality configuration for replay policy.If not provided, uses default configuration from
MODALITY_CONFIGS[embodiment_tag].int
default:"None"
Policy execution horizon during inference. If specified, overrides the default horizon.
Server configuration
str
default:"0.0.0.0"
Host address for the server. Use
0.0.0.0 to accept connections from any network interface.int
default:"5555"
Port number for the server to listen on.
bool
default:"True"
Whether to enforce strict input and output validation. Recommended to keep enabled for production.
bool
default:"False"
Whether to wrap the policy with
Gr00tSimPolicyWrapper for simulation-specific processing.Enable this when serving policies for simulation environments.Example workflows
Serve a GR00T policy
Serve for simulation
Serve a replay policy
Multi-GPU setup
Run multiple servers on different GPUs:Client usage
Connect to the server usingPolicyClient:
With open-loop evaluation
With closed-loop evaluation
Policy types
Gr00tPolicy
Loaded whenmodel-path is provided:
- Runs transformer-based policy inference
- Supports all GR00T embodiments
- GPU-accelerated
- Configurable via
embodiment-taganddevice
ReplayPolicy
Loaded whendataset-path is provided:
- Replays actions from recorded demonstrations
- Useful for testing data collection pipelines
- Configurable via
modality-config-pathandexecution-horizon
Server protocol
The server implements a simple request-response protocol:- Client sends observation dictionary
- Server runs policy inference
- Server returns action dictionary and metadata
PolicyServer class handles:
- TCP socket management
- Request serialization/deserialization
- Multi-client support (sequential processing)
- Graceful shutdown on KeyboardInterrupt
Performance considerations
- Single client per server: The server processes requests sequentially. For parallel inference, run multiple servers on different ports/GPUs.
- Batch size: Each request processes a single observation. For higher throughput, use local policy inference instead.
- Network latency: Server adds network overhead. For real-time applications, consider deploying on the same machine as the client.