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

KVCacheBufferInterface

KVCacheBufferInterfaceโ€‹

class max.nn.kv_cache.KVCacheBufferInterface(*args, **kwargs)

source

Bases: Protocol

Interface for a KV cache buffer (single leaf or a tree of leaves).

all_buffersโ€‹

property all_buffers: list[Buffer]

source

Returns all buffers.

to_memory()โ€‹

to_memory()

source

Returns the offload-ready memory units, keyed by pool leaf id.

Return type:

Mapping[str, KVCacheMemory]