Overview
The server-client architecture enables distributed inference where the GR00T model runs on a GPU server and clients connect remotely to query actions. This is useful for:- Running inference on a remote GPU while controlling robots locally
- Sharing a single model across multiple robot instances
- Separating model execution from environment simulation
PolicyServer
Class definition
gr00t/policy/server_client.py
Constructor
The policy instance to serve (e.g.,
Gr00tPolicy or Gr00tSimPolicyWrapper)Host address to bind to. Use
"*" to listen on all interfaces, or "localhost" for local-only accessPort number to listen on
Optional API token for authentication (currently not enforced)
Methods
register_endpoint
Register a custom endpoint to the server.The name of the endpoint (e.g.,
"get_action", "reset")The handler function that will be called when the endpoint is hit
Whether the handler requires input data
run
Start the server and listen for requests.This method runs an infinite loop until the server is killed via the
"kill" endpoint.Default endpoints
The server automatically registers these endpoints:Health check endpoint that returns
{"status": "ok", "message": "Server is running"}Gracefully shutdown the server
Generate actions from observations. Calls
policy.get_action(observation, options)Reset the policy state. Calls
policy.reset(options)Get modality configurations. Calls
policy.get_modality_config()Usage example
PolicyClient
Class definition
gr00t/policy/server_client.py
Constructor
Hostname or IP address of the policy server
Port number of the policy server
Optional API token for authentication
Whether to enforce strict validation (passed to the remote policy)
Methods
ping
Check if the server is reachable.True if the server responds to ping, False otherwiseget_action
Generate actions from observations via the remote server.Observation dictionary (format depends on the server’s policy type)
Optional parameters
Dictionary of action arrays
Additional information
reset
Reset the remote policy.Optional reset parameters (e.g.,
{"episode_index": 5} for ReplayPolicy)Information dictionary
get_modality_config
Get modality configurations from the remote server.Modality configurations
send_request
Send a custom request to the server.The endpoint name (e.g.,
"get_action", "ping")Data to send with the request
Response from the server
Usage example
MsgSerializer
Internal serialization class for encoding/decoding messages over the network.gr00t/policy/server_client.py
The serializer automatically handles numpy arrays and
ModalityConfig objects. Custom classes can be supported by extending encode_custom_classes and decode_custom_classes.Network protocol
The server uses ZeroMQ (REP socket) with msgpack serialization:- Client sends request:
{"endpoint": "get_action", "data": {...}} - Server processes request and calls the appropriate handler
- Server sends response:
{"status": "success", "data": {...}}or{"status": "error", "error": "..."} - Client receives and deserializes response
Error handling
Server-side errors are caught and returned to the client:Performance considerations
See also
Server-client guide
Complete deployment guide
run_gr00t_server.py
Server launch script reference
Gr00tPolicy
Core policy class
Policy API guide
Using the policy API