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 class

GraphPipelineModelWithKVCache

GraphPipelineModelWithKVCache​

class max.pipelines.lib.GraphPipelineModelWithKVCache(pipeline_config, session, devices, kv_cache_config, weights, adapter, return_logits, *, memory_plan, return_hidden_states=ReturnHiddenStates.NONE, max_batch_size=1)

source

Bases: PipelineModelWithKVCache[BaseContextType, _ModelConfigT, Model]

Graph-API pipeline model with shared compile-and-load template.

Subclasses override _build_graph_for_compile() (and optionally _create_model_config(), _init_distributed_runtime()) rather than duplicating weight loading, timing, and EP batch-processor wiring.

ModuleV3 models and multi-graph VLMs should inherit MultiGraphPipelineModelWithKVCache instead.

Parameters:

load_model()​

load_model(session)

source

Build, compile, and load the model graph into session.

Parameters:

session (InferenceSession)

Return type:

Model