IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python module

max.pipelines.lib.request_state

Per-request state a registered decoder carries from one step to the next.

A recurrent or convolutional decoder keeps state for each request beside its KV cache, such as LFM2’s short-convolution states or Nemotron-H’s Mamba pools. A registered DECODER class declares that state with a state_store classmethod that returns a RequestStateStore, and the framework then:

A store either takes the state back from the graph’s outputs each step, or hands the graph mutable buffers that it updates in place, in which case the decoder returns no state.

State store​

RequestStateStoreHolds the state a registered decoder keeps for each request in flight.
build_state_storeReturns the state store a registered decoder declares, if any.

State inputs and outputs​

RequestStateGroupA graph-API decoder's state inputs, or the state outputs it writes back.
split_state_outputsSplits a decoder graph's flat outputs into the role's and the state.

Pipeline models​

RequestStateMixinGives a registered pipeline model its decoder's state lifecycle.