/** * Ollama LLM Provider * * Local LLM provider using Ollama (https://ollama.com). * Runs locally with models like DeepSeek Coder, Llama, Mistral, etc. * * Environment variables: * - OLLAMA_BASE_URL: Optional base URL (default: http://localhost:11434) * - OLLAMA_MODEL: Model to use (default: deepseek-coder) */ import type { LLMProvider, GenerationRequest, GenerationResponse } from './index.js'; export interface OllamaConfig { baseUrl?: string; model?: string; timeout?: number; } /** * Ollama-specific provider * Connects to local Ollama instance for AI capabilities */ export declare class OllamaProvider implements LLMProvider { name: string; models: string[]; private readonly baseUrl; private readonly defaultModel; private readonly timeout; constructor(config?: OllamaConfig); isAvailable(): Promise; /** * Ensure URL has valid format (http:// prefix) */ private ensureValidUrl; generate(request: GenerationRequest): Promise; stream(request: GenerationRequest): AsyncIterable; countTokens(text: string): number; /** * List available models from Ollama */ listModels(): Promise; /** * Pull a model from Ollama registry */ pullModel(model: string, onProgress?: (progress: PullProgress) => Promise): Promise; private buildFullPrompt; } /** * Model information */ export interface ModelInfo { name: string; size: number; modifiedAt: string; } /** * Pull progress information */ export interface PullProgress { status: 'pulling' | 'verifying' | 'complete'; digest?: string; total?: number; completed?: number; } /** * Ollama-specific error */ export declare class OllamaError extends Error { code: string; details?: Record; constructor(message: string, details?: Record); } /** * Create Ollama provider with default settings */ export declare function createOllamaProvider(config?: OllamaConfig): OllamaProvider; /** * Check if Ollama is available and has the required model */ export declare function checkOllamaSetup(model?: string): Promise<{ available: boolean; modelInstalled: boolean; models: string[]; }>;