import type { RuntimeModelReference } from "./types.js"; export type LocalProviderType = "ollama" | "lmstudio" | "openai_compat"; export interface LocalProviderCapabilities { readonly tool_use?: boolean; readonly reasoning?: boolean; readonly reasoning_mode?: "none" | "toggle" | "effort" | string; readonly reasoning_levels?: readonly string[]; readonly reasoning_disable_supported?: boolean; readonly vision?: boolean; readonly json_mode?: boolean; readonly context_window?: number; readonly num_ctx?: number; readonly max_tokens?: number; readonly family?: string; readonly advertised_capabilities?: readonly string[]; readonly [key: string]: unknown; } export interface LocalProviderPricing { readonly input_per_million?: number; readonly cached_input_per_million?: number; readonly cache_write_per_million?: number; readonly output_per_million?: number; readonly [key: string]: unknown; } export interface LocalProviderModelDefinition { readonly name: string; readonly alias?: string; readonly displayName?: string; readonly enabled?: boolean; readonly capabilities?: LocalProviderCapabilities; readonly pricing?: LocalProviderPricing; } export interface LocalProviderDefinition { readonly id: string; readonly type: LocalProviderType; readonly baseUrl?: string; readonly enabled?: boolean; readonly trustPublicUrl?: boolean; readonly apiKey?: string; readonly apiKeyEnv?: string; readonly models?: readonly LocalProviderModelDefinition[]; } export interface AgentRuntimeCustomProvider { readonly id: string; readonly provider_type: LocalProviderType; readonly base_url: string; readonly enabled: boolean; readonly trust_public_url: boolean; readonly api_key?: string; } export interface AgentRuntimeCustomModel { readonly provider_id: string; readonly model_name: string; readonly alias?: string; readonly display_name: string; readonly capabilities: LocalProviderCapabilities; readonly pricing: LocalProviderPricing; readonly enabled: boolean; } export interface LocalProviderRuntimeOptions { readonly customProvider?: AgentRuntimeCustomProvider; readonly customModel?: AgentRuntimeCustomModel; readonly modelCapabilities?: LocalProviderCapabilities; readonly isPrivateProvider?: boolean; readonly [key: string]: unknown; } /** One model discovered live from a local provider's OpenAI-compatible `/v1/models` endpoint. */ export interface DiscoveredLocalModel { readonly ref: string; readonly label: string; readonly providerId: string; } export interface DiscoverLocalProviderModelsOptions { readonly fetch?: typeof fetch; readonly timeoutMs?: number; } /** * Live-discovers the models each ENABLED local provider currently serves, by * GETting its OpenAI-compatible `/v1/models` endpoint. Resilient by design: a * down/erroring/non-JSON/malformed-shape endpoint is skipped, never thrown — * this is called on the `/v1/info` request path and must never fail it. Only * enabled providers are probed; a disabled provider is skipped without a * network call. */ export declare function discoverLocalProviderModels(providers: readonly LocalProviderDefinition[] | undefined, opts?: DiscoverLocalProviderModelsOptions): Promise; /** The effort-related facts the TUI needs to render a per-model reasoning/effort picker. */ export interface ModelEffortLevels { readonly reasoning: boolean; /** * How this model exposes reasoning: `"effort"` (graded levels, see * `effortLevels`), `"toggle"` (binary thinking on/off — the client renders * on/off, NOT graded levels), or `"none"` (no adjustable thinking). Absent * for cloud/unconfigured refs, where the client falls back to the global * effort enum. */ readonly reasoningMode?: "none" | "toggle" | "effort" | string; readonly effortLevels?: readonly string[]; } /** * Resolves the reasoning support + effort levels for a parsed model reference. * Local provider models (`ref.sdk === "pi"` with a configured local provider) * get precise levels via the same capability resolution `runtimeOptionsForLocalProvider` * uses for execution. Everything else (cloud pi/claude/codex, or a local ref * whose provider isn't configured here) deliberately degrades to * `{ reasoning: true }` with `effortLevels` left undefined — resolving cloud * reasoning levels precisely would require reaching into the pi-ai model * registry from this package, which would cycle back through config; the TUI * falls back to the global effort enum for those. Never throws. */ export declare function resolveModelEffortLevels(ref: RuntimeModelReference, providers: readonly LocalProviderDefinition[] | undefined): ModelEffortLevels; export declare function runtimeOptionsForLocalProvider(model: RuntimeModelReference, providers: readonly LocalProviderDefinition[] | undefined): LocalProviderRuntimeOptions; export declare function validateLocalProviderDefinition(provider: LocalProviderDefinition): LocalProviderDefinition; export declare function isPrivateBaseUrl(value: string): boolean; //# sourceMappingURL=local-providers.d.ts.map