import { ServerError } from '../../utility/errors/hdbError.ts';
import type { BackendOpts, EmbedOpts, GenerateChunk, GenerateInput, GenerateOpts, GenerateResult, ModelBackend, ModelCallResult, ModelCapabilities } from '../../resources/models/types.ts';
export type OllamaBackendKind = 'embedding' | 'generative';
export interface OllamaBackendConfig {
    /** Host:port (default `localhost:11434`) or full origin (`https://ollama.example.com`). */
    host?: string;
    /** Default model when the caller doesn't pass `opts.model`. */
    model?: string;
    /** Per-request timeout. When set, combined with `opts.signal` via `AbortSignal.any`. */
    requestTimeoutMs?: number;
}
/**
 * `ModelBackend` implementation talking to Ollama's HTTP API.
 *
 * - `embed` → `POST /api/embed` (the legacy `/api/embeddings` is deprecated upstream).
 * - `generate` → `POST /api/generate` for string prompts, `POST /api/chat` for
 *   messages-array input.
 * - `generateStream` → same routing as `generate` with `stream: true`; consumes
 *   Ollama's NDJSON wire format and yields `GenerateChunk` per JSON line.
 *
 * Capabilities advertise `tools: false` and `adapters: false`. Ollama tool-call
 * support exists on some models but is uneven across the model catalog; we keep
 * the v1 portability guarantee honest and skip them here.
 */
export declare class OllamaBackend implements ModelBackend {
    #private;
    readonly name = "ollama";
    constructor(config?: OllamaBackendConfig, fetchImpl?: typeof fetch);
    capabilities(): ModelCapabilities;
    embed(input: string | string[], opts: BackendOpts<EmbedOpts>): Promise<ModelCallResult<Float32Array[]>>;
    generate(input: GenerateInput, opts: BackendOpts<GenerateOpts>): Promise<ModelCallResult<GenerateResult>>;
    generateStream(input: GenerateInput, opts: BackendOpts<GenerateOpts>): AsyncIterable<GenerateChunk>;
}
/**
 * Boot-bridge helper. Called from `resources/models/bootstrap.ts` for each
 * `models.embedding.<name>` / `models.generative.<name>` entry whose
 * `backend: ollama`.
 */
export declare function registerOllamaBackend(args: {
    logicalName: string;
    kind: OllamaBackendKind;
    config: OllamaBackendConfig;
}): void;
export declare class OllamaBackendError extends ServerError {
    constructor(message: string);
}
