IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Python class

PipelineModelWithKVCache

PipelineModelWithKVCacheโ€‹

class max.pipelines.lib.PipelineModelWithKVCache(pipeline_config, session, devices, kv_cache_config, weights, adapter, return_logits, return_hidden_states=ReturnHiddenStates.NONE)

source

Bases: PipelineModel[BaseContextType]

A pipeline model that supports KV cache.

Parameters:

get_kv_params()โ€‹

classmethod get_kv_params(huggingface_config, pipeline_config, devices, kv_cache_config, cache_dtype)

source

Returns the KV cache params for the pipeline model.

Delegates to model_config_cls.construct_kv_params(...). Subclasses with custom KV behavior should override this method.

Parameters:

Return type:

KVCacheParamInterface

kv_paramsโ€‹

kv_params: KVCacheParamInterface

source