@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
43 lines (42 loc) • 2.54 kB
TypeScript
import type { ProviderModelManifest, ProviderModelManifestEntry } from "../types/index.js";
/**
* Every provider's model manifest, keyed by the exact AIProviderName enum
* value (kebab-case) — e.g. "google-ai", "nvidia-nim". Manifests are pure
* data with zero heavy dependencies, so they are imported statically here
* (Critical Rule 1's dynamic-import mandate targets providerRegistry.ts's
* *provider* factories, which pull in real SDK clients — not this).
*/
export declare const MANIFEST_REGISTRY: Record<string, ProviderModelManifest>;
export declare function getManifestForProvider(provider: string): ProviderModelManifest | undefined;
export declare function getAllManifestProviders(): string[];
/**
* Resolve a model against a provider's manifest WITHOUT ever falling back to
* the provider's `_default` entry. Used by callers that need to insert their
* own special-case fallback (cross-provider pricing, proxy pass-through)
* between "no real match" and "give up" — see resolveManifestEntry's
* docblock for why the split exists.
*
* Resolution order: exact canonical id, then a declared alias, then
* longest-prefix match (for tagged/gateway-shaped ids like Ollama's
* "llama3.2:latest" or OpenRouter's "openai/gpt-4o"), then undefined.
* Family rules are applied on top of whichever entry matched.
*/
/**
* Like resolveManifestEntryExact but WITHOUT the longest-prefix fallback:
* exact canonical id or declared alias only. For consumers where a prefix
* hit can steal precedence from a more-specific legacy row — boolean
* capability checks above all (a manifest "gpt-4" prefix match must never
* shadow the legacy table's explicit "gpt-4-vision-preview" vision row).
* Family rules still apply to a real match.
*/
export declare function resolveManifestEntryStrict(provider: string, model: string): ProviderModelManifestEntry | undefined;
export declare function resolveManifestEntryExact(provider: string, model: string): ProviderModelManifestEntry | undefined;
/**
* Resolve a model against a provider's manifest, falling back to the
* provider's `_default` entry (synthesized from `PROVIDER_MAX_TOKENS`,
* clamped to `defaultContextWindow`, when no explicit `_default` model
* entry exists) when no real model matches. Family rules are tested
* against the ORIGINAL model string even on the `_default` path, so an
* unmatched gateway-shaped id still gets patched.
*/
export declare function resolveManifestEntry(provider: string, model: string): ProviderModelManifestEntry | undefined;