Implementation:Ray project Ray Serve Start
| Knowledge Sources | |
|---|---|
| Domains | Model_Serving, Microservices |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
Concrete tool for initializing the Ray Serve control plane provided by the Ray Java Serve SDK.
Description
Serve.start() initializes the Serve subsystem by creating or connecting to the Python-based Serve controller actor. It stores the resulting ServeControllerClient in Serve.globalClient. If Ray is not yet initialized, it calls Ray.init() first. The method reads configuration from system properties (ray.serve.proxy-host, ray.serve.proxy-port) and an optional config map.
Usage
Call Serve.start() before deploying any applications. It can be called with an optional config map to override default HTTP settings.
Code Reference
Source Location
- Repository: ray-project/ray
- File: java/serve/src/main/java/io/ray/serve/api/Serve.java (L54-148)
- File: java/serve/src/main/java/io/ray/serve/api/ServeControllerClient.java (L48-58)
Signature
public static ServeControllerClient start(Map<String, String> config)
Import
import io.ray.serve.api.Serve;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | Map<String, String> | No | Optional configuration overrides (HTTP host/port, etc.) |
Outputs
| Name | Type | Description |
|---|---|---|
| client | ServeControllerClient | Global controller client stored in Serve.globalClient |
Usage Examples
Basic Initialization
import io.ray.serve.api.Serve;
import java.util.HashMap;
public class ServeInit {
public static void main(String[] args) {
// Start Serve with default config
Serve.start(new HashMap<>());
// ... deploy applications ...
Serve.shutdown();
}
}