mlx-bun library API
    Preparing search index...

    The scheduler's port to the composition's cache service. acquire and release bracket a request; between them the scheduler offers state it produced (publish at prefix boundaries and when a row finishes, checkpoint for a replayable generation) and marks execution boundaries. Admission under the KV budget runs before acquire. Nothing here says what is resident or where.

    interface RequestStateCache {
        codecs: CacheCodecProvider;
        acquire(request: StateRequest, namespace: string): AcquiredState;
        admit(request: StateRequest): boolean;
        boundary(): void;
        checkpoint(
            request: StateRequest,
            state: Omit<ContinuationState, "seed">,
        ): void;
        fits(request: StateRequest): boolean;
        keeps(request: StateRequest): boolean;
        publish(
            request: StateRequest,
            namespace: string,
            tokens: number[],
            state: PublishedState,
        ): void;
        release(request: StateRequest, completed: boolean): void;
    }

    Implemented by

    Index

    The snapshot form of the composition's caches: how the scheduler copies live serial state it publishes.

    • Admit request beside the requests already holding state: true admits it (it holds its projected KV bytes until release), false means it waits. Throws for a request that can never be admitted: one past the caches' own position limit, or one over the KV budget alone.

      Parameters

      Returns boolean