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

BlockCount

BlockCount​

class max.pipelines.kv_cache.BlockCount(free, total)

source

Bases: object

A point-in-time snapshot of a block pool’s occupancy.

Used for the device (G0) pools, whose blocks are the unit the manager actually allocates in. The connector’s external tiers report ByteCount instead.

Parameters:

free​

free: int

source

free_pct​

property free_pct: float

source

Returns the percentage of blocks not currently in use, in [0, 100].

0 when total is 0, rather than dividing by zero.

total​

total: int

source

used​

property used: int

source

Returns the number of blocks currently in use.

used_pct​

property used_pct: float

source

Returns the percentage of blocks currently in use, in [0, 100].

0 when total is 0 (such as a tier with no configured capacity), rather than dividing by zero.