/**
 * LiteLLM API Configuration Manager
 * Manages provider credentials, custom endpoints, and cache settings
 */
import type { LiteLLMApiConfig, ProviderCredential, CustomEndpoint, GlobalCacheSettings, ProviderType, CacheStrategy, CodexLensEmbeddingRotation, CodexLensEmbeddingProvider, EmbeddingPoolConfig } from '../types/litellm-api-config.js';
/**
 * Load configuration from file
 */
export declare function loadLiteLLMApiConfig(baseDir: string): LiteLLMApiConfig;
/**
 * Resolve environment variables in API key
 * Supports ${ENV_VAR} syntax
 */
export declare function resolveEnvVar(value: string): string;
/**
 * Get all providers
 */
export declare function getAllProviders(baseDir: string): ProviderCredential[];
/**
 * Get provider by ID
 */
export declare function getProvider(baseDir: string, providerId: string): ProviderCredential | null;
/**
 * Get provider with resolved environment variables
 */
export declare function getProviderWithResolvedEnvVars(baseDir: string, providerId: string): (ProviderCredential & {
    resolvedApiKey: string;
}) | null;
/**
 * Add new provider
 */
export declare function addProvider(baseDir: string, providerData: Omit<ProviderCredential, 'id' | 'createdAt' | 'updatedAt'>): ProviderCredential;
/**
 * Update provider
 */
export declare function updateProvider(baseDir: string, providerId: string, updates: Partial<Omit<ProviderCredential, 'id' | 'createdAt' | 'updatedAt'>>): ProviderCredential;
/**
 * Delete provider
 */
export declare function deleteProvider(baseDir: string, providerId: string): boolean;
/**
 * Get all endpoints
 */
export declare function getAllEndpoints(baseDir: string): CustomEndpoint[];
/**
 * Get endpoint by ID
 */
export declare function getEndpoint(baseDir: string, endpointId: string): CustomEndpoint | null;
/**
 * Find endpoint by ID (alias for getEndpoint)
 */
export declare function findEndpointById(baseDir: string, endpointId: string): CustomEndpoint | null;
/**
 * Add new endpoint
 */
export declare function addEndpoint(baseDir: string, endpointData: Omit<CustomEndpoint, 'createdAt' | 'updatedAt'>): CustomEndpoint;
/**
 * Update endpoint
 */
export declare function updateEndpoint(baseDir: string, endpointId: string, updates: Partial<Omit<CustomEndpoint, 'id' | 'createdAt' | 'updatedAt'>>): CustomEndpoint;
/**
 * Delete endpoint
 */
export declare function deleteEndpoint(baseDir: string, endpointId: string): boolean;
/**
 * Get default endpoint
 */
export declare function getDefaultEndpoint(baseDir: string): string | undefined;
/**
 * Set default endpoint
 */
export declare function setDefaultEndpoint(baseDir: string, endpointId?: string): void;
/**
 * Get global cache settings
 */
export declare function getGlobalCacheSettings(baseDir: string): GlobalCacheSettings;
/**
 * Update global cache settings
 */
export declare function updateGlobalCacheSettings(baseDir: string, settings: Partial<GlobalCacheSettings>): void;
/**
 * Get CodexLens embedding rotation config
 */
export declare function getCodexLensEmbeddingRotation(baseDir: string): CodexLensEmbeddingRotation | undefined;
/**
 * Update CodexLens embedding rotation config
 * Also triggers sync to CodexLens settings.json
 */
export declare function updateCodexLensEmbeddingRotation(baseDir: string, rotationConfig: CodexLensEmbeddingRotation | undefined): {
    syncResult: {
        success: boolean;
        message: string;
        endpointCount?: number;
    };
};
/**
 * Get all enabled embedding providers with their API keys for rotation
 * This aggregates all providers that have embedding models configured
 */
export declare function getEmbeddingProvidersForRotation(baseDir: string): Array<{
    providerId: string;
    providerName: string;
    apiBase: string;
    embeddingModels: Array<{
        modelId: string;
        modelName: string;
        dimensions: number;
    }>;
    apiKeys: Array<{
        keyId: string;
        keyLabel: string;
        enabled: boolean;
    }>;
}>;
/**
 * Extended rotation endpoint with routing and health check info
 */
export interface RotationEndpointConfig {
    name: string;
    api_key: string;
    api_base: string;
    model: string;
    weight: number;
    max_concurrent: number;
    /** Routing strategy for load balancing */
    routing_strategy?: string;
    /** Health check configuration */
    health_check?: {
        enabled: boolean;
        interval_seconds: number;
        cooldown_seconds: number;
        failure_threshold: number;
    };
    /** Last recorded latency in milliseconds */
    last_latency_ms?: number;
}
/**
 * Generate rotation endpoints for ccw_litellm
 * Creates endpoint list from rotation config for parallel embedding
 * Supports both legacy codexlensEmbeddingRotation and new embeddingPoolConfig
 */
export declare function generateRotationEndpoints(baseDir: string): RotationEndpointConfig[];
/**
 * Sync CodexLens settings with CCW API config
 * Writes rotation endpoints to ~/.codexlens/settings.json
 * This enables the Python backend to use UI-configured rotation
 * Supports both new embeddingPoolConfig and legacy codexlensEmbeddingRotation
 */
export declare function syncCodexLensConfig(baseDir: string): {
    success: boolean;
    message: string;
    endpointCount?: number;
};
/**
 * Get embedding pool config
 */
export declare function getEmbeddingPoolConfig(baseDir: string): EmbeddingPoolConfig | undefined;
/**
 * Update embedding pool config
 * Also triggers sync to CodexLens settings.json if enabled
 */
export declare function updateEmbeddingPoolConfig(baseDir: string, poolConfig: EmbeddingPoolConfig | undefined): {
    syncResult: {
        success: boolean;
        message: string;
        endpointCount?: number;
    };
};
/**
 * Discover all providers that offer a specific embedding model
 * Returns list of {providerId, providerName, modelId, modelName, apiKeys[]}
 */
export declare function discoverProvidersForModel(baseDir: string, targetModel: string): Array<{
    providerId: string;
    providerName: string;
    modelId: string;
    modelName: string;
    apiKeys: Array<{
        keyId: string;
        keyLabel: string;
        enabled: boolean;
    }>;
}>;
/**
 * Convert UI config (JSON) to ccw_litellm config (YAML format object)
 * This allows CodexLens to use UI-configured providers
 */
export declare function generateLiteLLMYamlConfig(baseDir: string): Record<string, unknown>;
/**
 * Save ccw_litellm YAML config file
 * Writes to ~/.ccw/config/litellm-config.yaml
 */
export declare function saveLiteLLMYamlConfig(baseDir: string): string;
/**
 * Get all model pool configurations
 * Returns empty array if no pools configured
 */
export declare function getModelPools(baseDir: string): import('../types/litellm-api-config.js').ModelPoolConfig[];
/**
 * Get a specific model pool by ID
 */
export declare function getModelPool(baseDir: string, poolId: string): import('../types/litellm-api-config.js').ModelPoolConfig | undefined;
/**
 * Add a new model pool configuration
 */
export declare function addModelPool(baseDir: string, poolConfig: Omit<import('../types/litellm-api-config.js').ModelPoolConfig, 'id'>): {
    poolId: string;
    syncResult?: {
        success: boolean;
        message: string;
        endpointCount?: number;
    };
};
/**
 * Update an existing model pool configuration
 */
export declare function updateModelPool(baseDir: string, poolId: string, updates: Partial<Omit<import('../types/litellm-api-config.js').ModelPoolConfig, 'id'>>): {
    success: boolean;
    syncResult?: {
        success: boolean;
        message: string;
        endpointCount?: number;
    };
};
/**
 * Delete a model pool configuration
 */
export declare function deleteModelPool(baseDir: string, poolId: string): {
    success: boolean;
    syncResult?: {
        success: boolean;
        message: string;
        endpointCount?: number;
    };
};
/**
 * Get available models for a specific model type
 * Used for pool configuration UI
 */
export declare function getAvailableModelsForType(baseDir: string, modelType: import('../types/litellm-api-config.js').ModelPoolType): Array<{
    modelId: string;
    modelName: string;
    providers: string[];
}>;
export type { ProviderCredential, CustomEndpoint, ProviderType, CacheStrategy, CodexLensEmbeddingRotation, CodexLensEmbeddingProvider, EmbeddingPoolConfig };
//# sourceMappingURL=litellm-api-config-manager.d.ts.map