/** * Static provider registry for known LLM providers. * * This module contains: * 1. PROVIDER_REGISTRY: metadata for all known providers (auth methods, env vars, key prefixes) * 2. OAUTH_PROVIDER_IDS: the subset of providers that support OAuth * 3. UTILITY_MODEL_OVERRIDES: per-provider utility model overrides for inference exceptions * * OAuth flows are resolved through pi-ai's OAuth provider registry at runtime. * * Reference: provider-manager.md */ /** Authentication method supported by a provider. */ export type AuthMethod = 'oauth' | 'api_key'; /** Static metadata for a known LLM provider. */ export interface ProviderInfo { /** Provider identifier (e.g., 'anthropic', 'openai', 'google'). */ id: string; /** Human-readable name (e.g., 'Anthropic', 'OpenAI'). */ name: string; /** Supported authentication methods. */ authMethods: AuthMethod[]; /** Environment variable name for API key (e.g., 'ANTHROPIC_API_KEY'). */ envVar?: string | undefined; /** API key prefix for client-side type inference (e.g., 'sk-ant-'). */ keyPrefix?: string | undefined; /** URL where users obtain API keys. */ keyUrl?: string | undefined; } /** Metadata about a model available from a provider. */ export interface ModelInfo { /** Model identifier (e.g., 'claude-sonnet-4-20250514'). */ id: string; /** Human-readable name (e.g., 'Claude Sonnet 4'). */ name: string; /** Context window size in tokens. */ contextWindow: number; /** Whether the model supports extended thinking. */ supportsThinking: boolean; /** Thinking levels supported by this model, in Cortex's public naming. */ supportedThinkingLevels: Array<'off' | 'minimal' | 'low' | 'medium' | 'high' | 'max'>; /** Whether the model supports image input. */ supportsImages: boolean; /** Pricing per million tokens (if available). */ pricing?: { input: number; output: number; } | undefined; } /** * All known providers with their authentication methods and UX metadata. * * This registry is maintained manually. When pi-ai adds a new provider, * a corresponding entry is added here. Providers not in the registry can * still be used via resolveModel() and createCustomModel() with direct * API keys; they just won't appear in the discovery UI. */ export declare const PROVIDER_REGISTRY: ProviderInfo[]; /** * Provider IDs that support OAuth login flows. */ export declare const OAUTH_PROVIDER_IDS: string[]; /** * Default primary model IDs per provider. * Used when a user first connects a provider and no model is explicitly selected. * These are the best general-purpose models for each provider. */ export declare const PRIMARY_MODEL_DEFAULTS: Record; /** * Per-provider utility model overrides for inference exceptions. * Leave empty unless dynamic inference picks a bad utility model for a provider. */ export declare const UTILITY_MODEL_OVERRIDES: Record; /** Backwards-compatible alias. Prefer UTILITY_MODEL_OVERRIDES for new code. */ export declare const UTILITY_MODEL_DEFAULTS: Record; export type CacheRetention = 'none' | 'short' | 'long'; /** Per-provider prompt caching characteristics as implemented in pi-ai. */ export interface ProviderCacheConfig { /** Whether pi-ai implements cacheRetention for this provider. */ supported: boolean; /** Short-term cache TTL in ms (0 if unsupported). */ shortTtlMs: number; /** Long-term cache TTL in ms (0 if unsupported). */ longTtlMs: number; /** Write cost multiplier vs base input price for short cache (1.0 = free). */ shortWritePremium: number; /** Write cost multiplier vs base input price for long cache. */ longWritePremium: number; /** Read cost multiplier vs base input price (0.1 = 90% discount). */ readDiscount: number; /** Whether the TTL resets on each cache hit. */ ttlResetsOnHit: boolean; /** True if "long" has no cost penalty over "short" (e.g. OpenAI). */ preferLong: boolean; } /** * Cache configuration for all known providers. * * Only Anthropic, Bedrock (Claude), and OpenAI Responses actually implement * cacheRetention in pi-ai. All other providers ignore it (no-op). */ export declare const PROVIDER_CACHE_CONFIG: Record; /** * Resolve the optimal cache retention setting for a provider and tick interval. * * Decision logic: * - Providers with preferLong (e.g. OpenAI, free writes): always "long" * - Anthropic/Bedrock with interval ≤ 4.5 min: "short" (cheaper writes, TTL resets on hit) * - Anthropic/Bedrock with interval > 4.5 min: "long" (need 1-hour window for sleep ticks) * - Unsupported providers: "none" */ export declare function resolveCacheRetention(provider: string, tickIntervalMs: number): CacheRetention; //# sourceMappingURL=provider-registry.d.ts.map