/** * kosha-discovery — Shared models.dev catalog loader. * * Pulls the keyless community catalog at https://models.dev/api.json, * which is maintained by the SST team and tends to surface new models * faster than LiteLLM. Same hardening contract as the LiteLLM loader: * HTTPS-pinned URL, per-provider threat quarantine, bounded body read, * entry-count cap, promise-deduped singleton. * * Schema (top level): * { * [providerSlug]: { * id, name, env: string[], doc, npm, api, * models: { * [modelId]: { * id, name, family, * attachment, reasoning, tool_call, structured_output, temperature, * knowledge, release_date, last_updated, * modalities: { input: string[], output: string[] }, * open_weights, * cost: { input, output, cache_read?, cache_write?, ... }, * limit: { context, output, input? } * } * } * } * } * @module */ import { type QuarantinedEntry } from "../security.js"; /** Pinned upstream catalog URL — HTTPS only. */ export declare const MODELSDEV_CATALOG_URL = "https://models.dev/api.json"; /** Cost block for a single model entry. Fields are optional / forward-compatible. */ export interface ModelsDevCost { input?: number; output?: number; cache_read?: number; cache_write?: number; /** Per-million tokens for >200K-context billing tier (OpenAI long-context tier). */ context_over_200k?: { input?: number; output?: number; cache_read?: number; }; /** Per-million tokens for batch API tier. */ batch?: { input?: number; output?: number; }; } /** Limit block — context window + output cap + optional input cap. */ export interface ModelsDevLimit { context?: number; output?: number; input?: number; } /** Modalities block — structured input/output media kinds. */ export interface ModelsDevModalities { input?: string[]; output?: string[]; } /** A single model entry in models.dev. */ export interface ModelsDevModel { id: string; name?: string; family?: string; attachment?: boolean; reasoning?: boolean; tool_call?: boolean; structured_output?: boolean; temperature?: boolean; knowledge?: string; release_date?: string; last_updated?: string; modalities?: ModelsDevModalities; open_weights?: boolean; cost?: ModelsDevCost; limit?: ModelsDevLimit; } /** A single provider entry in models.dev. */ export interface ModelsDevProvider { id: string; name?: string; env?: string[]; api?: string; doc?: string; npm?: string; models?: Record; } /** * Provider entries the threat scan dropped from the last successful load. * * Surfaced so `kosha doctor` can report a quarantined provider instead of it * just going quietly missing from the catalog. */ export declare function modelsDevQuarantined(): QuarantinedEntry[]; /** * Fetch the models.dev catalog with full hardening. Concurrent callers * share the same in-flight promise. */ export declare function loadModelsDevCatalog(): Promise>; /** Test-only helper to clear the cache between runs. */ export declare function resetModelsDevCatalogCache(): void; //# sourceMappingURL=modelsdev-catalog.d.ts.map