mlx-bun library API
    Preparing search index...

    The method owns initialization, planning, companion state, snapshots and completion. This driver owns common target batching and work boundaries. Checkpoint factories return owned cache state; close/dispose are idempotent.

    interface MlxPrefillRowsHost<State extends MlxPrefillState> {
        codecs?: CacheCodecProvider;
        maintain?: KvMaintenance;
        afterForward?(
            ids: MlxArray,
            caches: Cache[],
            states: readonly State[],
            hidden: MlxArray,
        ): void | Promise<void>;
        checkpoint(state: State, capture: () => Cache[], row: number): void;
        close(state: State): void;
        complete(state: State, logits: MlxArray | null, row: number): Promise<void>;
        dispose?(): void;
        filterRows?(keep: readonly number[]): void;
        forward(
            ids: MlxArray,
            caches: Cache[],
            states: readonly State[],
            step: MlxPromptStep,
            work?: MlxForwardWork,
        ): Promise<MlxArray>;
        open(row: Row): State;
        plan(state: State): MlxPrefillStep;
        project(
            hidden: MlxArray,
            caches: Cache[],
            completed: readonly State[],
            step: MlxPromptStep,
        ): MlxArray | null;
        ready?(state: State): boolean;
        reject(row: Row, error: unknown): void;
    }

    Type Parameters

    Index

    The snapshot form of the composition's caches (the cache service's), for a single row's boundary snapshot.

    maintain?: KvMaintenance