@juspay/neurolink 12.2.2 → 12.2.4

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.
@@ -1930,6 +1930,7 @@ export class CLICommandFactory {
1930
1930
  "llamacpp",
1931
1931
  "xai",
1932
1932
  "groq",
1933
+ "cerebras",
1933
1934
  "cohere",
1934
1935
  "together-ai",
1935
1936
  "fireworks",
@@ -11,6 +11,12 @@ export declare class SetupCommandFactory {
11
11
  * Create the main setup command with all provider subcommands
12
12
  */
13
13
  static createSetupCommands(): CommandModule;
14
+ /**
15
+ * Every AIProviderName that has no dedicated native setup subcommand
16
+ * above — these route through the generic wizard (handleSetup ->
17
+ * delegateToProviderSetup / EXTRA_PROVIDER_CONFIGS).
18
+ */
19
+ private static nonNativeProviderIds;
14
20
  /**
15
21
  * Build common options for provider setup commands
16
22
  */
@@ -2,6 +2,7 @@
2
2
  * Setup Command Factory for NeuroLink
3
3
  * Consolidates all provider setup commands into a unified interface
4
4
  */
5
+ import { AIProviderName } from "../../constants/enums.js";
5
6
  import { handleGCPSetup } from "../commands/setup-gcp.js";
6
7
  import { handleBedrockSetup } from "../commands/setup-bedrock.js";
7
8
  import { handleOpenAISetup } from "../commands/setup-openai.js";
@@ -27,16 +28,18 @@ export class SetupCommandFactory {
27
28
  .positional("provider", {
28
29
  type: "string",
29
30
  description: "Specific provider to set up",
31
+ // Derived from the enum, not hand-listed: the wizard's
32
+ // handleSetup delegates every non-native provider through
33
+ // EXTRA_PROVIDER_CONFIGS, but this hand-hardcoded 9-entry
34
+ // list silently gated `neurolink setup <provider>` to the
35
+ // pre-catalog era — even `setup groq` was rejected here
36
+ // while the wizard behind it supported all 31 providers
37
+ // (found completing the cerebras integration surface).
38
+ // "gcp" stays as the one extra: it's a vertex alias with
39
+ // its own native subcommand below, not an enum member.
30
40
  choices: [
31
- "google-ai",
32
- "openai",
33
- "anthropic",
34
- "azure",
35
- "bedrock",
41
+ ...Object.values(AIProviderName).filter((name) => name !== AIProviderName.AUTO),
36
42
  "gcp",
37
- "vertex",
38
- "huggingface",
39
- "mistral",
40
43
  ],
41
44
  })
42
45
  .option("list", {
@@ -94,6 +97,24 @@ export class SetupCommandFactory {
94
97
  .command("mistral", "Setup Mistral AI configuration", (y) => this.buildProviderOptions(y),
95
98
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
99
  async (argv) => await handleMistralSetup(argv))
100
+ // Every remaining provider becomes a real subcommand routing
101
+ // through the generic wizard (EXTRA_PROVIDER_CONFIGS). A bare
102
+ // positional is not enough: yargs's .recommendCommands()
103
+ // (parser.ts) edit-distance-matches unknown positionals
104
+ // against the subcommand names above and dies with e.g.
105
+ // "Did you mean gcp?" for `setup groq` or `setup xai` before
106
+ // the positional choices are ever consulted. Registering the
107
+ // ids as subcommand aliases (hidden from help — the
108
+ // positional's choices already document the roster there)
109
+ // shadows that recommendation, enum-derived so a new provider
110
+ // can never be silently gated out again (this list was last
111
+ // hand-hardcoded at 9 entries in the pre-catalog era; even
112
+ // `setup groq` was rejected).
113
+ .command(SetupCommandFactory.nonNativeProviderIds(), false, (y) => this.buildProviderOptions(y), async (argv) => await handleSetup({
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ ...argv,
116
+ provider: String(argv._[argv._.length - 1]),
117
+ }))
97
118
  .example("$0 setup", "Interactive setup wizard")
98
119
  .example("$0 setup google-ai", "Setup Google AI Studio")
99
120
  .example("$0 setup openai --check", "Check OpenAI configuration")
@@ -107,6 +128,25 @@ export class SetupCommandFactory {
107
128
  },
108
129
  };
109
130
  }
131
+ /**
132
+ * Every AIProviderName that has no dedicated native setup subcommand
133
+ * above — these route through the generic wizard (handleSetup ->
134
+ * delegateToProviderSetup / EXTRA_PROVIDER_CONFIGS).
135
+ */
136
+ static nonNativeProviderIds() {
137
+ const nativeSetup = new Set([
138
+ "google-ai",
139
+ "openai",
140
+ "anthropic",
141
+ "azure",
142
+ "bedrock",
143
+ "gcp",
144
+ "vertex",
145
+ "huggingface",
146
+ "mistral",
147
+ ]);
148
+ return Object.values(AIProviderName).filter((name) => name !== AIProviderName.AUTO && !nativeSetup.has(name));
149
+ }
110
150
  /**
111
151
  * Build common options for provider setup commands
112
152
  */
@@ -70,6 +70,15 @@ export const MODEL_CONTEXT_WINDOWS = {
70
70
  "gemma2-9b-it": 8_192,
71
71
  "mixtral-8x7b-32768": 32_768,
72
72
  },
73
+ // Free tier serves 65k context per model; paid tiers 131k
74
+ // (inference-docs.cerebras.ai model pages, checked 2026-08-27). The
75
+ // tier isn't knowable from the key, so budget against the free-tier
76
+ // floor — compacting early is safe, overrunning a 65k window is not.
77
+ cerebras: {
78
+ _default: 65_536,
79
+ "gpt-oss-120b": 65_536,
80
+ "gemma-4-31b": 65_536,
81
+ },
73
82
  cohere: {
74
83
  _default: 128_000,
75
84
  "command-r-plus": 128_000,
@@ -114,7 +114,8 @@ export class ProviderRegistry {
114
114
  }, process.env.HUGGINGFACE_MODEL ||
115
115
  HuggingFaceModels.QWEN_2_5_72B_INSTRUCT, ["huggingface", "hf"], PROVIDER_DESCRIPTORS_BY_NAME.get(AIProviderName.HUGGINGFACE));
116
116
  // Register the config-driven OpenAI-compatible catalog providers
117
- // (groq, xai, together-ai, fireworks, perplexity, mistral, cloudflare).
117
+ // (cerebras, groq, xai, together-ai, fireworks, perplexity, mistral,
118
+ // cloudflare).
118
119
  // To add a new zero-quirk OpenAI-compatible provider, add one entry to
119
120
  // OPENAI_COMPAT_CATALOG (openaiCompatCatalog.ts) — not a new block here.
120
121
  for (const entry of OPENAI_COMPAT_CATALOG) {
@@ -10,8 +10,8 @@
10
10
  * - `Authorization: Basic <base64>` (D-ID and similar)
11
11
  * - Bare tokens by known provider prefix:
12
12
  * sk-/pk- (OpenAI, Anthropic, Stability),
13
- * r8_ (Replicate), gsk_ (Groq), xai- (xAI), tgp_ (Together),
14
- * fw_ (Fireworks), pplx- (Perplexity), pa- (Voyage),
13
+ * r8_ (Replicate), gsk_ (Groq), csk- (Cerebras), xai- (xAI),
14
+ * tgp_ (Together), fw_ (Fireworks), pplx- (Perplexity), pa- (Voyage),
15
15
  * jina_ (Jina), fish- (Fish Audio)
16
16
  * - Generic key=value pairs: api_key=…, access_token: …, secret_key=…
17
17
  */
@@ -10,8 +10,8 @@
10
10
  * - `Authorization: Basic <base64>` (D-ID and similar)
11
11
  * - Bare tokens by known provider prefix:
12
12
  * sk-/pk- (OpenAI, Anthropic, Stability),
13
- * r8_ (Replicate), gsk_ (Groq), xai- (xAI), tgp_ (Together),
14
- * fw_ (Fireworks), pplx- (Perplexity), pa- (Voyage),
13
+ * r8_ (Replicate), gsk_ (Groq), csk- (Cerebras), xai- (xAI),
14
+ * tgp_ (Together), fw_ (Fireworks), pplx- (Perplexity), pa- (Voyage),
15
15
  * jina_ (Jina), fish- (Fish Audio)
16
16
  * - Generic key=value pairs: api_key=…, access_token: …, secret_key=…
17
17
  */
@@ -22,6 +22,7 @@ const TOKEN_PREFIXES = [
22
22
  "pk",
23
23
  "r8",
24
24
  "gsk",
25
+ "csk",
25
26
  "xai",
26
27
  "tgp",
27
28
  "fw",
@@ -518,6 +518,15 @@ const PRICING = {
518
518
  output: 0.24 / 1_000_000,
519
519
  },
520
520
  },
521
+ // inference-docs.cerebras.ai model pages, checked 2026-08-27. The
522
+ // gemma-4-31b page's prose and structured data disagree ($2.15/$2.70 vs
523
+ // $0.99/$1.49); the structured data feeds the vendor's rendered pricing
524
+ // card, so it's used here.
525
+ cerebras: {
526
+ _default: { input: 0.35 / 1_000_000, output: 0.75 / 1_000_000 },
527
+ "gpt-oss-120b": { input: 0.35 / 1_000_000, output: 0.75 / 1_000_000 },
528
+ "gemma-4-31b": { input: 0.99 / 1_000_000, output: 1.49 / 1_000_000 },
529
+ },
521
530
  cohere: {
522
531
  _default: { input: 2.5 / 1_000_000, output: 10.0 / 1_000_000 },
523
532
  "command-r-plus": { input: 2.5 / 1_000_000, output: 10.0 / 1_000_000 },
@@ -685,6 +694,7 @@ const PROVIDER_ALIASES = {
685
694
  xai: "xai",
686
695
  grok: "xai",
687
696
  groq: "groq",
697
+ cerebras: "cerebras",
688
698
  cohere: "cohere",
689
699
  togetherai: "together-ai",
690
700
  together: "together-ai",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.2.2",
3
+ "version": "12.2.4",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
6
6
  "author": {