export declare const DEFAULT_OLLAMA_URL = "http://localhost:11434"; export interface OllamaModelInfo { name: string; size: number; modified_at: string; } export interface OllamaPullProgress { status: string; completed?: number; total?: number; } export interface OllamaRequestOptions { apiKey?: string; timeoutMs?: number; headers?: Record; } export interface OllamaConnection { baseUrl: string; apiKey?: string; headers?: Record; } export interface OllamaConnectionOptions { /** * A flag that overrides the URL of the config, such as `models --url`. An * explicit URL names a server of its own, so the config file is not read at * all for it: its credentials and headers never reach that server. */ url?: string; cwd?: string; } /** * The connection of a server named only by the environment: `resolveOllamaUrl` * over `env`, and `OLLAMA_API_KEY` as its bearer token. No config file, no * `.env` beside one, no headers, so it cannot fail on configuration. */ export declare function environmentConnection(env?: Record, url?: string): OllamaConnection; /** * Warns on stderr when the Ollama configuration cannot be read, keeping stdout * clean for commands with `--json`. */ export declare function warnConfigError(error: unknown, fallbackMessage: string): void; /** * The Ollama server and credentials the CLI uses, loaded the way `run` loads them: * the `.env` next to the config file (or in `cwd`), `COGITATOR_CONFIG`, environment * variables and `cogitator.yml`. An explicit `url` skips the config entirely and * uses {@link environmentConnection} instead, so the configured server's credentials * and headers are never sent to another one. Otherwise the server, key and headers * are the ones `loadConfig` merges, the same the chat uses. Config errors are * thrown, not hidden: `status` and `models` catch them and fall back to * {@link environmentConnection}. */ export declare function resolveOllamaConnection(options?: OllamaConnectionOptions): OllamaConnection; /** * The Ollama URL to use, in precedence: `configured` (an explicit `--url`, else * the config's `llm.providers.ollama.baseUrl`), then `OLLAMA_BASE_URL`, * `OLLAMA_URL` and `OLLAMA_HOST`, each read the way Ollama reads `OLLAMA_HOST` * (port 11434 when none is given, `0.0.0.0` as `localhost`), then * `http://localhost:11434`. */ export declare function resolveOllamaUrl(env?: Record, configured?: string): string; export declare function listOllamaModels(baseUrl: string, options?: OllamaRequestOptions): Promise; export declare function readNdjson(stream: ReadableStream): AsyncGenerator; export declare function pullOllamaModel(baseUrl: string, model: string, onProgress: (progress: OllamaPullProgress) => void, options?: Pick): Promise; //# sourceMappingURL=ollama.d.ts.map