export declare const DEFAULT_OLLAMA_HOST = "http://127.0.0.1:11434";
export interface InstalledModel {
name: string;
sizeBytes: number;
modifiedAt: string;
}
export interface ChatOptions {
model: string;
system?: string;
user: string;
temperature?: number;
/**
* Whether to let the model emit a … chain before the answer.
* Defaults to false — the bridge's whole point is fast, cheap delegation;
* thinking models burn minutes on trivial tasks. Opt in per-call if needed.
*/
think?: boolean | 'low' | 'medium' | 'high';
/**
* Ollama keep_alive parameter (seconds, duration string, or -1 for
* forever). Controls how long the model stays loaded after the call.
*/
keepAlive?: string | number;
/**
* JSON schema passed to Ollama `format:` field for grammar-constrained
* structured output. Used by classify (enum schema) and extract (full
* object schema). Callers must pre-sanitize with sanitizeSchemaForOllama()
* to avoid GBNF crashes on pattern/format:email/format:uri constraints.
*/
format?: object;
/**
* Maximum number of tokens the model may generate. Passed as
* `options.num_predict` to Ollama. Default: unlimited.
*/
numPredict?: number;
/**
* Context window size in tokens. Passed as `options.num_ctx` to Ollama.
* Ollama's runtime default is 4096 regardless of the model's maximum;
* inputs exceeding the window are silently left-truncated. Set per tier
* to avoid data loss on longer documents.
*/
numCtx?: number;
signal?: AbortSignal;
}
/**
* Result returned by OllamaClient.chat(). Includes the text content plus
* token usage counters from Ollama (0 when the daemon doesn't report them).
*/
export interface ChatResult {
text: string;
/** Tokens used to encode the prompt (Ollama: prompt_eval_count). */
promptTokens: number;
/** Tokens generated in the completion (Ollama: eval_count). */
completionTokens: number;
}
export declare class OllamaDaemonError extends Error {
readonly cause?: unknown | undefined;
constructor(message: string, cause?: unknown | undefined);
}
export declare class OllamaClient {
readonly host: string;
private readonly ollama;
constructor(host?: string);
ping(): Promise<{
version: string;
}>;
listInstalled(): Promise;
chat(opts: ChatOptions): Promise;
}
//# sourceMappingURL=client.d.ts.map