import type { LLMProvider } from './types.js'; /** * Explicit OpenAI-compatible backend override for a single call. When set, it * takes precedence over `resolveCustomBackend(process.env)` and routes to the * given `url` + `model` for THAT call only — reading nothing from process.env. * This is the concurrency-safe way to route a call to a resolved endpoint (e.g. * the local-model tier) without mutating ambient env. Omitting it preserves the * existing behavior exactly. */ export interface LlmBackendOverride { /** Base URL or full /chat/completions URL of an OpenAI-compatible server. */ url: string; /** Model to request; falls back to modelOverride > WIGOLO_LLM_MODEL > 'local'. */ model?: string; /** When true, auto-pick an installed model from /api/tags if none is given. */ isOllama?: boolean; } export interface RunLlmTextOpts { prompt: string; maxTokens?: number; modelOverride?: string; timeoutMs?: number; signal?: AbortSignal; /** Route this call to an explicit backend, bypassing process.env resolution. */ backend?: LlmBackendOverride; } export interface RunLlmTextResult { text: string; provider: LLMProvider | 'custom'; model: string; latencyMs: number; } export interface RunLlmJsonOpts extends RunLlmTextOpts { jsonSchema?: Record; } export interface RunLlmJsonResult { values: Record; provider: LLMProvider | 'custom'; model: string; latencyMs: number; } export declare function isLlmConfigured(env?: Record): boolean; /** * Async variant of isLlmConfigured that also checks the keystore. * Use this when you have access to the data dir. */ export declare function isLlmConfiguredWithKeyStore(env?: Record): Promise; export declare function runLlmText(opts: RunLlmTextOpts): Promise; export declare function runLlmJson(opts: RunLlmJsonOpts): Promise; /** * Resolve the API key for the currently configured provider through the * full keystore chain (keychain → file → env). Returns undefined when no * provider is configured. * * Used by llm-fallback.ts which needs the key + provider separately. */ export declare function resolveActiveProviderKey(): Promise<{ provider: LLMProvider; key: string; } | null>; export { resolveProviderKey } from '../../../security/key-store.js'; //# sourceMappingURL=run.d.ts.map