/** * kosha-discovery — LiteLLM community data enrichment. * * Fetches the community-maintained litellm model catalogue from GitHub * and uses it to fill in pricing, context window sizes, and capability * flags on already-discovered {@link ModelCard} objects. * @module */ import type { Enricher, ModelCard } from "../types.js"; /** * Enriches ModelCard data with pricing, context-window sizes, and capability * flags sourced from the litellm community-maintained model catalogue. * * @see https://github.com/BerriAI/litellm */ export declare class LiteLLMEnricher implements Enricher { private data; /** Fetch and cache the litellm pricing JSON via the shared catalog loader. */ load(): Promise; /** * Enrich an array of ModelCards with litellm data. * * - Only fills in **missing** fields — never overwrites API-sourced data. * - Returns new ModelCard objects (immutable pattern). * - Models not found in litellm are returned unchanged. */ enrich(models: ModelCard[]): Promise; private enrichOne; /** * Best-effort lifecycle status from a deprecation-date string. * * Returns `"retired"` when the date has already passed, * `"deprecated"` when one is set but still in the future, * and `"active"` when no date is present. */ private inferStatus; /** * Look up a model in the litellm pricing catalogue using a tiered set of * key strategies. Later strategies use `originProvider` to handle models * whose IDs are namespaced differently by the serving layer (e.g. a Bedrock * model whose `id` is `"anthropic.claude-opus-4-8-…"` but whose * `originProvider` is `"anthropic"`). * * Lookup order: * 1. Exact `id` match * 2. `{provider}/{id}` format * 3. `{originProvider}/{id}` (when originProvider differs from provider) * 4. `{originProvider}/{normalizedId}` — strips prefix/date suffixes * 5. Lowercase exact `id` match * 6. Lowercase `{provider}/{id}` * 7. Lowercase `{originProvider}/{normalizedId}` */ private lookupModel; /** Convert litellm per-token costs to per-million pricing. */ private extractPricing; /** * Return the first defined finite number from a list of optional values. * This allows tolerant support for field-name variants in upstream data. */ private firstFinite; /** Map litellm mode strings to our ModelMode type. */ private mapMode; } //# sourceMappingURL=litellm.d.ts.map