ray.serve.config.AutoscalingPolicy#
- pydantic model ray.serve.config.AutoscalingPolicy[source]#
PublicAPI (alpha): This API is in alpha and may change before becoming stable.
- field policy_function: str | Callable = 'ray.serve.autoscaling_policy:default_autoscaling_policy'#
Policy function can be a string import path or a function callable. If it’s a string import path, it must be of the form
path.to.module:function_name.
- field policy_kwargs: Dict[str, Any] [Optional]#
Keyword arguments passed to the policy class constructor when policy_function refers to a class. Ignored when policy_function is a plain function. Values must be JSON-serializable.
- classmethod from_serialized_policy_def(policy_config: dict, serialized_policy_def: bytes) AutoscalingPolicy[source]#
- get_policy() Callable[source]#
Deserialize policy from cloudpickled bytes.
The result is cached to avoid repeated cloudpickle deserialization on every call (e.g. on every autoscaling tick).
- validator policy_kwargs_json_serializable » policy_kwargs[source]#