mlx-bun library API
    Preparing search index...

    The rows of the TurboQuant bf16-first lego (Bf16FirstTurboQuantKVCache) for continuous batching: TurboQuant tensor access and value-domain handling over the shared row-transition lifecycle (when a row converts is described on TransitioningKvRows). Model projections and attention remain batched. fusedDecode is resolved by whoever builds the layout. turboQuantKernels is the read of the graph whose caches these rows hold (dense for Qwen 3.5, deferred for Gemma 4 and MiniCPM5); the rows this layout makes and the layout it packs them into carry it, and a converted row attends with its source's.

    The reads are the graph's call today: this layout's mask before the append (no sliding window), then the kernel set's fetch and attention. The dense set fetches every row decoded (updateAndFetch) and runs the fused SDPA, Qwen 3.5's call; the deferred set fetches converted rows rotated (updateAndFetchDeferredV), runs the fused SDPA and applies the value transform that fetch captured, Gemma 4's and MiniCPM5's.

    Hierarchy

    Implements

    Index
    compose?: (storage: Cache) => Cache

    How the lego these rows came from composes the rows this layout hands back to serial use (ComposedStorage.over).

    fusedDecode: boolean
    kBits: number
    start: number
    stateNeedsDispose: true

    state() returned temporary views that the caller must release.

    transition: KvRowTransition<BatchedTurboQuantKVCache>
    turboQuantKernels: TurboQuantKernels
    vBits: number
    • The fetch of the coming compiled step: the lego's while it holds the row, else the rows' (decodePhaseOfRows), without moving the row.

      Returns "concat" | "ring"

    • Stable storage identity for compatibility guards and persistence. REQUIRED: every capability predicate (isPlainKvCache, isRotating*, packages/inference/src/state/persistence.ts codecs) is a string compare on this value, so a missing override used to fail OPEN into wrong routing (PRs #42/#43: BatchedRotatingCache shipped without one and batched joins dropped running rows). Wrappers report their own kind plus the inner kind.

      Returns string

    • Speculative verify-round support for NON-trimmable recurrent caches (SSMCache — gated-DeltaNet conv + recurrent state). A cache exposing these is spec-eligible without isTrimmable(): the serve loop arms a round before the verify forward (the layer snapshots pre-round state — free, MLX arrays are immutable — and records its position-local kernel inputs), then resolves it: commit on full accept, or rollback(keep) which restores the snapshot and bit-exactly REPLAYS the first keep window tokens through the recurrence (identical arithmetic prefix ⇒ identical state). Trimmable caches leave these unset and keep trim().

      Returns void

    • Drop the last n tokens (future writes overwrite them). bypass (default false → unchanged behavior) skips the isTrimmable guard for the speculative-decode rollback case (trim the last n ≤ γ tips right after a

      1 concat write); rotating caches then physically shrink the buffer tail.

      Parameters

      • count: number

      Returns void