llmwire - v2.2.0
    Preparing search index...

    Interface OllamaProviderConfig

    Optional configuration for OllamaProvider

    interface OllamaProviderConfig {
        baseURL?: string;
        cli?: (
            subcommand: string,
            args?: string[],
            options?: OllamaCLIOptions,
        ) => Promise<OllamaCLIResult>;
        fetch?: FetchLike;
        headers?: Record<string, string>;
        modelCacheTtlMs?: number;
        models?: string[];
        ollamaExecutablePath?: string;
        preferCLI?: boolean;
        streamIdleTimeout?: number;
        timeout?: number;
    }

    Hierarchy (View Summary)

    Index
    baseURL?: string

    Base URL for Ollama API (default: "http://localhost:11434"). Used for list, ps, show, pull, rm, run when server is reachable.

    cli?: (
        subcommand: string,
        args?: string[],
        options?: OllamaCLIOptions,
    ) => Promise<OllamaCLIResult>

    The ollama binary, for management calls when the server is down and for serve, stop, create. Pass runOllamaCLI from llmwire/ollama-cli; it lives there so the main entry pulls in no child_process. Without it those calls return ok: false.

    Type Declaration

      • (
            subcommand: string,
            args?: string[],
            options?: OllamaCLIOptions,
        ): Promise<OllamaCLIResult>
      • Run the native ollama CLI with a subcommand and arguments. Uses the system PATH to find ollama unless executablePath is set.

        Parameters

        Returns Promise<OllamaCLIResult>

        const result = await runOllamaCLI('pull', ['llama3.1:8b'], { onStderr: (c) => console.log(c) });
        const listResult = await runOllamaCLI('ls', []);
    fetch?: FetchLike

    Custom fetch (proxy agent, tracing, tests).

    headers?: Record<string, string>

    Sent on every request, after the provider's own headers.

    modelCacheTtlMs?: number

    How long (ms) a successful model listing is reused before discoverModels() fetches again. Default 300000; 0 disables.

    models?: string[]

    Seed the supported-model list so no discovery call is needed.

    ollamaExecutablePath?: string

    Path to the ollama executable (default: "ollama" from PATH)

    preferCLI?: boolean

    Prefer CLI over API when both are available (default: false = try API first)

    streamIdleTimeout?: number

    Default idle timeout (ms) for this provider's streams.

    timeout?: number

    Default whole-request timeout (ms) for this provider's JSON calls.