/** * Model metadata resolution — context window lengths and provenance. * * Resolution priority (mirrors Hermes `_resolve_context_length`): * 1. Disk cache from `cleo llm refresh-catalog` (models.dev snapshot) * 2. Curated table exact match (bundled curated-models.json) * 3. Curated table prefix-alias (strips date / version suffix) * 4. {@link DEFAULT_CONTEXT_LENGTH} fallback * * Tier 1 is populated by {@link resolveContextIndex} from catalog-cache.ts, * which itself fetches https://models.dev/api.json (T9314) and falls back to * the most-recent disk snapshot when offline. * * @task T9264 * @epic T9261 (T-LLM-CRED-CENTRALIZATION Phase 3) */ /** Default context window used when no curated entry or API data is available. */ export declare const DEFAULT_CONTEXT_LENGTH = 256000; /** * Resolved model metadata with provenance information. */ export interface ModelMetadata { /** Context window size in tokens. */ contextLength: number; /** * Where this value came from. * * - `disk-catalog` — read from the local catalog snapshot written by * `cleo llm refresh-catalog` (models.dev data, no network at read time) * - `curated` — bundled curated-models.json exact match * - `curated-alias` — bundled curated-models.json after stripping date/version suffix * - `default` — {@link DEFAULT_CONTEXT_LENGTH} fallback (model unknown) */ source: 'disk-catalog' | 'curated' | 'curated-alias' | 'default'; /** True iff a live-API probe would change this answer. */ livePending?: boolean; } /** * Same as {@link getModelContextLength} but returns full provenance. * * Prefer this for diagnostic output (e.g. `cleo llm whoami`). * * Resolution priority: * 1. Disk catalog cache (models.dev — populated by `cleo llm refresh-catalog`) * 2. Bundled curated table exact match * 3. Bundled curated table alias (strips date / version suffix) * 4. {@link DEFAULT_CONTEXT_LENGTH} fallback * * @param model - Model identifier (e.g. `"claude-sonnet-4-6-20251001"`). * @param baseUrl - Reserved for future provider-specific probes. * @param apiKey - Reserved for future provider-specific probes. * @returns Resolved metadata with provenance. * * @task T9314 */ export declare function getModelMetadata(model: string, baseUrl?: string, apiKey?: string): Promise; /** * Resolve the context window length for a model. * * Resolution priority: * 1. Disk catalog snapshot (populated by `cleo llm refresh-catalog`, no network at read time) * 2. Curated table exact match * 3. Curated table prefix-alias (strip trailing date / version suffix) * 4. {@link DEFAULT_CONTEXT_LENGTH} fallback (256000) * * @param model - Model identifier (e.g. `"claude-sonnet-4-6-20251001"`). * @param baseUrl - Base URL of the provider API (reserved for Tier-1 live probe). * @param apiKey - API key for the provider (reserved for Tier-1 live probe). * @returns Context window size in tokens. */ export declare function getModelContextLength(model: string, baseUrl?: string, apiKey?: string): Promise; /** * Reset the in-memory catalog index cache. * * Exposed for testing only — allows test suites to inject a fresh * catalog between test cases without restarting the process. * * @internal */ export declare function _resetCatalogIndexCache(): void; /** * Synchronous variant of {@link getModelContextLength}. * * Returns the curated context length when a table entry exists (exact or alias), * otherwise returns {@link DEFAULT_CONTEXT_LENGTH}. Does NOT perform a live API * probe — safe to call inside hot synchronous paths such as `ConcreteSession.send()`. * * @param model - Model identifier (e.g. `"claude-sonnet-4-6-20251001"`). * @returns Context window size in tokens. */ export declare function getModelContextLengthSync(model: string): number; /** * Determine if a model requires `max_completion_tokens` instead of `max_tokens`. * * OpenAI's reasoning families (`gpt-5*`, `o1*`, `o3*`, `o4*`) reject the legacy * `max_tokens` request field and require `max_completion_tokens`; every other * model uses `max_tokens`. This is a pure model-id capability predicate, so it * lives with the model-metadata helpers (relocated from the deleted * `transports/openai.ts` under T11832). * * @param model - Provider model identifier to test. * @returns `true` when the model family requires `max_completion_tokens`. * @task T11832 */ export declare function usesMaxCompletionTokens(model: string): boolean; //# sourceMappingURL=model-metadata.d.ts.map