Principle:Ray project Ray Deployment Class Definition
| Knowledge Sources | |
|---|---|
| Domains | Model_Serving, Microservices |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
A design pattern for defining request handler classes whose instances serve as replicas in a scalable model-serving deployment.
Description
A Deployment Class is a user-defined Java class that handles incoming requests in a Ray Serve deployment. Each replica of the deployment is an instance of this class. The class must have a callable method (conventionally named call) that accepts a request and returns a response. The class is instantiated by the Serve replica framework via reflection.
This is a user-defined pattern — no base class or interface is required. The method name is configurable via deployment configuration.
Usage
Define a deployment class when you need to serve predictions, process requests, or expose business logic as an HTTP endpoint or internal service.
Theoretical Basis
Deployment classes implement the Request Handler pattern. Each replica is a stateful or stateless handler that processes requests independently. The Serve framework manages replica lifecycle, load balancing, and health checking.