/** * context-discovery.ts * * Multi-provider context window discovery with verbose-first endpoint probing. * * Implements a provider-agnostic discovery chain that probes endpoints from * most-informative (verbose) to least-informative, returning the richest * available context window data for each model. * * Discovery chain (ordered most-verbose to least-verbose): * 1. /api/v1/models , LM Studio rich format (key + max_context_length) * 2. /api/tags , Ollama list + per-model /api/show for context_length * 3. /v1/models , OpenAI compat (id, optionally max_model_len for vLLM) * 4. /props , llama.cpp server-level n_ctx (single context all models) * 5. /info , TGI format (max_input_tokens / max_total_tokens) * * Capability gate: `local-provider-context-ingestion` (provider.localContextIngestion, default on) */ /** Placeholder model ID used when a server-level endpoint has no model list. */ export declare const SERVER_LEVEL_MODEL_ID = "__server__"; /** * Discover context window sizes for all models at the given provider base URL. * * Probes endpoints in verbose-first order: * 1. LM Studio `/api/v1/models` * 2. Ollama `/api/tags` + `/api/show` * 3. OpenAI-compat `/v1/models` * 4. llama.cpp `/props` * 5. TGI `/info` * * The first probe that yields a non-null result populates the map. Subsequent * probes only ADD entries for model IDs not yet present, they never overwrite * data from a more-informative probe. * * @param baseURL - Provider base URL (e.g. `http://localhost:11434/v1`). * The `/v1` suffix is used for the OpenAI-compat probe; the origin is * derived automatically for all other probes. * @param apiKey - Optional Bearer token sent with every probe request. * @returns Map of model ID → context window in tokens. Empty map if all * probes fail or none return context length data. */ export declare function discoverContextWindows(baseURL: string, apiKey?: string | undefined): Promise>; //# sourceMappingURL=context-discovery.d.ts.map