/** * ACE-TUI Ollama Client * * Direct HTTP communication with Ollama API. * Zero dependencies — uses Node.js built-in fetch/http. * Supports model listing, pulling, chat streaming, and health checks. */ export interface OllamaModel { name: string; size: number; digest: string; modified_at: string; details?: { format?: string; family?: string; parameter_size?: string; quantization_level?: string; }; } export interface OllamaModelInfo { modelfile: string; parameters: string; template: string; details: { format: string; family: string; parameter_size: string; quantization_level: string; }; } export interface ChatMessage { role: "system" | "user" | "assistant"; content: string; } export interface ChatRequest { model: string; messages: ChatMessage[]; stream?: boolean; options?: { temperature?: number; top_p?: number; num_ctx?: number; num_predict?: number; stop?: string[]; }; } export interface ChatChunk { model: string; message: { role: string; content: string; }; done: boolean; total_duration?: number; load_duration?: number; prompt_eval_count?: number; eval_count?: number; eval_duration?: number; } export interface GenerateRequest { model: string; prompt: string; system?: string; stream?: boolean; options?: { temperature?: number; top_p?: number; num_ctx?: number; num_predict?: number; }; } export interface GenerateChunk { model: string; response: string; done: boolean; total_duration?: number; prompt_eval_count?: number; eval_count?: number; eval_duration?: number; } export interface PullProgress { status: string; digest?: string; total?: number; completed?: number; } export declare class OllamaClient { private baseUrl; private abortControllers; constructor(baseUrl?: string); getBaseUrl(): string; setBaseUrl(url: string): void; /** Check if Ollama is reachable */ isReachable(): Promise; /** List available models */ listModels(): Promise; /** Get model info */ showModel(name: string): Promise; /** Pull a model with progress streaming */ pullModel(name: string): AsyncGenerator; /** Chat with streaming response */ chat(request: ChatRequest): AsyncGenerator; /** Generate (completion) with streaming */ generate(request: GenerateRequest): AsyncGenerator; /** Abort a running operation */ abort(key?: string): void; private fetch; /** Stream newline-delimited JSON from a ReadableStream */ private streamJsonLines; } export declare class OllamaError extends Error { statusCode: number; responseBody: string; constructor(message: string, statusCode: number, responseBody: string); } //# sourceMappingURL=ollama.d.ts.map