/**
 * HTTP discovery protocols for configured and implicit providers — ollama,
 * llama.cpp, lm-studio, openai-models-list, and new-api/one-api-style proxies.
 * `ModelRegistry` owns the orchestration (status, state, caching) and calls
 * `discoverModelsByProviderType` with a `DiscoveryContext`; built-in provider
 * discovery lives in pi-catalog's provider-models.
 */
import { type ApiKey, type FetchImpl } from "@oh-my-pi/pi-ai";
import type { Api, Model, RemoteCompactionConfig } from "@oh-my-pi/pi-ai/types";
import type { ModelSpec } from "@oh-my-pi/pi-catalog/types";
import type { ProviderDiscovery } from "./models-config-schema.js";
export declare const DISCOVERY_DEFAULT_CONTEXT_WINDOW = 128000;
export declare const DISCOVERY_DEFAULT_MAX_TOKENS = 32768;
export declare function getImplicitOllamaBaseUrl(): string;
export declare function getOllamaContextLengthOverride(): number | undefined;
/** Routes discovered-model `maxTokens` defaults around Anthropic's 3× output divisor. */
export declare function discoveryDefaultMaxTokens(api: Api | undefined): number;
export interface DiscoveryProviderConfig {
    provider: string;
    api: Api;
    baseUrl?: string;
    headers?: Record<string, string>;
    compat?: ModelSpec<Api>["compat"];
    remoteCompaction?: RemoteCompactionConfig<Api>;
    discovery: ProviderDiscovery;
    optional?: boolean;
}
/** Registry-provided capabilities the protocol probes need; never the registry itself. */
export interface DiscoveryContext {
    /** Injected fetch implementation (tests stub this). */
    fetch: FetchImpl;
    /**
     * Resolve a provider's bearer credential for `Authorization: Bearer …`.
     * Returns undefined when no key is stored or it is a local/no-auth
     * sentinel; otherwise an {@link ApiKey} whose resolver participates in the
     * central force-refresh/rotate auth-retry policy on 401/usage-limit.
     */
    getBearerApiKeyResolver(provider: string): Promise<ApiKey | undefined>;
}
type LlamaCppDiscoveredModelRuntimeMetadata = {
    contextWindow?: number;
    maxTokens?: number;
    input?: ("text" | "image")[];
};
export declare function discoverModelsByProviderType(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
export declare function discoverOllamaModels(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
export declare function discoverLlamaCppModels(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
export declare function discoverLlamaCppModelRuntimeMetadata(model: Pick<Model<Api>, "provider" | "id" | "baseUrl" | "headers">, ctx: DiscoveryContext): Promise<LlamaCppDiscoveredModelRuntimeMetadata | undefined>;
export declare function discoverOpenAIModelsList(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
export declare function discoverLiteLLMModels(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
/**
 * Discover models from an Anthropic+OpenAI-compatible reseller proxy that
 * exposes both `/v1/messages` and `/v1/chat/completions`, advertising each
 * model's wire capabilities through `supported_endpoint_types` on
 * `GET /v1/models` (new-api / one-api-style proxies).
 *
 * Routing per model:
 *   supported_endpoint_types: ["anthropic", ...] -> api: "anthropic-messages"
 *   supported_endpoint_types: ["openai"]         -> api: "openai-completions"
 *   missing / neither                            -> provider-level api fallback
 *
 * Anthropic models share the same baseUrl; the Anthropic SDK strips a
 * trailing `/v1` itself before appending `/v1/messages`, so the discovery
 * URL (which ends in `/v1`) round-trips correctly.
 */
export declare function discoverProxyModels(providerConfig: DiscoveryProviderConfig, ctx: DiscoveryContext): Promise<Model<Api>[]>;
export declare function normalizeLiteLLMDiscoveryBaseUrl(baseUrl?: string): string;
export declare function normalizeOpenAIModelsListBaseUrl(baseUrl?: string): string;
export {};
