--- title: Sticky Sessions and Routing Keys --- # Sticky Sessions and Routing Keys A multi-turn conversation runs fastest when each turn lands on the worker that served the turn before it, because that worker still holds the conversation's prefix in its KV cache. Sticky sessions give SMG that property: each request carries a **routing key**, taken from the request body's `rid` or from a header, and SMG pins the key to one worker for as long as the key stays in use. SMG provides stickiness in two forms: - The **`manual` policy** pins every keyed request in its own key-to-worker map. - The **routing-key override** (`--routing-key-override`, alias `--sticky-sessions`) adds the same pinning on top of any other policy. Keyed requests stick; requests without a key, and by default the first request for each new key, are still placed by the configured policy, such as `cache_aware`. --- ## Overview