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.modeling.types

Pipeline modeling types: request/input/pipeline interfaces.

Submodules​

max.pipelines.modeling.types.pipeline_variantsInput and output types for each generation modality.

Pipeline base​

ChatEncoderOutcomesProbeOptional tokenizer capability: report how its chat prompts encoded.
InputModalityEnum representing the types of input a model architecture accepts.
LabelScoringTokenizerTokenizer capabilities that label scoring (/v1/decisions) needs.
PipelineDefines the interface for pipeline operations.
PipelineInputsBase class representing inputs to a pipeline operation.
PipelineInputsTypeType variable for pipeline input types.
PipelineOutputProtocol representing the output of a pipeline operation.
PipelineOutputTypeType variable for pipeline output types.
PipelineOutputsDictType alias for a dictionary mapping string keys to PipelineOutput instances.
PipelinesFactoryCallable with no arguments that constructs a configured pipeline.
PipelineTaskEnum representing the types of pipeline tasks supported.
PipelineTokenizerInterface for LLM tokenizers.
PreprocessCacheStatsProbeOptional tokenizer capability: report its media preprocess caches.
PreprocessedImageProbeOptional tokenizer capability: report already-preprocessed images.
TokenIdsToken ids decoded or encoded by a tokenizer: an array, a sequence, or a single id, matching the shape of the request that produced them.
TokenizerEncodedThe tokenized form a tokenizer's encode() returns.
UnboundContextTypeThe context type a tokenizer creates from a request.
VisionPreprocessCacheStatsOne media preprocess cache's counters, as of now.

Text generation​

BatchTypeType of batch.
CompletedBatchStatsExecution stats for a batch whose outputs have been synchronized.
ImageContentPartAn image content part of a message.
MessageContentOne part of a chat message: text, an image, or a video.
TextContentPartA plain-text content part of a message.
TextGenerationInputsInput parameters for text generation pipeline operations.
TextGenerationRequestAn immutable request for text token generation from a pipeline.
TextGenerationRequestFunctionRepresents a function definition for a text generation request.
TextGenerationRequestMessageA single message in a text generation request conversation.
TextGenerationRequestToolRepresents a tool definition for a text generation request.
VideoContentPartA video content part of a message.

Audio generation​

AudioGenerationInputsInput data structure for audio generation pipelines.

Embeddings​

EmbeddingsContextProtocol defining the interface for embeddings generation contexts.
EmbeddingsGenerationContextTypeThe context type an embeddings pipeline serves.
EmbeddingsGenerationInputsBatched inputs for an embeddings generation pipeline step.
EmbeddingsGenerationOutputResponse structure for embedding generation.

Image generation​

PixelGenerationInputsInput data structure for pixel generation pipelines.

Reasoning​

ParsedReasoningDeltaResult of applying reasoning parsing to a streaming delta chunk.
ReasoningParserParser for identifying reasoning spans in model output.
ReasoningPipelineTokenizerPipelineTokenizer that exposes its reasoning-delimiter token ids.
ReasoningSpanIdentifies a reasoning span within a token ID sequence.

Tool parsing​

ParsedToolCallA parsed tool/function call extracted from model output.
ParsedToolCallDeltaIncremental tool call data for streaming responses.
ParsedToolResponseResult of parsing a complete model response for tool calls.
ToolParserProtocol for parsing tool calls from model responses.

Requests​

OpenResponsesRequestGeneral request container for OpenResponses API requests.
RequestProtocol representing a generic request within the MAX API.
RequestIDA unique immutable identifier for a request.
RequestTypeType variable for request types.
DUMMY_REQUEST_IDStand-in request ID for work that has no client request, such as the warmup pass run while capturing a CUDA graph.

Logit processors​

BatchLogitsProcessorCallback that rewrites logits for a whole batch before sampling.
BatchProcessorInputsArguments for a batch logits processor.
LogitsProcessorCallback that rewrites logits for a single sequence before sampling.
ProcessorInputsInputs passed to a logits processor callback.

Utilities​

SharedMemoryArrayA wrapper for a NumPy array stored in shared memory.
msgpack_numpy_decoderCreate a decoder function for the specified type.
msgpack_numpy_encoderCreate an encoder function that handles numpy arrays.
msgpack_numpy_oob_decoderCreate an out-of-band (zero-copy) msgpack decoder for the given type.
msgpack_numpy_oob_encoderCreate an out-of-band (zero-copy) msgpack encoder for numpy arrays.