mlx-bun library API
    Preparing search index...

    Portable facts about a bound graph. Composition binds the operations these facts require and refuses what is genuinely missing; scheduling reads only these declarations plus request and dynamic state (batch membership, cache contents, cancellation), never a model's class or name. A declaration that promises an operation is checked where it is bound.

    interface GraphCapabilities {
        compiledDecode: boolean;
        embeddings: boolean;
        hiddenLayerTaps: boolean;
        media: { input: GraphMediaInput; video: boolean } | null;
        method: "autoregressive" | "denoising";
        nativeDraft: { kind: string; numDraftTokens: number } | null;
        prefill: { boundedWorkspace: boolean };
        sparseAttention: boolean;
        speculation: {
            adapters: boolean;
            externalTokens: boolean;
            grammarProposals: boolean;
            logprobs: boolean;
        };
    }
    Index
    compiledDecode: boolean

    The graph owns a compiled decode step. The composition keeps it on only where its storage has a compiled form (Composition.compiledDecode).

    embeddings: boolean

    Derived from the bound graph's pooled text-embedding operation.

    hiddenLayerTaps: boolean

    Hidden-layer outputs can be tapped for drafts that read them.

    media: { input: GraphMediaInput; video: boolean } | null

    Prepared media the graph accepts, or null. Requests carrying prepared embeddings need a bindMediaInput operation; video says video frames are accepted input.

    method: "autoregressive" | "denoising"

    The method the graph's forward serves. Token-level methods (speculation, grammar proposals, fill) bind only to autoregressive.

    nativeDraft: { kind: string; numDraftTokens: number } | null

    A draft head the graph's own checkpoint carries and has loaded, or null. kind names the native draft provider that binds to this graph; the provider registry resolves it, so no consumer names the graph or its provider. numDraftTokens is the head's round width.

    prefill: { boundedWorkspace: boolean }

    How prefill is sized for this graph.

    Type Declaration

    • ReadonlyboundedWorkspace: boolean

      Long prompts prefill in smaller chunks so the attention score matrices a fallback (unfused) attention materializes stay within a fixed workspace. It changes work size, never admission.

    sparseAttention: boolean

    Attention selects a sparse subset of positions (surfaced to clients).

    speculation: {
        adapters: boolean;
        externalTokens: boolean;
        grammarProposals: boolean;
        logprobs: boolean;
    }

    What the graph's target verification qualifies beyond ordinary rounds. Each is a property of the graph's verifier, independent of the draft that supplies proposals and of how the composition's caches store keys and values (every cache lego holds the speculative transaction).

    Type Declaration

    • Readonlyadapters: boolean

      Verification under mounted adapters.

    • ReadonlyexternalTokens: boolean

      Verification of externally supplied tokens (echo of a known continuation).

    • ReadonlygrammarProposals: boolean

      Verified grammar-constraint proposals.

    • Readonlylogprobs: boolean

      Verification of requests that return logprobs.