/** * Paged KV cache operations */ import type { WebInferContext } from '../core/context.ts'; import type { Tensor } from '../core/tensor.ts'; import type { PagedKvCache } from '../core/paged-kv-cache.ts'; /** * Append new KV pairs to paged KV cache * * Appends new key-value pairs to the paged KV cache structure. * Each batch item gets its new KV appended to its last page. * * @param ctx WebInfer context * @param paged_kv_cache The paged KV cache to append to * @param indptr Indirection pointer array [batch_size + 1] * @param indices Page indices array [nnz_pages] * @param last_page_len Number of valid tokens in last page for each batch item [batch_size] * @param k New keys to append [total_len, num_kv_heads, head_dim] * @param v New values to append [total_len, num_kv_heads, head_dim] */ export declare function append_paged_kv_cache(ctx: WebInferContext, paged_kv_cache: PagedKvCache, indptr: Tensor, indices: Tensor, last_page_len: Tensor, k: Tensor, v: Tensor): Promise;