Skip to content

PrefixAwareRoutingConfig

Source code in docs_src/capo_sagemaker/types/prefix_aware_routing_config.py
class PrefixAwareRoutingConfig(TypedDict, closed=True):
    prefix_length: NotRequired[
        "capo_sagemaker.types.prefix_aware_routing_prefix_length.PrefixAwareRoutingPrefixLength"
    ]
    """<p>The maximum length of the prefix used for routing decisions. Required when <code>RoutingStrategy</code> is <code>PREFIX_AWARE</code>.</p> <ul> <li> <p>For the SageMaker Runtime <code>InvokeEndpoint</code> and <code>InvokeEndpointWithResponseStream</code> APIs, this value specifies the number of bytes from the beginning of the request body.</p> </li> <li> <p>For OpenAI-compatible API, this value specifies the number of characters from the text content of the messages array.</p> </li> </ul> <p>The endpoint routes requests that share the same prefix to the same instance. Set this value to cover shared content (such as system prompts) plus enough unique content to distribute workloads across instances.</p>"""
    concurrency_threshold: NotRequired[
        "capo_sagemaker.types.prefix_aware_routing_concurrency_threshold.PrefixAwareRoutingConcurrencyThreshold"
    ]
    """<p>The maximum number of in-flight requests on the target instance before the endpoint routes to another instance. Required when <code>RoutingStrategy</code> is <code>PREFIX_AWARE</code>. When in-flight requests on the prefix-selected instance reach this threshold, the endpoint routes the request to an instance with more available capacity.</p>"""

concurrency_threshold instance-attribute

concurrency_threshold: NotRequired[PrefixAwareRoutingConcurrencyThreshold]

The maximum number of in-flight requests on the target instance before the endpoint routes to another instance. Required when RoutingStrategy is PREFIX_AWARE. When in-flight requests on the prefix-selected instance reach this threshold, the endpoint routes the request to an instance with more available capacity.

prefix_length instance-attribute

prefix_length: NotRequired[PrefixAwareRoutingPrefixLength]

The maximum length of the prefix used for routing decisions. Required when RoutingStrategy is PREFIX_AWARE.

  • For the SageMaker Runtime InvokeEndpoint and InvokeEndpointWithResponseStream APIs, this value specifies the number of bytes from the beginning of the request body.

  • For OpenAI-compatible API, this value specifies the number of characters from the text content of the messages array.

The endpoint routes requests that share the same prefix to the same instance. Set this value to cover shared content (such as system prompts) plus enough unique content to distribute workloads across instances.