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
Interfaces for running models end to end: registry, configuration, and pipeline classes for text, embeddings, and pixel generation.
A pipeline wires a model family into an executable workflow. A
SupportedArchitecture registers the model in the
pipeline registry, PipelineConfig sets how it runs, and
pipeline classes such as TextGenerationPipeline,
EmbeddingsPipeline, and PixelGenerationPipeline drive
tokenization, weight loading, and generation.
Submodules
max.pipelines.architectures | Built-in model architectures for MAX pipelines. |
|---|---|
max.pipelines.audio | Audio generation pipelines. |
max.pipelines.context | Request contexts and supporting types for MAX pipelines. |
max.pipelines.diffusion | Diffusion-specific pipeline components. |
max.pipelines.kv_cache | KV cache management for MAX pipelines. |
max.pipelines.lib | Types to interface with ML pipelines such as text/token generation. |
max.pipelines.lib.arch_lookup | Architecture registration and lookup tables. |
max.pipelines.lib.interfaces | Interfaces for MAX pipelines. |
max.pipelines.lib.log_probabilities | Builds computation graphs for log probabilities over batched input sequences. |
max.pipelines.lib.registry | Model registry, for tracking various model variants. |
max.pipelines.modeling.base | Base classes for MAX pipeline model definitions. |
max.pipelines.modeling.dataprocessing | Token-batch preparation helpers: collation, padding, and attention masks. |
max.pipelines.modeling.types | Pipeline modeling types: request/input/pipeline interfaces. |
max.pipelines.weights | Weight loading utilities for MAX pipelines. |
max.pipelines.lora | LoRA adapter management for MAX pipelines. |
max.pipelines.request | Request types for MAX API. |
max.pipelines.sampling | Token sampling for MAX pipelines: samplers, logits processors, and the acceptance runners used in speculative decoding. |
max.pipelines.speculative | Speculative decoding pipelines and configuration for MAX. |
Configuration
KVCacheConfig | Configuration for the paged KV cache. |
|---|---|
MAXModelConfig | Configuration for a pipeline model. |
PipelineArgs | User-settable input arguments for a pipeline. |
PipelineConfig | Configuration for a pipeline. |
PipelineRuntimeConfig | Model-agnostic runtime settings for pipeline execution. |
ProfilingConfig | Configuration for the GPU (NVTX/Nsight) profiler and kernel tracing. |
SamplingConfig | Configuration for the sampling stage of token generation. |
SpeculativeConfig | Configures speculative decoding for a pipeline. |
In-process generation
AutoModel | Loads a text generation model in-process. |
|---|---|
AutoPipeline | Generates text from text with an AutoModel. |
AutoTokenizer | Loads the Hugging Face tokenizer serve uses to encode a model's text. |
Pipelines
EmbeddingsPipeline | Generalized token generator pipeline. |
|---|---|
PixelGenerationPipeline | Pixel generation pipeline for diffusion models. |
TextGenerationPipeline | Generalized token generator pipeline. |
TextGenerationPipelineInterface | Interface for text generation pipelines. |
Model interface
MemoryEstimator | Plans device memory for a pipeline and estimates what it will use. |
|---|---|
ModelInputs | Base class for model inputs. |
ModelOutputs | Pipeline model outputs. |
PipelineModel | A pipeline model with setup, input preparation and execution methods. |
Eager usage validation
The eager usage validator adds guard rails around eager code running
inside a compiled pipeline. Configure it with the
runtime.eager_usage_validator MAX config setting.
EagerUsageValidator | A scope that tracks production-unsafe API usages. |
|---|---|
EagerValidatorMode | Configures when the eager usage validator runs. |
Phase | Which part of a pipeline's life a validation scope covers. |
eager_usage_validator | Builds the validator guarding phase, per the configured mode. |
|---|
eager_validator | Use to opt in to the escape hatches for EagerUsageValidator. |
|---|
Tokenizers
IdentityPipelineTokenizer | A pass-through tokenizer that returns prompts unchanged. |
|---|---|
TextAndVisionTokenizer | Encapsulates creation of TextAndVisionContext and specific token encode/decode logic. |
TextTokenizer | Encapsulates creation of TextContext and specific token encode/decode logic. |
Enums
PipelineRole | Indicates whether the pipeline should do prefill and/or decode. |
|---|---|
PrometheusMetricsMode | Controls the Prometheus metrics mode. |
RepoType | Specifies the source location type of a model repository. |
RopeType | The rotary position embedding (RoPE) implementation a model configures. |
SupportedEncoding | All possible encodings which may be supported by a particular model. |
Utilities
download_weight_files | Downloads weight files for a Hugging Face model and returns local paths. |
|---|---|
is_float4_encoding | Returns whether the given encoding is a float4 type. |
parse_supported_encoding_from_file_name | Infers a SupportedEncoding from a file name string. |
supported_encoding_dtype | Returns the underlying model dtype for the given encoding. |
supported_encoding_quantization | Returns the QuantizationEncoding for the given encoding. |
supported_encoding_supported_devices | Returns the devices that the given encoding is supported on. |
supported_encoding_supported_on | Returns whether the given encoding is supported on a device. |
upper_bounded_default | Returns a value not exceeding the upper bound. |
ADAPTER_CONFIG_FILE | File name of the LoRA adapter's config file inside the adapter's local directory, read when the adapter is loaded. |
|---|