/**
 * Unified Model Registry — single server-side source of truth for all available models.
 *
 * Assembles a merged model list from:
 * 1. Built-in providers (from pi-ai getProviders()/getModels())
 * 2. AI Gateway models (if configured, live fetch via discoverAigwModels())
 * 3. Custom local providers (Ollama, LM Studio, vLLM, llama.cpp)
 *
 * Served via GET /api/models with a 5-second TTL cache.
 */
import type { PreferencesStore } from "./preferences-store.js";
export interface ApiModel {
    id: string;
    name: string;
    provider: string;
    api: string;
    baseUrl?: string;
    contextWindow: number;
    maxTokens: number;
    reasoning: boolean;
    thinkingLevelMap?: Record<string, string | null>;
    input: ("text" | "image")[];
    cost: {
        input: number;
        output: number;
        cacheRead: number;
        cacheWrite: number;
    };
    headers?: Record<string, string>;
    compat?: unknown;
    authenticated: boolean;
}
export interface CustomProviderConfig {
    id: string;
    name: string;
    type: "ollama" | "lmstudio" | "llama.cpp" | "vllm" | "manual" | "openai-images" | "gemini-images" | "google-imagen";
    baseUrl: string;
    apiKey?: string;
    models?: Array<{
        id: string;
        name: string;
    }>;
}
/**
 * Invalidate the models cache. Call when upstream config changes in a way
 * that the prefs-version hash doesn't reflect (e.g. external mutation of
 * the aigw endpoint's model list after a successful reconfigure/refresh).
 * The next `getAvailableModels` call will assemble fresh.
 *
 * This keeps the UX snappy: when a user reconfigures the gateway, clicks
 * Refresh, or removes the gateway, the next /api/models response reflects
 * reality immediately instead of serving up to 5s of stale data.
 */
export declare function invalidateModelCache(): void;
/**
 * Get all available models, merged from all sources.
 * Results are cached for 5 seconds.
 */
export declare function getAvailableModels(prefs: PreferencesStore): Promise<ApiModel[]>;
/** Invalidate the cached auth.json data so the next read picks up fresh credentials. */
export declare function clearOAuthCache(): void;
/** Discover models from a single custom provider config (without persisting anything). */
export declare function discoverModelsForConfig(config: CustomProviderConfig): Promise<ApiModel[]>;
import { GPT_55_RECENCY_RANK } from "../../shared/model-ranks.js";
export { GPT_55_RECENCY_RANK };
/**
 * Rank a model ID by recency/quality tier. Higher = newer/better.
 * Used to auto-select the best model when no preference is set.
 * Canonical server-side copy — also used by session-manager for auto-selection.
 */
export declare function modelRecencyRank(id: string): number;
//# sourceMappingURL=model-registry.d.ts.map