import type { EmbeddingProvider } from "./embedding-provider";
interface OpenAICompatibleEmbeddingProviderOptions {
    endpoint?: string;
    model?: string;
    apiKey?: string;
    /** Optional `input_type` body field (e.g. NVIDIA NIM 'query'/'passage'). */
    inputType?: string;
    /** Optional `truncate` body field (e.g. NVIDIA NIM 'NONE'/'START'/'END'). */
    truncate?: string;
    /** Maximum safe input tokens for chunk embeddings. */
    maxInputTokens?: number;
}
/**
 * Whether the model an endpoint served is the model we asked for.
 *
 * Exact match after trim+lowercase, with prefix/suffix tolerance so a server
 * that version-expands a name (`text-embedding-3-small` → `…-small-v1`) or
 * trims a vendor prefix still counts as a match. A genuine substitution to a
 * DIFFERENT model (e.g. requested `qwen3-embedding-4b-dwq`, served
 * `text-embedding-qwen3-embedding-0.6b` — neither contains the other) does not.
 */
export declare function embeddingModelsMatch(served: string, requested: string): boolean;
type CircuitState = "closed" | "open" | "half_open";
export declare class OpenAICompatibleEmbeddingProvider implements EmbeddingProvider {
    readonly modelId: string;
    readonly maxInputTokens: number;
    private readonly endpoint;
    private readonly model;
    private readonly apiKey;
    private readonly inputType;
    private readonly truncate;
    private initialized;
    private failureTimes;
    private circuitOpenUntil;
    private openLogged;
    /** One-shot guard so a persistent model substitution doesn't flood the log
     *  with one line per batch. Resets with the provider instance (i.e. on any
     *  config change), so a corrected config logs again if it regresses. */
    private modelMismatchLogged;
    /** True while a half-open probe is in flight. Only the caller who set this
     *  to true is allowed to make a real HTTP call; everyone else short-
     *  circuits as if the circuit were still OPEN. */
    private halfOpenProbeInFlight;
    constructor(options: OpenAICompatibleEmbeddingProviderOptions);
    initialize(): Promise<boolean>;
    embed(text: string, signal?: AbortSignal): Promise<Float32Array | null>;
    embedBatch(texts: string[], signal?: AbortSignal): Promise<(Float32Array | null)[]>;
    dispose(): Promise<void>;
    isLoaded(): boolean;
    /**
     * Decide what this caller should do:
     *   - "allow":         CLOSED — proceed with a real request, not as a probe
     *   - "probe":         HALF_OPEN — this caller owns the probe slot
     *   - "short_circuit": OPEN or half-open probe already in flight — return nulls
     *
     * Claiming the probe slot (setting `halfOpenProbeInFlight = true`) is done
     * here, synchronously, so concurrent callers see the flag and short-circuit.
     */
    private claimProbeOrShortCircuit;
    private recordFailure;
    private recordSuccess;
    _getCircuitState(): CircuitState;
    _getFailureCount(): number;
    _resetCircuit(): void;
}
export {};
//# sourceMappingURL=embedding-openai.d.ts.map