@juspay/neurolink 13.1.1 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export type CatalogProviderName = "a2agent" | "abliteration" | "above-dev" | "ai21" | "aiand" | "aihubmix" | "aionlabs" | "ambient" | "api-route" | "arcee" | "atlas-cloud" | "avian-io" | "baidu-qianfan" | "baseten" | "bee-heossi" | "byteplus-modelark" | "bytez" | "cerebras" | "charm-hyper" | "chutes" | "cloudflare" | "crusoe" | "dashscope" | "deepinfra" | "deepseek" | "empiriolabs" | "featherless-ai" | "fireworks" | "friendli" | "gmicloud" | "gradientai" | "groq" | "hetzner-inference" | "huggingface" | "inception-labs" | "inceptron" | "inco" | "inference-net" | "io-intelligence" | "koscompute" | "laya" | "lemonfox-ai" | "lilac" | "llmtech" | "longcat" | "mancer" | "meta-model-api" | "minimax" | "mistral" | "moark" | "modelscope" | "moonshot-ai" | "morph" | "naver-clova-studio" | "nebius" | "neuralwatt" | "novita" | "openai-decisions" | "ovhcloud" | "parasail" | "pareto-inference" | "perplexity" | "poolside" | "prime-intellect" | "reka" | "runinfra" | "sakana-ai" | "sambanova" | "sarvam" | "scaleway" | "siliconflow" | "stackit" | "stepfun" | "subconscious" | "subq" | "synthetic" | "telnyx" | "thinking-machines" | "tinfoil" | "together-ai" | "umans-ai" | "upstage" | "venice-ai" | "vispark" | "vultr-inference" | "wafer" | "wandb-inference" | "xai" | "xiaomi-mimo" | "xor" | "z-ai";
2
- export type CatalogCredentialKey = "a2agent" | "abliteration" | "aboveDev" | "ai21" | "aiand" | "aihubmix" | "aionlabs" | "ambient" | "apiRoute" | "arcee" | "atlasCloud" | "avianIo" | "baiduQianfan" | "baseten" | "beeHeossi" | "byteplusModelark" | "bytez" | "cerebras" | "charmHyper" | "chutes" | "cloudflare" | "crusoe" | "dashscope" | "deepinfra" | "deepseek" | "empiriolabs" | "featherlessAi" | "fireworks" | "friendli" | "gmicloud" | "gradientai" | "groq" | "hetznerInference" | "huggingFace" | "inceptionLabs" | "inceptron" | "inco" | "inferenceNet" | "ioIntelligence" | "koscompute" | "laya" | "lemonfoxAi" | "lilac" | "llmtech" | "longcat" | "mancer" | "metaModelApi" | "minimax" | "mistral" | "moark" | "modelscope" | "moonshotAi" | "morph" | "naverClovaStudio" | "nebius" | "neuralwatt" | "novita" | "openaiDecisions" | "ovhcloud" | "parasail" | "paretoInference" | "perplexity" | "poolside" | "primeIntellect" | "reka" | "runinfra" | "sakanaAi" | "sambanova" | "sarvam" | "scaleway" | "siliconflow" | "stackit" | "stepfun" | "subconscious" | "subq" | "synthetic" | "telnyx" | "thinkingMachines" | "tinfoil" | "together" | "umansAi" | "upstage" | "veniceAi" | "vispark" | "vultrInference" | "wafer" | "wandbInference" | "xai" | "xiaomiMimo" | "xor" | "zAi";
1
+ export type CatalogProviderName = "a2agent" | "abliteration" | "above-dev" | "ai21" | "aiand" | "aihubmix" | "aionlabs" | "ambient" | "api-route" | "arcee" | "atlas-cloud" | "avian-io" | "baidu-qianfan" | "baseten" | "bee-heossi" | "byteplus-modelark" | "bytez" | "cerebras" | "charm-hyper" | "chutes" | "cloudflare" | "crusoe" | "dashscope" | "deepinfra" | "deepseek" | "empiriolabs" | "featherless-ai" | "fireworks" | "friendli" | "gmicloud" | "gradientai" | "groq" | "hetzner-inference" | "huggingface" | "inception-labs" | "inceptron" | "inco" | "inference-net" | "io-intelligence" | "koscompute" | "laya" | "lemonfox-ai" | "lilac" | "llmtech" | "longcat" | "mancer" | "meta-model-api" | "minimax" | "mistral" | "moark" | "modelscope" | "moonshot-ai" | "morph" | "naver-clova-studio" | "nebius" | "neuralwatt" | "novita" | "openai-decisions" | "ovhcloud" | "parasail" | "pareto-inference" | "perplexity" | "poolside" | "prime-intellect" | "reka" | "runinfra" | "sakana-ai" | "sambanova" | "sarvam" | "scaledown" | "scaleway" | "siliconflow" | "stackit" | "stepfun" | "subconscious" | "subq" | "synthetic" | "telnyx" | "thinking-machines" | "tinfoil" | "together-ai" | "umans-ai" | "upstage" | "venice-ai" | "vispark" | "vultr-inference" | "wafer" | "wandb-inference" | "xai" | "xiaomi-mimo" | "xor" | "z-ai";
2
+ export type CatalogCredentialKey = "a2agent" | "abliteration" | "aboveDev" | "ai21" | "aiand" | "aihubmix" | "aionlabs" | "ambient" | "apiRoute" | "arcee" | "atlasCloud" | "avianIo" | "baiduQianfan" | "baseten" | "beeHeossi" | "byteplusModelark" | "bytez" | "cerebras" | "charmHyper" | "chutes" | "cloudflare" | "crusoe" | "dashscope" | "deepinfra" | "deepseek" | "empiriolabs" | "featherlessAi" | "fireworks" | "friendli" | "gmicloud" | "gradientai" | "groq" | "hetznerInference" | "huggingFace" | "inceptionLabs" | "inceptron" | "inco" | "inferenceNet" | "ioIntelligence" | "koscompute" | "laya" | "lemonfoxAi" | "lilac" | "llmtech" | "longcat" | "mancer" | "metaModelApi" | "minimax" | "mistral" | "moark" | "modelscope" | "moonshotAi" | "morph" | "naverClovaStudio" | "nebius" | "neuralwatt" | "novita" | "openaiDecisions" | "ovhcloud" | "parasail" | "paretoInference" | "perplexity" | "poolside" | "primeIntellect" | "reka" | "runinfra" | "sakanaAi" | "sambanova" | "sarvam" | "scaledown" | "scaleway" | "siliconflow" | "stackit" | "stepfun" | "subconscious" | "subq" | "synthetic" | "telnyx" | "thinkingMachines" | "tinfoil" | "together" | "umansAi" | "upstage" | "veniceAi" | "vispark" | "vultrInference" | "wafer" | "wandbInference" | "xai" | "xiaomiMimo" | "xor" | "zAi";
@@ -469,6 +469,10 @@ export type NeurolinkCredentials = {
469
469
  apiKey?: string;
470
470
  baseURL?: string;
471
471
  };
472
+ scaledown?: {
473
+ apiKey?: string;
474
+ baseURL?: string;
475
+ };
472
476
  scaleway?: {
473
477
  apiKey?: string;
474
478
  baseURL?: string;
@@ -812,6 +812,18 @@ const PRICING = {
812
812
  // name, so a `"gpt-6-luna"` key would price that chat model at this rate.
813
813
  _default: { input: 0.1 / 1_000_000, output: 0 },
814
814
  },
815
+ scaledown: {
816
+ // $0.05 per million input tokens, output free: `output: 0` is a price, not
817
+ // a token count, so do not "correct" it from `usage.output_tokens`. A list
818
+ // price from ScaleDown's launch post and from `usage.cost` in a response,
819
+ // both as reported to this project on 2026-10-15; this project has not
820
+ // priced a call itself. Per ScaleDown's docs each choice option is a
821
+ // separate internal call, so input tokens grow with options times state
822
+ // length (not measured here). Only `_default`: LiteLLM, OpenRouter and
823
+ // openai-compatible search every table by model name, so a `"classify"` key
824
+ // would price an unrelated model at this rate.
825
+ _default: { input: 0.05 / 1_000_000, output: 0 },
826
+ },
815
827
  "cloudflare-clef": {
816
828
  // Workers AI bills Clef per million INPUT tokens ($0.24 for clef, $0.09 for
817
829
  // clef-flash); no output price is listed. `output: 0` is a price, not a token
@@ -2,7 +2,7 @@
2
2
  * Provider-specific token limit utilities
3
3
  * Provides safe maxTokens values based on provider and model capabilities
4
4
  */
5
- import { getRuntimeOutputCeiling } from "../constants/contextWindows.js";
5
+ import { getCatalogOutputCeiling, getRuntimeOutputCeiling, } from "../constants/contextWindows.js";
6
6
  import { bedrockModelIdForLookup, stripBedrockGeoPrefix, } from "../constants/bedrockIdentifiers.js";
7
7
  import { PROVIDER_MAX_TOKENS } from "../core/constants.js";
8
8
  import { logger } from "./logger.js";
@@ -68,6 +68,25 @@ export function getSafeMaxTokens(provider, model, requestedMaxTokens) {
68
68
  // Get provider-specific limits
69
69
  const providerLimits = PROVIDER_MAX_TOKENS[canonicalProvider];
70
70
  if (!providerLimits) {
71
+ // A JSON-catalog provider has no PROVIDER_MAX_TOKENS row, but its catalog
72
+ // entry can declare the model's own output ceiling. Only that per-model
73
+ // value counts: the provider-wide default is a 4096 placeholder for many
74
+ // providers. An over-large request is clamped. Unlike the runtime ceiling
75
+ // above, this ceiling is not injected as a default: an unset request stays
76
+ // unset, because a ceiling-sized default would shrink usable input on
77
+ // total-context backends.
78
+ const catalogCeiling = getCatalogOutputCeiling(provider, model);
79
+ if (catalogCeiling !== undefined) {
80
+ if (requestedMaxTokens === undefined || requestedMaxTokens === null) {
81
+ return undefined;
82
+ }
83
+ if (requestedMaxTokens > catalogCeiling) {
84
+ logger.warn(`Requested maxTokens ${requestedMaxTokens} exceeds the catalog output ceiling ` +
85
+ `of ${catalogCeiling} for ${provider}/${model}. Using ${catalogCeiling} instead.`);
86
+ return catalogCeiling;
87
+ }
88
+ return requestedMaxTokens;
89
+ }
71
90
  logger.warn(`Unknown provider ${provider}, no token limits enforced`);
72
91
  // Explicit undefined/null check so a caller-supplied 0 is preserved
73
92
  // (truthy guard would silently drop 0 here as it does in the restricted branch).