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

KVConnectorConfig

KVConnectorConfig​

class max.pipelines.kv_cache.KVConnectorConfig(*, config_file=None, section_name=None, host_kvcache_swap_space_gb=50.0, disk_offload_dir=None, use_debug_tiered_mode=False, disk_offload_max_gb=50.0, disk_offload_direct_io=False, block_store_endpoint=None, **extra_data)

source

Bases: ConfigFileModel

Connector-specific configuration for KV cache connectors.

Common fields are typed. Additional connector-specific fields pass through via extra="allow" and are accessible via model_extra.

Parameters:

  • config_file (str | None)
  • section_name (str | None)
  • host_kvcache_swap_space_gb (float)
  • disk_offload_dir (str | None)
  • use_debug_tiered_mode (bool)
  • disk_offload_max_gb (float)
  • disk_offload_direct_io (bool)
  • block_store_endpoint (str | None)
  • extra_data (Any)

block_store_endpoint​

block_store_endpoint: str | None

source

Endpoint for the co-located dKV service.

Remote dKV endpoints are discovered at runtime through the Orchestrator (via external_block_metadata on the request context), not configured statically. For multi-store reads, the discovered metadata must include MAX-native transfer-engine metadata so the connector can reuse KVTransferEngine.connect().

disk_offload_dir​

disk_offload_dir: str | None

source

Directory for disk-based KV cache offloading.

disk_offload_direct_io​

disk_offload_direct_io: bool

source

Whether to use O_DIRECT for disk I/O.

disk_offload_max_gb​

disk_offload_max_gb: float

source

Maximum disk space in GB for KV cache offloading.

host_kvcache_swap_space_gb​

host_kvcache_swap_space_gb: float

source

Host memory in GiB for KV cache swapping.

model_config​

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'strict': False}

source

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

use_debug_tiered_mode​

use_debug_tiered_mode: bool

source

Whether to use the debug tiered mode.