/** * Ollama providers (E017, CTO request) — two lanes over the pi-ai `Provider` * contract, OpenKai-owned because pi-ai's bundled catalogue has no Ollama * entry: * * - `ollama`: a KEYLESS local server (default `http://localhost:11434/v1`). * Auth follows the keyless-local semantics the pi-ai `ProviderAuth` * interface prescribes ("keyless local servers provide `apiKey` auth whose * `resolve()` reports whether the provider is configured"): resolve probes * the server and reports configured only when it answers, returning the * placeholder bearer the OpenAI-compat client requires (pi-ai's * openai-completions api refuses a request with no key at all; the Ollama * endpoint ignores the header). Probes are cached briefly so per-request * auth resolution does not hammer localhost. * - `ollama-cloud`: `https://ollama.com/v1` behind an `OLLAMA_API_KEY` * bearer (standard env-key auth). * * Both list models dynamically via `GET {origin}/api/tags` — Ollama's native * shape `{ models: [{ name, ... }] }`, NOT the OpenAI `/models` shape * `{ data: [{ id }] }`; the mapping below is explicit. Streaming is * OpenAI-compatible chat completions via pi-ai's openai-completions api. * * `/api/tags` reports no context length, so discovered models carry Ollama's * served default context (4096 — the honest floor: claiming the model's * trained window would let the harness defer compaction past what the server * actually attends to). Operators raise it via `num_ctx` / * OLLAMA_CONTEXT_LENGTH and the next refresh re-reads the server. */ import type { Provider } from "@earendil-works/pi-ai"; /** Default base URL of a local Ollama server's OpenAI-compatible endpoint. */ export declare const OLLAMA_LOCAL_BASE_URL = "http://localhost:11434/v1"; /** Ollama Cloud's OpenAI-compatible endpoint (OLLAMA_API_KEY bearer). */ export declare const OLLAMA_CLOUD_BASE_URL = "https://ollama.com/v1"; /** * The keyless local lane. `getModels()` is empty until the first * `refreshModels()`; auth resolve reports configured iff the server answers. */ export declare function ollamaProvider(): Provider<"openai-completions">; /** The cloud lane: same discovery mechanism, env-key bearer auth. */ export declare function ollamaCloudProvider(): Provider<"openai-completions">; //# sourceMappingURL=ollama.d.ts.map