mlx-bun library API
    Preparing search index...
    interface EvalOptions {
        bun?: string;
        catalog: Pick<ModelCatalog, "find">;
        graceMs?: number;
        models: Pick<ModelHost, "defaultFor">;
        native?: string;
        now?: () => number;
        root?: string;
        script?: string;
        serve?: readonly string[];
        spawn?: {
            <
                const In extends Writable = "ignore",
                const Out extends Readable = "pipe",
                const Err extends Readable = "inherit",
            >(
                options: SpawnOptions<In, Out, Err> & { cmd: string[] },
            ): Subprocess<In, Out, Err>;
            <
                const In extends Writable = "ignore",
                const Out extends Readable = "pipe",
                const Err extends Readable = "inherit",
            >(
                cmds: string[],
                options?: SpawnOptions<In, Out, Err>,
            ): Subprocess<In, Out, Err>;
        };
        storage: Pick<StorageService, "path">;
    }
    Index
    bun?: string

    The Bun executable that runs the runner; default the one on PATH.

    catalog: Pick<ModelCatalog, "find">

    Resolves a model query to its directory.

    graceMs?: number

    SIGTERM first (the runner stops its server and saves the run), then SIGKILL after this. Default 70 s.

    models: Pick<ModelHost, "defaultFor">

    Names the served model when a run names none.

    native?: string

    The MLX library the evaluated server loads; default the checkout's staged one.

    now?: () => number
    root?: string

    The source tree the evaluated server runs from; default this checkout.

    script?: string

    eval-serve.ts; default the checkout's.

    serve?: readonly string[]

    The server the runner starts, before --model and --port; default the checkout's mlx-bun serve.

    storage: Pick<StorageService, "path">
    spawn?: {
        <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            options: SpawnOptions<In, Out, Err> & { cmd: string[] },
        ): Subprocess<In, Out, Err>;
        <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            cmds: string[],
            options?: SpawnOptions<In, Out, Err>,
        ): Subprocess<In, Out, Err>;
    }

    Test seam for process creation.

    Type Declaration

      • <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            options: SpawnOptions<In, Out, Err> & { cmd: string[] },
        ): Subprocess<In, Out, Err>
      • Spawn a new process

        Type Parameters

        • const In extends Writable = "ignore"
        • const Out extends Readable = "pipe"
        • const Err extends Readable = "inherit"

        Parameters

        • options: SpawnOptions<In, Out, Err> & { cmd: string[] }
          • cmd: string[]

            The command to run

            The first argument will be resolved to an absolute executable path. It must be a file, not a directory.

            If you explicitly set PATH in env, that PATH will be used to resolve the executable instead of the default PATH.

            To check if the command exists before running it, use Bun.which(bin).

            const subprocess = Bun.spawn(["echo", "hello"]);
            

        Returns Subprocess<In, Out, Err>

      • <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            cmds: string[],
            options?: SpawnOptions<In, Out, Err>,
        ): Subprocess<In, Out, Err>
      • Spawn a new process

        const proc = Bun.spawn(["echo", "hello"]);
        const text = await proc.stdout.text();
        console.log(text); // "hello\n"

        Internally, this uses posix_spawn(2)

        Type Parameters

        • const In extends Writable = "ignore"
        • const Out extends Readable = "pipe"
        • const Err extends Readable = "inherit"

        Parameters

        • cmds: string[]

          The command to run

          The first argument will be resolved to an absolute executable path. It must be a file, not a directory.

          If you explicitly set PATH in env, that PATH will be used to resolve the executable instead of the default PATH.

          To check if the command exists before running it, use Bun.which(bin).

          const subprocess = Bun.spawn(["echo", "hello"]);
          
        • Optionaloptions: SpawnOptions<In, Out, Err>

        Returns Subprocess<In, Out, Err>