@juspay/neurolink 12.2.6 → 12.3.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.
- package/CHANGELOG.md +3 -3
- package/README.md +1 -0
- package/dist/adapters/providerImageAdapter.js +3 -0
- package/dist/browser/neurolink.min.js +364 -364
- package/dist/cli/commands/setup.js +2 -1
- package/dist/constants/contextWindows.js +11 -0
- package/dist/constants/enums.d.ts +26 -0
- package/dist/constants/enums.js +27 -0
- package/dist/factories/providerDescriptors.js +16 -1
- package/dist/models/manifestRegistry.js +2 -0
- package/dist/models/manifests/sambanova.d.ts +11 -0
- package/dist/models/manifests/sambanova.js +42 -0
- package/dist/providers/openaiChatCompletionsClient.d.ts +1 -1
- package/dist/providers/openaiChatCompletionsClient.js +20 -3
- package/dist/providers/openaiCompatCatalog.d.ts +1 -1
- package/dist/providers/openaiCompatCatalog.js +43 -3
- package/dist/types/providers.d.ts +4 -0
- package/dist/utils/modelChoices.js +29 -1
- package/dist/utils/pricing.js +16 -0
- package/dist/utils/providerConfig.d.ts +1 -0
- package/dist/utils/providerConfig.js +14 -0
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ import { handleGCPSetup } from "./setup-gcp.js";
|
|
|
20
20
|
import { handleHuggingFaceSetup } from "./setup-huggingface.js";
|
|
21
21
|
import { handleMistralSetup } from "./setup-mistral.js";
|
|
22
22
|
import { PROVIDER_DESCRIPTORS_BY_NAME } from "../../factories/providerDescriptors.js";
|
|
23
|
-
import { createCloudflareConfig, createCohereConfig, createDeepSeekConfig, createFireworksConfig, createCerebrasConfig, createGroqConfig, createIdeogramConfig, createJinaConfig, createNvidiaNimConfig, createOpenAICompatibleConfig, createPerplexityConfig, createRecraftConfig, createReplicateConfig, createStabilityConfig, createTogetherAIConfig, createVoyageConfig, createXaiConfig, satisfiesFallbacks, } from "../../utils/providerConfig.js";
|
|
23
|
+
import { createCloudflareConfig, createCohereConfig, createDeepSeekConfig, createFireworksConfig, createCerebrasConfig, createSambanovaConfig, createGroqConfig, createIdeogramConfig, createJinaConfig, createNvidiaNimConfig, createOpenAICompatibleConfig, createPerplexityConfig, createRecraftConfig, createReplicateConfig, createStabilityConfig, createTogetherAIConfig, createVoyageConfig, createXaiConfig, satisfiesFallbacks, } from "../../utils/providerConfig.js";
|
|
24
24
|
// Provider information database
|
|
25
25
|
const PROVIDERS = [
|
|
26
26
|
{
|
|
@@ -158,6 +158,7 @@ export const EXTRA_PROVIDER_CONFIGS = {
|
|
|
158
158
|
xai: createXaiConfig(),
|
|
159
159
|
groq: createGroqConfig(),
|
|
160
160
|
cerebras: createCerebrasConfig(),
|
|
161
|
+
sambanova: createSambanovaConfig(),
|
|
161
162
|
cohere: createCohereConfig(),
|
|
162
163
|
replicate: createReplicateConfig(),
|
|
163
164
|
"together-ai": createTogetherAIConfig(),
|
|
@@ -79,6 +79,17 @@ export const MODEL_CONTEXT_WINDOWS = {
|
|
|
79
79
|
"gpt-oss-120b": 65_536,
|
|
80
80
|
"gemma-4-31b": 65_536,
|
|
81
81
|
},
|
|
82
|
+
// Vendor model-spec page (docs.sambanova.ai, checked 2026-08-27):
|
|
83
|
+
// 128K production mainline, 192K MiniMax-M2.7, 32K DeepSeek-V3.2 preview.
|
|
84
|
+
sambanova: {
|
|
85
|
+
_default: 131_072,
|
|
86
|
+
"Meta-Llama-3.3-70B-Instruct": 131_072,
|
|
87
|
+
"gpt-oss-120b": 131_072,
|
|
88
|
+
"DeepSeek-V3.1": 131_072,
|
|
89
|
+
"DeepSeek-V3.2": 32_768,
|
|
90
|
+
"MiniMax-M2.7": 196_608,
|
|
91
|
+
"gemma-4-31B-it": 131_072,
|
|
92
|
+
},
|
|
82
93
|
cohere: {
|
|
83
94
|
_default: 128_000,
|
|
84
95
|
"command-r-plus": 128_000,
|
|
@@ -22,6 +22,7 @@ export declare enum AIProviderName {
|
|
|
22
22
|
XAI = "xai",
|
|
23
23
|
GROQ = "groq",
|
|
24
24
|
CEREBRAS = "cerebras",
|
|
25
|
+
SAMBANOVA = "sambanova",
|
|
25
26
|
COHERE = "cohere",
|
|
26
27
|
TOGETHER_AI = "together-ai",
|
|
27
28
|
FIREWORKS = "fireworks",
|
|
@@ -766,6 +767,31 @@ export declare enum CerebrasModels {
|
|
|
766
767
|
/** Google Gemma 4 31B */
|
|
767
768
|
GEMMA_4_31B = "gemma-4-31b"
|
|
768
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* SambaNova Cloud models (RDU-accelerated, OpenAI-compatible API).
|
|
772
|
+
* @see https://docs.sambanova.ai
|
|
773
|
+
*
|
|
774
|
+
* Roster verified against a live authenticated `/v1/models` on 2026-08-27
|
|
775
|
+
* (exact ids — note the vendor's mixed casing). DeepSeek-V3.2 and
|
|
776
|
+
* gemma-4-31B-it are vendor "preview" models (limited capacity, may be
|
|
777
|
+
* removed at short notice); the rest are production.
|
|
778
|
+
*/
|
|
779
|
+
export declare enum SambanovaModels {
|
|
780
|
+
/** Meta Llama 3.3 70B Instruct — production default, 128K context */
|
|
781
|
+
META_LLAMA_3_3_70B_INSTRUCT = "Meta-Llama-3.3-70B-Instruct",
|
|
782
|
+
/** OpenAI GPT-OSS 120B (open-weight), 128K context */
|
|
783
|
+
GPT_OSS_120B = "gpt-oss-120b",
|
|
784
|
+
/** DeepSeek V3.1 (reasoning), 128K context */
|
|
785
|
+
DEEPSEEK_V3_1 = "DeepSeek-V3.1",
|
|
786
|
+
/** DeepSeek V3.2 (reasoning, vendor preview), 32K context */
|
|
787
|
+
DEEPSEEK_V3_2 = "DeepSeek-V3.2",
|
|
788
|
+
/** MiniMax M2.7, 192K context */
|
|
789
|
+
MINIMAX_M2_7 = "MiniMax-M2.7",
|
|
790
|
+
/** MiniMax M3 (vision per vendor dashboard) */
|
|
791
|
+
MINIMAX_M3 = "MiniMax-M3",
|
|
792
|
+
/** Google Gemma 4 31B IT (vision: text+image+video, vendor preview), 128K context */
|
|
793
|
+
GEMMA_4_31B_IT = "gemma-4-31B-it"
|
|
794
|
+
}
|
|
769
795
|
/**
|
|
770
796
|
* Cohere Command + Embed models.
|
|
771
797
|
* @see https://docs.cohere.com/docs/models
|
package/dist/constants/enums.js
CHANGED
|
@@ -26,6 +26,7 @@ export var AIProviderName;
|
|
|
26
26
|
AIProviderName["XAI"] = "xai";
|
|
27
27
|
AIProviderName["GROQ"] = "groq";
|
|
28
28
|
AIProviderName["CEREBRAS"] = "cerebras";
|
|
29
|
+
AIProviderName["SAMBANOVA"] = "sambanova";
|
|
29
30
|
AIProviderName["COHERE"] = "cohere";
|
|
30
31
|
AIProviderName["TOGETHER_AI"] = "together-ai";
|
|
31
32
|
AIProviderName["FIREWORKS"] = "fireworks";
|
|
@@ -1020,6 +1021,32 @@ export var CerebrasModels;
|
|
|
1020
1021
|
/** Google Gemma 4 31B */
|
|
1021
1022
|
CerebrasModels["GEMMA_4_31B"] = "gemma-4-31b";
|
|
1022
1023
|
})(CerebrasModels || (CerebrasModels = {}));
|
|
1024
|
+
/**
|
|
1025
|
+
* SambaNova Cloud models (RDU-accelerated, OpenAI-compatible API).
|
|
1026
|
+
* @see https://docs.sambanova.ai
|
|
1027
|
+
*
|
|
1028
|
+
* Roster verified against a live authenticated `/v1/models` on 2026-08-27
|
|
1029
|
+
* (exact ids — note the vendor's mixed casing). DeepSeek-V3.2 and
|
|
1030
|
+
* gemma-4-31B-it are vendor "preview" models (limited capacity, may be
|
|
1031
|
+
* removed at short notice); the rest are production.
|
|
1032
|
+
*/
|
|
1033
|
+
export var SambanovaModels;
|
|
1034
|
+
(function (SambanovaModels) {
|
|
1035
|
+
/** Meta Llama 3.3 70B Instruct — production default, 128K context */
|
|
1036
|
+
SambanovaModels["META_LLAMA_3_3_70B_INSTRUCT"] = "Meta-Llama-3.3-70B-Instruct";
|
|
1037
|
+
/** OpenAI GPT-OSS 120B (open-weight), 128K context */
|
|
1038
|
+
SambanovaModels["GPT_OSS_120B"] = "gpt-oss-120b";
|
|
1039
|
+
/** DeepSeek V3.1 (reasoning), 128K context */
|
|
1040
|
+
SambanovaModels["DEEPSEEK_V3_1"] = "DeepSeek-V3.1";
|
|
1041
|
+
/** DeepSeek V3.2 (reasoning, vendor preview), 32K context */
|
|
1042
|
+
SambanovaModels["DEEPSEEK_V3_2"] = "DeepSeek-V3.2";
|
|
1043
|
+
/** MiniMax M2.7, 192K context */
|
|
1044
|
+
SambanovaModels["MINIMAX_M2_7"] = "MiniMax-M2.7";
|
|
1045
|
+
/** MiniMax M3 (vision per vendor dashboard) */
|
|
1046
|
+
SambanovaModels["MINIMAX_M3"] = "MiniMax-M3";
|
|
1047
|
+
/** Google Gemma 4 31B IT (vision: text+image+video, vendor preview), 128K context */
|
|
1048
|
+
SambanovaModels["GEMMA_4_31B_IT"] = "gemma-4-31B-it";
|
|
1049
|
+
})(SambanovaModels || (SambanovaModels = {}));
|
|
1023
1050
|
/**
|
|
1024
1051
|
* Cohere Command + Embed models.
|
|
1025
1052
|
* @see https://docs.cohere.com/docs/models
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AIProviderName } from "../constants/enums.js";
|
|
2
|
-
import { GoogleAIModels, OpenAIModels, AnthropicModels, VertexModels, MistralModels, OllamaModels, LiteLLMModels, HuggingFaceModels, DeepSeekModels, NvidiaNimModels, OpenRouterModels, XaiModels, GroqModels, CerebrasModels, CohereModels, TogetherAIModels, FireworksModels, PerplexityModels, CloudflareModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
|
|
2
|
+
import { GoogleAIModels, OpenAIModels, AnthropicModels, VertexModels, MistralModels, OllamaModels, LiteLLMModels, HuggingFaceModels, DeepSeekModels, NvidiaNimModels, OpenRouterModels, XaiModels, GroqModels, CerebrasModels, SambanovaModels, CohereModels, TogetherAIModels, FireworksModels, PerplexityModels, CloudflareModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
|
|
3
3
|
import { API_KEY_FORMATS } from "../utils/providerConfig.js";
|
|
4
4
|
/**
|
|
5
5
|
* Single source of truth for provider identity, credentials, defaults, and
|
|
@@ -368,6 +368,21 @@ export const PROVIDER_DESCRIPTORS = [
|
|
|
368
368
|
healthCheck: "env-only",
|
|
369
369
|
setupUrl: "https://console.x.ai/",
|
|
370
370
|
},
|
|
371
|
+
{
|
|
372
|
+
name: AIProviderName.SAMBANOVA,
|
|
373
|
+
aliases: [],
|
|
374
|
+
credentialsKey: "sambanova",
|
|
375
|
+
envVars: {
|
|
376
|
+
apiKey: "SAMBANOVA_API_KEY",
|
|
377
|
+
baseURL: "SAMBANOVA_BASE_URL",
|
|
378
|
+
model: "SAMBANOVA_MODEL",
|
|
379
|
+
},
|
|
380
|
+
defaultModel: SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
|
|
381
|
+
toolSupport: "native",
|
|
382
|
+
localRuntime: false,
|
|
383
|
+
healthCheck: "env-only",
|
|
384
|
+
setupUrl: "https://cloud.sambanova.ai/apis",
|
|
385
|
+
},
|
|
371
386
|
{
|
|
372
387
|
name: AIProviderName.CEREBRAS,
|
|
373
388
|
aliases: [],
|
|
@@ -19,6 +19,7 @@ import { llamacppManifest } from "./manifests/llamacpp.js";
|
|
|
19
19
|
import { xaiManifest } from "./manifests/xai.js";
|
|
20
20
|
import { groqManifest } from "./manifests/groq.js";
|
|
21
21
|
import { cerebrasManifest } from "./manifests/cerebras.js";
|
|
22
|
+
import { sambanovaManifest } from "./manifests/sambanova.js";
|
|
22
23
|
import { cohereManifest } from "./manifests/cohere.js";
|
|
23
24
|
import { togetherAiManifest } from "./manifests/together-ai.js";
|
|
24
25
|
import { fireworksManifest } from "./manifests/fireworks.js";
|
|
@@ -58,6 +59,7 @@ export const MANIFEST_REGISTRY = {
|
|
|
58
59
|
xai: xaiManifest,
|
|
59
60
|
groq: groqManifest,
|
|
60
61
|
cerebras: cerebrasManifest,
|
|
62
|
+
sambanova: sambanovaManifest,
|
|
61
63
|
cohere: cohereManifest,
|
|
62
64
|
"together-ai": togetherAiManifest,
|
|
63
65
|
fireworks: fireworksManifest,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProviderModelManifest } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Context windows from the vendor's SambaCloud model specifications page
|
|
4
|
+
* (docs.sambanova.ai, checked 2026-08-27): 128K on the production mainline
|
|
5
|
+
* (Meta-Llama-3.3-70B-Instruct, gpt-oss-120b, DeepSeek-V3.1), 192K on
|
|
6
|
+
* MiniMax-M2.7, 32K on the DeepSeek-V3.2 preview. Max output is not
|
|
7
|
+
* published — the 8192 floor stays deliberately conservative, same
|
|
8
|
+
* pattern as groq.ts/cerebras.ts. gemma-4-31B-it is the one vision model
|
|
9
|
+
* (text+image+video per the vendor page).
|
|
10
|
+
*/
|
|
11
|
+
export declare const sambanovaManifest: ProviderModelManifest;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context windows from the vendor's SambaCloud model specifications page
|
|
3
|
+
* (docs.sambanova.ai, checked 2026-08-27): 128K on the production mainline
|
|
4
|
+
* (Meta-Llama-3.3-70B-Instruct, gpt-oss-120b, DeepSeek-V3.1), 192K on
|
|
5
|
+
* MiniMax-M2.7, 32K on the DeepSeek-V3.2 preview. Max output is not
|
|
6
|
+
* published — the 8192 floor stays deliberately conservative, same
|
|
7
|
+
* pattern as groq.ts/cerebras.ts. gemma-4-31B-it is the one vision model
|
|
8
|
+
* (text+image+video per the vendor page).
|
|
9
|
+
*/
|
|
10
|
+
export const sambanovaManifest = {
|
|
11
|
+
defaultContextWindow: 131072,
|
|
12
|
+
models: {
|
|
13
|
+
_default: {
|
|
14
|
+
aliases: [],
|
|
15
|
+
contextWindow: 131072,
|
|
16
|
+
maxOutputTokens: 8192,
|
|
17
|
+
vision: false,
|
|
18
|
+
functionCalling: true,
|
|
19
|
+
},
|
|
20
|
+
"MiniMax-M2.7": {
|
|
21
|
+
aliases: [],
|
|
22
|
+
contextWindow: 196608,
|
|
23
|
+
maxOutputTokens: 8192,
|
|
24
|
+
vision: false,
|
|
25
|
+
functionCalling: true,
|
|
26
|
+
},
|
|
27
|
+
"DeepSeek-V3.2": {
|
|
28
|
+
aliases: [],
|
|
29
|
+
contextWindow: 32768,
|
|
30
|
+
maxOutputTokens: 8192,
|
|
31
|
+
vision: false,
|
|
32
|
+
functionCalling: true,
|
|
33
|
+
},
|
|
34
|
+
"gemma-4-31B-it": {
|
|
35
|
+
aliases: [],
|
|
36
|
+
contextWindow: 131072,
|
|
37
|
+
maxOutputTokens: 8192,
|
|
38
|
+
vision: true,
|
|
39
|
+
functionCalling: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -42,7 +42,7 @@ export declare const estimateWireTokens: (messages: ReadonlyArray<OpenAICompatCh
|
|
|
42
42
|
export declare const safeStringify: (value: unknown) => string;
|
|
43
43
|
export declare const stringifyToolInput: (input: unknown) => string;
|
|
44
44
|
export declare const stringifyToolOutput: (output: unknown) => string;
|
|
45
|
-
export declare const imageDataToURL: (data: unknown) => string | undefined;
|
|
45
|
+
export declare const imageDataToURL: (data: unknown, mediaType?: string) => string | undefined;
|
|
46
46
|
export declare const convertContentForOpenAI: (content: unknown) => string | OpenAICompatMessageContent[];
|
|
47
47
|
export declare const messageBuilderToOpenAI: (messages: ReadonlyArray<OpenAICompatMessage>, toolNameToWire?: Map<string, string>) => OpenAICompatChatMessage[];
|
|
48
48
|
export declare const buildToolsForOpenAI: (tools: Record<string, Tool>, toolNameToWire?: Map<string, string>) => OpenAICompatChatTool[] | undefined;
|
|
@@ -150,18 +150,19 @@ export const stringifyToolOutput = (output) => {
|
|
|
150
150
|
return safeStringify(output);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
export const imageDataToURL = (data) => {
|
|
153
|
+
export const imageDataToURL = (data, mediaType) => {
|
|
154
|
+
const mime = mediaType && mediaType.includes("/") ? mediaType : "image/png";
|
|
154
155
|
if (typeof data === "string") {
|
|
155
156
|
if (data.startsWith("data:") || /^https?:\/\//i.test(data)) {
|
|
156
157
|
return data;
|
|
157
158
|
}
|
|
158
|
-
return `data
|
|
159
|
+
return `data:${mime};base64,${data}`;
|
|
159
160
|
}
|
|
160
161
|
if (data instanceof URL) {
|
|
161
162
|
return data.toString();
|
|
162
163
|
}
|
|
163
164
|
if (data instanceof Uint8Array) {
|
|
164
|
-
return `data
|
|
165
|
+
return `data:${mime};base64,${Buffer.from(data).toString("base64")}`;
|
|
165
166
|
}
|
|
166
167
|
return undefined;
|
|
167
168
|
};
|
|
@@ -197,6 +198,22 @@ export const convertContentForOpenAI = (content) => {
|
|
|
197
198
|
out.push({ type: "image_url", image_url: { url } });
|
|
198
199
|
}
|
|
199
200
|
}
|
|
201
|
+
else if (p.type === "file") {
|
|
202
|
+
// ai@6 delivers images as FILE parts ({type:"file", mediaType, data}),
|
|
203
|
+
// not "image" parts. The hand-rolled client that replaced
|
|
204
|
+
// @ai-sdk/openai-compatible only handled "image"/"image_url", so every
|
|
205
|
+
// image reaching a catalog provider was silently dropped — the wire
|
|
206
|
+
// carried a text-only message (found live on sambanova/gemma-4-31B-it,
|
|
207
|
+
// 2026-08-28; affected xai vision too). Non-image file parts are still
|
|
208
|
+
// skipped: the OpenAI chat wire format has no generic file slot.
|
|
209
|
+
const fp = part;
|
|
210
|
+
if (fp.mediaType?.startsWith("image/")) {
|
|
211
|
+
const url = imageDataToURL(fp.data, fp.mediaType);
|
|
212
|
+
if (url) {
|
|
213
|
+
out.push({ type: "image_url", image_url: { url } });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
200
217
|
}
|
|
201
218
|
if (out.length === 1 && out[0].type === "text") {
|
|
202
219
|
return out[0].text;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenAICompatCatalogEntry } from "../types/index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Config-driven catalog of the
|
|
3
|
+
* Config-driven catalog of the 9 zero-quirk OpenAI-compatible providers.
|
|
4
4
|
* Each entry fully replaces what used to be a hand-written
|
|
5
5
|
* OpenAIChatCompletionsProvider subclass — see ConfiguredOpenAICompatProvider
|
|
6
6
|
* for the class that reads these entries, and providerRegistry.ts for the
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AIProviderName } from "../constants/enums.js";
|
|
2
|
-
import { CerebrasModels, CloudflareModels, FireworksModels, GroqModels, MistralModels, PerplexityModels, TogetherAIModels, XaiModels, } from "../constants/enums.js";
|
|
2
|
+
import { CerebrasModels, SambanovaModels, CloudflareModels, FireworksModels, GroqModels, MistralModels, PerplexityModels, TogetherAIModels, XaiModels, } from "../constants/enums.js";
|
|
3
3
|
import { AuthenticationError, InvalidModelError, ProviderError, } from "../types/index.js";
|
|
4
4
|
import { DEFAULT_ERROR_RULES } from "../utils/errorClassifier.js";
|
|
5
|
-
import { createCerebrasConfig, createCloudflareConfig, createFireworksConfig, createGroqConfig, createMistralConfig, createPerplexityConfig, createTogetherAIConfig, createXaiConfig, } from "../utils/providerConfig.js";
|
|
5
|
+
import { createCerebrasConfig, createSambanovaConfig, createCloudflareConfig, createFireworksConfig, createGroqConfig, createMistralConfig, createPerplexityConfig, createTogetherAIConfig, createXaiConfig, } from "../utils/providerConfig.js";
|
|
6
6
|
function buildCloudflareBaseURL(accountId) {
|
|
7
7
|
return `https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/v1`;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Config-driven catalog of the
|
|
10
|
+
* Config-driven catalog of the 9 zero-quirk OpenAI-compatible providers.
|
|
11
11
|
* Each entry fully replaces what used to be a hand-written
|
|
12
12
|
* OpenAIChatCompletionsProvider subclass — see ConfiguredOpenAICompatProvider
|
|
13
13
|
* for the class that reads these entries, and providerRegistry.ts for the
|
|
@@ -29,6 +29,46 @@ function buildCloudflareBaseURL(accountId) {
|
|
|
29
29
|
* Task 14's docs task for the deciding criteria).
|
|
30
30
|
*/
|
|
31
31
|
export const OPENAI_COMPAT_CATALOG = [
|
|
32
|
+
{
|
|
33
|
+
providerName: AIProviderName.SAMBANOVA,
|
|
34
|
+
aliases: ["sambanova"],
|
|
35
|
+
apiKeyEnvVar: "SAMBANOVA_API_KEY",
|
|
36
|
+
baseURLEnvVar: "SAMBANOVA_BASE_URL",
|
|
37
|
+
defaultBaseURL: "https://api.sambanova.ai/v1",
|
|
38
|
+
configOptions: createSambanovaConfig(),
|
|
39
|
+
modelEnvVar: "SAMBANOVA_MODEL",
|
|
40
|
+
defaultModel: SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
|
|
41
|
+
registryDefaultModel: SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
|
|
42
|
+
registryDefaultModelChecksEnvVar: true,
|
|
43
|
+
fallbackModelName: SambanovaModels.GPT_OSS_120B,
|
|
44
|
+
fallbackModels: [
|
|
45
|
+
SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
|
|
46
|
+
SambanovaModels.GPT_OSS_120B,
|
|
47
|
+
],
|
|
48
|
+
errorRules: [
|
|
49
|
+
{
|
|
50
|
+
// Probed live 2026-08-27: a bad key gets HTTP 401 with an
|
|
51
|
+
// OpenAI-shaped body {"error":{"message":"Incorrect API key
|
|
52
|
+
// provided: ...","type":"authentication_error","code":
|
|
53
|
+
// "invalid_api_key"}}.
|
|
54
|
+
match: (ctx) => ctx.statusCode === 401 ||
|
|
55
|
+
/invalid_api_key|Incorrect API key|authentication_error/i.test(ctx.message),
|
|
56
|
+
errorClass: AuthenticationError,
|
|
57
|
+
message: "Invalid SambaNova API key. Check SAMBANOVA_API_KEY. Get one at https://cloud.sambanova.ai/apis",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
// Probed live 2026-08-27: a zero-balance account gets HTTP 402 with
|
|
61
|
+
// {"error":{"balance_units":0,"code":"PAYMENT_METHOD_REQUIRED",
|
|
62
|
+
// "billing_portal_url":"https://cloud.sambanova.ai/plans/billing"}}.
|
|
63
|
+
// New accounts have NO free allowance — credits must be purchased.
|
|
64
|
+
match: (ctx) => ctx.statusCode === 402 ||
|
|
65
|
+
/PAYMENT_METHOD_REQUIRED|balance_units/i.test(ctx.message),
|
|
66
|
+
errorClass: ProviderError,
|
|
67
|
+
message: "SambaNova account has no credits (new accounts have no free allowance). Add a payment method and purchase credits at https://cloud.sambanova.ai/plans/billing",
|
|
68
|
+
},
|
|
69
|
+
...DEFAULT_ERROR_RULES,
|
|
70
|
+
],
|
|
71
|
+
},
|
|
32
72
|
{
|
|
33
73
|
providerName: AIProviderName.CEREBRAS,
|
|
34
74
|
aliases: ["cerebras"],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Centralized model choices for CLI commands
|
|
3
3
|
* Derives choices from model enums to ensure consistency
|
|
4
4
|
*/
|
|
5
|
-
import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, MistralModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, HuggingFaceModels, SageMakerModels, OpenRouterModels, DeepSeekModels, NvidiaNimModels, XaiModels, GroqModels, CerebrasModels, CohereModels, TogetherAIModels, FireworksModels, PerplexityModels, CloudflareModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
|
|
5
|
+
import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, MistralModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, HuggingFaceModels, SageMakerModels, OpenRouterModels, DeepSeekModels, NvidiaNimModels, XaiModels, GroqModels, CerebrasModels, SambanovaModels, CohereModels, TogetherAIModels, FireworksModels, PerplexityModels, CloudflareModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
|
|
6
6
|
/**
|
|
7
7
|
* Top models per provider with descriptions for CLI prompts
|
|
8
8
|
* These are curated lists of the most commonly used/recommended models
|
|
@@ -302,6 +302,33 @@ const TOP_MODELS_CONFIG = {
|
|
|
302
302
|
description: "Mistral 8x7B MoE, 32K context",
|
|
303
303
|
},
|
|
304
304
|
],
|
|
305
|
+
[AIProviderName.SAMBANOVA]: [
|
|
306
|
+
{
|
|
307
|
+
model: SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
|
|
308
|
+
description: "Recommended - Meta Llama 3.3 70B; production, 128K context",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
model: SambanovaModels.GPT_OSS_120B,
|
|
312
|
+
description: "OpenAI GPT-OSS 120B (open-weight)",
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
model: SambanovaModels.DEEPSEEK_V3_1,
|
|
316
|
+
description: "DeepSeek V3.1 (reasoning)",
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
model: SambanovaModels.DEEPSEEK_V3_2,
|
|
320
|
+
description: "DeepSeek V3.2 (reasoning; vendor preview, 32K context)",
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
model: SambanovaModels.MINIMAX_M2_7,
|
|
324
|
+
description: "MiniMax M2.7, 192K context",
|
|
325
|
+
},
|
|
326
|
+
{ model: SambanovaModels.MINIMAX_M3, description: "MiniMax M3 (vision)" },
|
|
327
|
+
{
|
|
328
|
+
model: SambanovaModels.GEMMA_4_31B_IT,
|
|
329
|
+
description: "Google Gemma 4 31B IT (vision; vendor preview)",
|
|
330
|
+
},
|
|
331
|
+
],
|
|
305
332
|
[AIProviderName.CEREBRAS]: [
|
|
306
333
|
{
|
|
307
334
|
model: CerebrasModels.GPT_OSS_120B,
|
|
@@ -550,6 +577,7 @@ const MODEL_ENUMS = {
|
|
|
550
577
|
[AIProviderName.XAI]: XaiModels,
|
|
551
578
|
[AIProviderName.GROQ]: GroqModels,
|
|
552
579
|
[AIProviderName.CEREBRAS]: CerebrasModels,
|
|
580
|
+
[AIProviderName.SAMBANOVA]: SambanovaModels,
|
|
553
581
|
[AIProviderName.COHERE]: CohereModels,
|
|
554
582
|
[AIProviderName.TOGETHER_AI]: TogetherAIModels,
|
|
555
583
|
[AIProviderName.FIREWORKS]: FireworksModels,
|
package/dist/utils/pricing.js
CHANGED
|
@@ -527,6 +527,21 @@ const PRICING = {
|
|
|
527
527
|
"gpt-oss-120b": { input: 0.35 / 1_000_000, output: 0.75 / 1_000_000 },
|
|
528
528
|
"gemma-4-31b": { input: 0.99 / 1_000_000, output: 1.49 / 1_000_000 },
|
|
529
529
|
},
|
|
530
|
+
// cloud.sambanova.ai/plans/pricing, checked 2026-08-27. MiniMax-M2.7
|
|
531
|
+
// also has a $0.06/M cached-input rate the flat model here can't express.
|
|
532
|
+
sambanova: {
|
|
533
|
+
_default: { input: 0.6 / 1_000_000, output: 1.2 / 1_000_000 },
|
|
534
|
+
"Meta-Llama-3.3-70B-Instruct": {
|
|
535
|
+
input: 0.6 / 1_000_000,
|
|
536
|
+
output: 1.2 / 1_000_000,
|
|
537
|
+
},
|
|
538
|
+
"gpt-oss-120b": { input: 0.22 / 1_000_000, output: 0.59 / 1_000_000 },
|
|
539
|
+
"DeepSeek-V3.1": { input: 3.0 / 1_000_000, output: 4.5 / 1_000_000 },
|
|
540
|
+
"DeepSeek-V3.2": { input: 3.0 / 1_000_000, output: 4.5 / 1_000_000 },
|
|
541
|
+
"MiniMax-M2.7": { input: 0.6 / 1_000_000, output: 2.4 / 1_000_000 },
|
|
542
|
+
"MiniMax-M3": { input: 0.6 / 1_000_000, output: 2.4 / 1_000_000 },
|
|
543
|
+
"gemma-4-31B-it": { input: 0.38 / 1_000_000, output: 1.15 / 1_000_000 },
|
|
544
|
+
},
|
|
530
545
|
cohere: {
|
|
531
546
|
_default: { input: 2.5 / 1_000_000, output: 10.0 / 1_000_000 },
|
|
532
547
|
"command-r-plus": { input: 2.5 / 1_000_000, output: 10.0 / 1_000_000 },
|
|
@@ -695,6 +710,7 @@ const PROVIDER_ALIASES = {
|
|
|
695
710
|
grok: "xai",
|
|
696
711
|
groq: "groq",
|
|
697
712
|
cerebras: "cerebras",
|
|
713
|
+
sambanova: "sambanova",
|
|
698
714
|
cohere: "cohere",
|
|
699
715
|
togetherai: "together-ai",
|
|
700
716
|
together: "together-ai",
|
|
@@ -138,6 +138,7 @@ export declare function createXaiConfig(): ProviderConfigOptions;
|
|
|
138
138
|
/**
|
|
139
139
|
* Creates Cerebras provider configuration.
|
|
140
140
|
*/
|
|
141
|
+
export declare function createSambanovaConfig(): ProviderConfigOptions;
|
|
141
142
|
export declare function createCerebrasConfig(): ProviderConfigOptions;
|
|
142
143
|
/**
|
|
143
144
|
* Creates Groq provider configuration.
|
|
@@ -454,6 +454,20 @@ export function createXaiConfig() {
|
|
|
454
454
|
/**
|
|
455
455
|
* Creates Cerebras provider configuration.
|
|
456
456
|
*/
|
|
457
|
+
export function createSambanovaConfig() {
|
|
458
|
+
return {
|
|
459
|
+
providerName: "SambaNova",
|
|
460
|
+
envVarName: "SAMBANOVA_API_KEY",
|
|
461
|
+
setupUrl: "https://cloud.sambanova.ai/apis",
|
|
462
|
+
description: "API key",
|
|
463
|
+
instructions: [
|
|
464
|
+
"1. Visit: https://cloud.sambanova.ai (Google/Microsoft OAuth works)",
|
|
465
|
+
"2. Complete the profile step; note new accounts have NO free allowance — a payment method and purchased credits are required before calls succeed",
|
|
466
|
+
"3. Create an API key under API Keys",
|
|
467
|
+
"4. Set SAMBANOVA_API_KEY in your .env file",
|
|
468
|
+
],
|
|
469
|
+
};
|
|
470
|
+
}
|
|
457
471
|
export function createCerebrasConfig() {
|
|
458
472
|
return {
|
|
459
473
|
providerName: "Cerebras",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.0",
|
|
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": {
|