Optionalquantization?: PagedQuantizationOptionalturbo?: { fusedDecode: boolean; kBits: number; vBits: number }OptionalvHeadDim?: numberV head dim when it differs from K's (attention_k_eq_v models don't reach v1's gemma4 scope, but the pool stays shape-honest).
Optionalsource: BlockPoolReadonlyblockReadonlydtypeReadonlyheadOptionalkeyOptionalkeyOptional ReadonlyquantizationOptional ReadonlyturboTurboQuant pages' bit widths.
OptionalvalueOptionalvalueReadonlyvIndependent ownership and allocation metadata over immutable MLX buffers. Functional writes detach storage while another snapshot retains it.
Write k/v ([1, H, l, D], l ≤ blockSize − within) into physical
block physIdx starting at row within. Functional slice_update:
the pool tensors are single-referenced here, so mlx donates the
buffer and the write is in-place in the steady state.
TurboQuant pages: write encoded positions (taking ownership) into
block physIdx from row within.
Per-layer block arena, mlx-owned (ops.zeros — no host-pointer alignment/dtor hazards), every plane shaped [numBlocks, H, blockSize, width]. bf16 pages:
keysandvalues. Affine pages: packedkeysandvalueswith their scales and biases. TurboQuant pages: the codec's five codes, key indices inkeys, key scales and zero points inkeyScalesandkeyBiases, value indices invalues, value scales invalueScales. alloc()/free() manage physical slot indices; the owning PagedKVCache writes/gathers through the pool.