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:
- adds
RequestStateStore.input_types()to the graph’s inputs, as thestatefield after the KV cache (and LoRA) inputs; - fills them each step from
RequestStateStore.prepare(); - passes the
statethe decoder returns, which the graph outputs after the role’s outputs, toRequestStateStore.update(); - calls
RequestStateStore.release()when a request finishes, andRequestStateStore.release_warmup()after each graph-capture warmup probe.
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
RequestStateStore | Holds the state a registered decoder keeps for each request in flight. |
|---|
build_state_store | Returns the state store a registered decoder declares, if any. |
|---|
State inputs and outputs
RequestStateGroup | A graph-API decoder's state inputs, or the state outputs it writes back. |
|---|
split_state_outputs | Splits a decoder graph's flat outputs into the role's and the state. |
|---|
Pipeline models
RequestStateMixin | Gives a registered pipeline model its decoder's state lifecycle. |
|---|