ray.serve.config.gRPCOptions#

pydantic model ray.serve.config.gRPCOptions[source]#

gRPC options for the proxies. Supported fields:

Parameters:
  • port (int) – Port for gRPC server if started. Default to 9000. Cannot be updated once Serve has started running. Serve must be shut down and restarted with the new port instead.

  • grpc_servicer_functions (List[str]) – List of import paths for gRPC add_servicer_to_server functions to add to Serve’s gRPC proxy. Default to empty list, which means no gRPC methods will be added and no gRPC server will be started. The servicer functions need to be importable from the context of where Serve is running.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.

Show JSON schema
{
   "title": "gRPCOptions",
   "description": "gRPC options for the proxies. Supported fields:\n\nArgs:\n    port (int):\n        Port for gRPC server if started. Default to 9000. Cannot be\n        updated once Serve has started running. Serve must be shut down and\n        restarted with the new port instead.\n    grpc_servicer_functions (List[str]):\n        List of import paths for gRPC `add_servicer_to_server` functions to add to\n        Serve's gRPC proxy. Default to empty list, which means no gRPC methods will\n        be added and no gRPC server will be started. The servicer functions need to\n        be importable from the context of where Serve is running.\n\n**PublicAPI (alpha):** This API is in alpha and may change before becoming stable.",
   "type": "object",
   "properties": {
      "port": {
         "title": "Port",
         "default": 9000,
         "type": "integer"
      },
      "grpc_servicer_functions": {
         "title": "Grpc Servicer Functions",
         "default": [],
         "type": "array",
         "items": {
            "type": "string"
         }
      }
   }
}

Fields:
field grpc_servicer_functions: List[str] = []#
field port: int = 9000#
property grpc_servicer_func_callable: List[Callable]#

Return a list of callable functions from the grpc_servicer_functions.

If the function is not callable or not found, it will be ignored and a warning will be logged.