ray.serve.HTTPOptions usage

[Serve API Reference — Ray v1.9.1]

http_options: Union[dict, ray.serve.config.HTTPOptions, None] = None

The Dict option is understood but how is the HTTPOptions used with ray.serve?

The HTTPOptions class is a wrapper class for the values that can be passed in with the dict. You can either initialize the HTTPOptions object yourself using those values, or you can pass the values in via a dict.

As a side note, the HTTPOptions class also performs validation on values when it’s initialized (see its source code here). In fact, even if a dict is passed in, it gets converted into an HTTPOptions object.