import { generateTextWithModelId } from "../llm/generate-text.js";
import type { OpenRouterModelEntry } from "./catalog.js";
export type BenchmarkFailureKind = "empty" | "rateLimitMin" | "rateLimitDay" | "noProviders" | "timeout" | "providerError" | "other";
export type BenchmarkFailureCounts = Record<BenchmarkFailureKind, number>;
export type BenchmarkedOpenRouterModel = {
    openrouterModelId: string;
    initialLatencyMs: number;
    medianLatencyMs: number;
    totalLatencyMs: number;
    successCount: number;
    contextLength: number | null;
    maxCompletionTokens: number | null;
    supportedParametersCount: number;
    modality: string | null;
    inferredParamB: number | null;
};
type GenerateModel = typeof generateTextWithModelId;
export declare function classifyBenchmarkFailure(message: string): BenchmarkFailureKind;
export declare function benchmarkOpenRouterModels({ models, openrouterKey, concurrency, timeoutMs, fetchImpl, cooldownMs, generate, now, sleep, onProgress, onSuccess, onFailure, onCooldown, }: {
    models: OpenRouterModelEntry[];
    openrouterKey: string;
    concurrency: number;
    timeoutMs: number;
    fetchImpl: typeof fetch;
    cooldownMs?: number;
    generate?: GenerateModel;
    now?: () => number;
    sleep?: (ms: number) => Promise<void>;
    onProgress?: ((state: {
        done: number;
        total: number;
        okCount: number;
        elapsedMs: number;
    }) => void) | null;
    onSuccess?: ((result: {
        modelId: string;
        latencyMs: number;
    }) => void) | null;
    onFailure?: ((result: {
        modelId: string;
        kind: BenchmarkFailureKind;
        message: string;
    }) => void) | null;
    onCooldown?: ((remainingMs: number) => void) | null;
}): Promise<{
    working: BenchmarkedOpenRouterModel[];
    testedCount: number;
    failureCounts: BenchmarkFailureCounts;
}>;
export declare function selectBenchmarkCandidates(working: BenchmarkedOpenRouterModel[], { smart, maxCandidates, }: {
    smart: number;
    maxCandidates: number;
}): string[];
export declare function refineBenchmarkCandidates({ working, selectedIds, extraRuns, openrouterKey, timeoutMs, fetchImpl, generate, now, onFailure, }: {
    working: BenchmarkedOpenRouterModel[];
    selectedIds: string[];
    extraRuns: number;
    openrouterKey: string;
    timeoutMs: number;
    fetchImpl: typeof fetch;
    generate?: GenerateModel;
    now?: () => number;
    onFailure?: ((result: {
        modelId: string;
        error: unknown;
    }) => void) | null;
}): Promise<BenchmarkedOpenRouterModel[]>;
export {};
