mlx-bun library API
    Preparing search index...

    The graph's operations and construction facts. Pooled embedding support is declared by its operation alone. Other operations accompany the promises in graphCapabilities; composition checks their pairing when it binds (declaredGraph).

    Implements

    Index
    appendKnown: MlxKnownOperations

    Known tokens: the committed read under knownSpans, the window read otherwise.

    cacheLayers: readonly MlxCacheLayer[]

    One cache per layer, the full-attention caches sharing one mask memo: the cache the composition's KV scheme names for each attention layer (composedFullAttentionCache). Their TurboQuant read is dense (denseTurboQuantKernels): the read decodes keys and values, then runs the fused SDPA.

    config: ModelConfig

    One new token per sequence: ids [sequences, 1], so rows are sequences.

    Unscaled token embeddings, for media prompts that splice embeddings.

    embeddingPrompt: readonly MlxEmbeddingsRange[]

    Prepared embeddings without explicit positions, indexed by total rows.

    faIdx: number
    finalNorm: RMSNorm
    knownSpans: MlxKnownSpans | undefined

    Main's qualified committed spans, bound once when the generic graph loads.

    layers: Qwen3Layer[]
    lmHead: QuantizedLinear | null

    null when tied: the output head reuses embed_tokens (embed.asLinear).

    The same output head at every declared numeric row.

    loraState: LoraState = ...
    mediaDecode: Readonly<
        Partial<Record<number, MlxPositionedForward>> & {
            default?: MlxPositionedForward;
        },
    >
    mediaPrefill: readonly MlxPositionedEmbeddingsRange[]
    mediaPrompt: readonly MlxPositionedRange[]
    mixed: readonly MlxMixedRange[]

    Each group's attention reads its own caches and phase. Declared packed operations share the nonverify MLP rows; verification keeps its own geometry. Prompt groups above four rows evaluate each layer and recurrent state.

    mixedSeparate: MlxSeparateMixed

    Mixed groups that retain their own projection geometry. The scheduler routes each group independently when a verify group is present.

    multiSequencePrompt: readonly MlxPromptRange[]
    multiSequencePromptChunk: readonly MlxPromptRange[]
    prefixBase: "language_model.model"

    Base path for LoRA target keys (weights carry the language_model prefix).

    prompt: readonly MlxPromptRange[]

    One whole chunk of a prompt; rows are sequences times the chunk size, and each layer's output and recurrent state is evaluated before the next. The GPU is this graph's one unit.

    promptChunk: readonly MlxPromptRange[]

    Optional chunk bindings when a file distinguishes chunks from prompt tails.

    sequence: readonly MlxSequenceRange[]

    Full-sequence scoring operations, indexed by total token rows.

    tied: boolean

    A speculative window: each sequence's last accepted token and its drafted tokens, right-padded by the caller to the round's depth, ids [sequences, depth + 1], so rows are sequences times (depth + 1). The graph appends all depth + 1 positions; dropping the rejected suffix is the caller's speculative transaction, begun before this call.

    weightsBytes: number
    • The decoder over h0 (consumed), every block reading its cache for phase, on the fixed layer view the calling operation names. bounded evaluates each layer's output and recurrent state before the next. capture receives each layer's residual output after the layer runs; the caller hands it the final hidden.

      Parameters

      Returns MlxArray