ray.serve.config.HTTPOptions#

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

HTTP options for the proxies. Supported fields:

  • host: Host that the proxies listens for HTTP on. Defaults to “127.0.0.1”. To expose Serve publicly, you probably want to set this to “0.0.0.0”.

  • port: Port that the proxies listen for HTTP on. Defaults to 8000.

  • root_path: An optional root path to mount the serve application (for example, “/prefix”). All deployment routes are prefixed with this path.

  • request_timeout_s: End-to-end timeout for HTTP requests.

  • keep_alive_timeout_s: Duration to keep idle connections alive when no requests are ongoing.

  • ssl_keyfile: Path to the SSL key file for HTTPS. If provided with ssl_certfile, the HTTP server will use HTTPS.

  • ssl_certfile: Path to the SSL certificate file for HTTPS. If provided with ssl_keyfile, the HTTP server will use HTTPS.

  • ssl_keyfile_password: Optional password for the SSL key file.

  • ssl_ca_certs: Optional path to CA certificate file for client certificate verification.

  • location: [DEPRECATED: use proxy_location field instead] The deployment location of HTTP servers:

    • “HeadOnly”: start one HTTP server on the head node. Serve assumes the head node is the node you executed serve.start on. This is the default.

    • “EveryNode”: start one HTTP server per node.

    • “NoServer”: disable HTTP server.

  • num_cpus: [DEPRECATED] The number of CPU cores to reserve for each internal Serve HTTP proxy actor.

field host: str | None = '127.0.0.1'#
field keep_alive_timeout_s: int = 90#
field location: DeploymentMode | None = DeploymentMode.HeadOnly#
field middlewares: List[Any] = []#
field num_cpus: int = 0#
field port: int = 8000#
field request_timeout_s: float | None = None#
field root_path: str = ''#
field root_url: str = ''#
field ssl_ca_certs: str | None = None#
field ssl_certfile: str | None = None#
field ssl_keyfile: str | None = None#
field ssl_keyfile_password: str | None = None#
validator location_backfill_no_server  »  all fields[source]#
validator validate_ssl_certfile  »  ssl_certfile[source]#
validator warn_for_middlewares  »  middlewares[source]#
validator warn_for_num_cpus  »  num_cpus[source]#