import type { GatewayProviderContext, GatewayResolvedProviderConfig } from "@cline/shared"; import type { ProviderFactoryResult } from "./types"; /** * Normalize a configured base URL to the native Ollama API root expected by * the provider (it appends endpoint paths such as `/chat`). * * Users configure hosts like `http://localhost:11434` or * `https://ollama.com`; configs saved by the 4.0.0 OpenAI-compatible * routing may carry a `/v1` suffix, and native-API configs an `/api` one. */ export declare function normalizeOllamaBaseUrl(baseUrl: string | undefined): string | undefined; /** * Time to wait for the response to start when no timeout is configured. * * Deliberately generous: Ollama holds `/api/chat` open while it cold-loads * the model and only sends response headers once loading finishes, so with a * large model (or a large `num_ctx`, which this vendor requests) the first * request of a session routinely takes minutes before the stream starts. * A tight budget here turns every cold load into a user-facing timeout error * (see cline/cline#12829 — the legacy handler's 30s default was only * tolerable because its retry decorator silently re-issued the request until * the model was loaded). Unreachable servers are not this timeout's job: * connection-level failures (refused, DNS) reject on their own immediately, * and users can always cancel a request from the UI. This only bounds the * accepted-but-silent case, and 5 minutes matches the header-timeout default * other AI SDK-based agents use. */ export declare const OLLAMA_DEFAULT_TIMEOUT_MS = 300000; /** * Read the configured request timeout (the legacy `requestTimeoutMs` * setting); zero/invalid values fall back to the default. */ export declare function readOllamaTimeoutMs(config: GatewayResolvedProviderConfig): number; /** * Wrap a fetch so the *response* must start within `timeoutMs`. Once headers * arrive the timer is cleared — streaming the body is never interrupted. * Mirrors the legacy handler, which raced the chat call (stream start) * against a timeout rather than bounding the whole generation. */ export declare function withOllamaResponseTimeout(baseFetch: typeof fetch, timeoutMs: number): typeof fetch; export declare function createOllamaProviderModule(config: GatewayResolvedProviderConfig, _context: GatewayProviderContext): Promise; //# sourceMappingURL=ollama.d.ts.map