/** * Ollama Provider Implementation * * Implements the Provider interface for Ollama's OpenAI-compatible API. * Ollama provides local LLM inference with an API that mirrors OpenAI's format. * * Key characteristics: * - Local server running at http://localhost:11434 * - No authentication required (local) * - Uses OpenAI-compatible /v1/chat/completions endpoint * - May not support all features (especially function calling) * - Server may be slower than cloud providers */ import { type CompletionRequest, type CompletionResponse, type StreamChunk } from './types.js'; import { BaseProvider } from './base.js'; /** * Ollama provider adapter for local LLM inference. * * Ollama provides an OpenAI-compatible API for running local models. * This provider translates Foundation requests to the Ollama format * and handles the specific characteristics of local inference. * * Features: * - No authentication required (local server) * - Supports streaming responses * - Limited function calling support (depends on model) * - Graceful connection error handling */ export declare class OllamaProvider extends BaseProvider { readonly name = "ollama"; private static readonly DEFAULT_BASE_URL; /** * Build headers for Ollama API requests. * No authentication required for local server. */ protected buildHeaders(): Record; /** * Execute a completion request and return the full response. */ complete(request: CompletionRequest): Promise; /** * Execute a streaming completion request. */ completeStream(request: CompletionRequest): AsyncIterable; /** * Check if the Ollama server is running and available. * Uses the native Ollama tags API to list available models. */ healthCheck(): Promise; /** * Handle Ollama-specific errors with helpful messages. */ private handleOllamaError; /** * Translate Foundation request to Ollama format. */ private translateRequest; /** * Translate messages from Foundation format to Ollama format. * * Key translations: * - Content blocks are flattened to strings * - tool_use blocks become tool_calls array on assistant messages * - tool_result blocks become separate role: "tool" messages */ private translateMessages; /** * Translate tools from Foundation format to Ollama format. */ private translateTools; /** * Translate Ollama response to Foundation format. */ private translateResponse; /** * Translate Ollama streaming chunk to Foundation StreamChunk format. * * Ollama streams deltas that need to be accumulated for tool calls. * Text content can be yielded immediately. */ private translateStreamChunk; } //# sourceMappingURL=ollama.d.ts.map