@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
48 lines (47 loc) • 2.27 kB
TypeScript
/**
* Model detection utilities for capability checking
*/
export declare function isGemini3Model(modelName: string): boolean;
export declare function isGemini25Model(modelName: string): boolean;
export declare function supportsThinkingConfig(modelName: string): boolean;
export declare function supportsPromptCaching(modelName: string): boolean;
export declare function getMaxThinkingBudgetTokens(modelName: string): number;
/**
* Resolves the Vertex-accepted `thinkingBudget` bounds for a Gemini 2.5
* model. Returns undefined for anything that isn't a Gemini 2.5 model —
* Gemini 3 takes `thinkingLevel` directly, and no thinking-budget mapping
* has been verified for earlier Gemini generations.
*/
export declare function getGemini25ThinkingBudgetRange(modelName: string): {
min: number;
max: number;
} | undefined;
export declare function getModelFamily(modelName: string): string;
/**
* Check if a model has restricted output token limit (32768 max)
* This applies to:
* - All Gemini 3 models (gemini-3-flash, gemini-3-pro, etc.)
* - Image generation models (gemini-2.5-flash-image, gemini-3-pro-image-preview)
*/
export declare function hasRestrictedOutputLimit(modelName: string): boolean;
/**
* Get the max output tokens for a model (32768 for restricted models)
*/
export declare const RESTRICTED_OUTPUT_TOKEN_LIMIT = 32768;
/**
* Normalize an Anthropic-API-style Claude model ID to the Vertex publisher
* format.
*
* The Anthropic API dates models with a trailing dash segment
* ("claude-haiku-4-5-20251001") while Vertex publisher IDs separate the date
* with "@" ("claude-haiku-4-5@20251001"). Vertex rejects the dash form with a
* 404 (verified live against us-east5), so the native Vertex+Claude paths
* normalize before calling @anthropic-ai/vertex-sdk.
*
* Pass-through cases: IDs already in "@" form, bare aliases with no date
* ("claude-sonnet-4-6" — Vertex resolves these itself), and non-Claude models.
* Legacy v2-suffixed Vertex IDs ("claude-3-5-sonnet-v2@20241022") have no
* dash-date equivalent, so those legacy dash IDs stay out of scope: they 404
* today and still 404 after the transform — no regression either way.
*/
export declare function toVertexAnthropicModelId(modelName: string): string;