appendToken

open override fun appendToken(layer: Int, key: FloatArray, value: FloatArray)(source)

Append a single token's K/V projections for one layer.

The runtime calls this once per layer per generated token. The cache is responsible for encoding/compressing the data according to keyEncoding and valueEncoding.

Parameters

layer

Layer index (0-based)

key

Key projection numHeads, headDim as float

value

Value projection numHeads, headDim as float

Throws