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 class
GraphRole
GraphRole
class max.pipelines.lib.graph_specs.GraphRole(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
The roles of the graphs MAX’s pipelines run.
DECODER
DECODER = 'decoder'
The forward pass: tokens and KV cache to logits.
DRAFT
DRAFT = 'draft'
A speculative proposal model, composed with a target decoder.
ENCODER
ENCODER = 'encoder'
The single forward pass of a model without a KV cache, such as an embedding model: inputs to embeddings or hidden states.
EP_INIT
EP_INIT = 'ep_init'
The one-time expert-parallel setup graph run at engine startup.
SAMPLER
SAMPLER = 'sampler'
Samples the next token from the decoder’s logits.
SAMPLER_BITMASK
SAMPLER_BITMASK = 'sampler_bitmask'
Samples the next token, masked by a structured-output bitmask.
SPEC_DECODER
SPEC_DECODER = 'spec_decoder'
One speculative-decoding step, the target and draft models fused: tokens, the previous drafts and KV cache to the accepted tokens and the next drafts.
VISION
VISION = 'vision'
The vision encoder: image patches to soft-token embeddings.
VISION_PREPROCESS
VISION_PREPROCESS = 'vision_preprocess'
One image’s preprocessing, on the CPU: decoded pixels and the size to
resize them to, to the vision encoder’s inputs for that image. Only
max export builds it, for a serving engine; MAX serve preprocesses in
its tokenizers.
VISION_PREPROCESS_VIDEO
VISION_PREPROCESS_VIDEO = 'vision_preprocess_video'
One encoder attention segment of a video clip’s preprocessing, on the
CPU: the segment’s decoded frames and the sizes to resize them to, to the
vision encoder’s inputs for that segment. Only max export builds it,
for a model whose segment is not a one-frame image.