/** * A generic OpenAI-compatible Chat Completions client (`/v1/chat/completions`, choices[]) — wire * types and parsing shared via ChatCompletionsProvider. Backs two CLI-only protocols (see * runtime/cli/src/serve/server.ts `resolveLocalProvider`): * - `ollama` — zero-config preset: keyless, base URL OLLAMA_HOST / http://localhost:11434. * - `openai-compat` — generic: base URL TB_AI_BASE_URL, optional key TB_AI_API_KEY (LM Studio, * vLLM, a self-hosted endpoint, a keyed proxy, a cloud OpenAI-compat vendor). * Auth is optional — `buildHeaders` sends `Bearer ` only when a key is present. * * It's its own class (not OpenAIProvider) because the `openai` protocol targets the Responses API * (`/v1/responses`), which these endpoints don't implement. Ollama's native `/api/chat` (NDJSON, * first-class `message.thinking`, `num_ctx`/`think` options) is out of scope for tb.ai — reach it * via a server.ts export. See runtime-specs/TB-Custom-Providers.md. */ import type { ChatMessageDto } from '../protocol.js'; import type { ChatRequestOpts } from '../aiProvider.js'; import { ChatCompletionsProvider } from './chatCompletions.js'; /** Ollama OpenAI-compatible request payload */ export type OllamaRequestPayload = { model: string; messages: ChatMessageDto[]; stream: boolean; }; export declare class OllamaProvider extends ChatCompletionsProvider { protected readonly providerName = "Ollama"; readonly defaultBaseUrl = "http://localhost:11434"; readonly path = "/chat/completions"; buildHeaders(apiKey: string): Record; buildPayload(messages: ChatMessageDto[], model: string, _opts: ChatRequestOpts, stream: boolean): OllamaRequestPayload; } //# sourceMappingURL=ollama.d.ts.map