@jambonz/llm 0.6.1 → 0.6.2
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/dist/index.cjs +112 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +111 -0
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +111 -0
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -31,9 +31,10 @@ interface RawCredential {
|
|
|
31
31
|
/**
|
|
32
32
|
* Convert a vendor + raw credential into an `AuthSpec` discriminated union member.
|
|
33
33
|
*
|
|
34
|
-
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai,
|
|
35
|
-
* vertex (alias for vertex-gemini + vertex-openai — both accept
|
|
36
|
-
* vertex-gemini, vertex-openai, bedrock, azure-openai, groq,
|
|
34
|
+
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai, bedrock-mantle,
|
|
35
|
+
* anthropic, google, vertex (alias for vertex-gemini + vertex-openai — both accept
|
|
36
|
+
* the same auth shape), vertex-gemini, vertex-openai, bedrock, azure-openai, groq,
|
|
37
|
+
* huggingface.
|
|
37
38
|
*
|
|
38
39
|
* Throws with a clear message if the raw credential is missing required fields.
|
|
39
40
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -31,9 +31,10 @@ interface RawCredential {
|
|
|
31
31
|
/**
|
|
32
32
|
* Convert a vendor + raw credential into an `AuthSpec` discriminated union member.
|
|
33
33
|
*
|
|
34
|
-
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai,
|
|
35
|
-
* vertex (alias for vertex-gemini + vertex-openai — both accept
|
|
36
|
-
* vertex-gemini, vertex-openai, bedrock, azure-openai, groq,
|
|
34
|
+
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai, bedrock-mantle,
|
|
35
|
+
* anthropic, google, vertex (alias for vertex-gemini + vertex-openai — both accept
|
|
36
|
+
* the same auth shape), vertex-gemini, vertex-openai, bedrock, azure-openai, groq,
|
|
37
|
+
* huggingface.
|
|
37
38
|
*
|
|
38
39
|
* Throws with a clear message if the raw credential is missing required fields.
|
|
39
40
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1089,6 +1089,116 @@ var xaiFactory = {
|
|
|
1089
1089
|
manifest: xaiManifest,
|
|
1090
1090
|
create: () => new XaiAdapter()
|
|
1091
1091
|
};
|
|
1092
|
+
var BEDROCK_MANTLE_DEFAULT_BASE_URL = "https://bedrock-mantle.us-east-1.api.aws/v1";
|
|
1093
|
+
var bedrockMantleManifest = {
|
|
1094
|
+
vendor: "bedrock-mantle",
|
|
1095
|
+
displayName: "AWS Bedrock (OpenAI-compatible)",
|
|
1096
|
+
authKinds: [
|
|
1097
|
+
{
|
|
1098
|
+
kind: "apiKey",
|
|
1099
|
+
displayName: "API Key",
|
|
1100
|
+
fields: [
|
|
1101
|
+
{
|
|
1102
|
+
name: "apiKey",
|
|
1103
|
+
label: "Bedrock API Key",
|
|
1104
|
+
type: "password",
|
|
1105
|
+
required: true,
|
|
1106
|
+
help: "Generate a long-term Bedrock API key in the AWS console (Amazon Bedrock \u2192 API keys)."
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
name: "baseURL",
|
|
1110
|
+
label: "Base URL",
|
|
1111
|
+
type: "url",
|
|
1112
|
+
required: false,
|
|
1113
|
+
default: BEDROCK_MANTLE_DEFAULT_BASE_URL,
|
|
1114
|
+
help: "Change the region to match your key. xAI models are served only on the /openai/v1 path."
|
|
1115
|
+
}
|
|
1116
|
+
]
|
|
1117
|
+
}
|
|
1118
|
+
],
|
|
1119
|
+
/* A convenience seed, NOT the source of truth: the live `/v1/models`
|
|
1120
|
+
* endpoint is authoritative and grows continuously, which is why
|
|
1121
|
+
* `supportsModelListing` is true. Any model the endpoint lists can be used
|
|
1122
|
+
* by id without appearing here.
|
|
1123
|
+
*
|
|
1124
|
+
* AWS publishes no context-window metadata (neither `/v1/models` nor
|
|
1125
|
+
* `GetFoundationModel` returns it), so these limits are carried over from
|
|
1126
|
+
* the native-vendor manifests above for the same underlying models. Vision
|
|
1127
|
+
* follows Bedrock's `inputModalities`. */
|
|
1128
|
+
knownModels: [
|
|
1129
|
+
{
|
|
1130
|
+
id: "zai.glm-5",
|
|
1131
|
+
displayName: "GLM 5",
|
|
1132
|
+
capabilities: {
|
|
1133
|
+
streaming: true,
|
|
1134
|
+
tools: true,
|
|
1135
|
+
vision: false,
|
|
1136
|
+
systemPrompt: true,
|
|
1137
|
+
maxContextTokens: 202800
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
id: "zai.glm-4.7",
|
|
1142
|
+
displayName: "GLM 4.7",
|
|
1143
|
+
capabilities: {
|
|
1144
|
+
streaming: true,
|
|
1145
|
+
tools: true,
|
|
1146
|
+
vision: false,
|
|
1147
|
+
systemPrompt: true,
|
|
1148
|
+
maxContextTokens: 2e5
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
id: "moonshotai.kimi-k2.5",
|
|
1153
|
+
displayName: "Kimi K2.5",
|
|
1154
|
+
capabilities: {
|
|
1155
|
+
streaming: true,
|
|
1156
|
+
tools: true,
|
|
1157
|
+
vision: true,
|
|
1158
|
+
systemPrompt: true,
|
|
1159
|
+
maxContextTokens: 262144
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
id: "xai.grok-4.3",
|
|
1164
|
+
displayName: "Grok 4.3",
|
|
1165
|
+
capabilities: {
|
|
1166
|
+
streaming: true,
|
|
1167
|
+
tools: true,
|
|
1168
|
+
vision: true,
|
|
1169
|
+
systemPrompt: true,
|
|
1170
|
+
maxContextTokens: 1e6
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
],
|
|
1174
|
+
supportsModelListing: true,
|
|
1175
|
+
docsUrl: "https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html"
|
|
1176
|
+
};
|
|
1177
|
+
var BedrockMantleAdapter = class extends OpenAIAdapter {
|
|
1178
|
+
vendor = bedrockMantleManifest.vendor;
|
|
1179
|
+
init(auth, client) {
|
|
1180
|
+
super.init(
|
|
1181
|
+
{
|
|
1182
|
+
...auth,
|
|
1183
|
+
baseURL: auth.baseURL ?? BEDROCK_MANTLE_DEFAULT_BASE_URL
|
|
1184
|
+
},
|
|
1185
|
+
client
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
knownModels() {
|
|
1189
|
+
return bedrockMantleManifest.knownModels;
|
|
1190
|
+
}
|
|
1191
|
+
// Mantle fronts many third-party runtimes with differing param strictness,
|
|
1192
|
+
// and prompt_cache_key is unverified against all of them — do not forward.
|
|
1193
|
+
forwardCacheKey() {
|
|
1194
|
+
return false;
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
var bedrockMantleFactory = {
|
|
1198
|
+
vendor: bedrockMantleManifest.vendor,
|
|
1199
|
+
manifest: bedrockMantleManifest,
|
|
1200
|
+
create: () => new BedrockMantleAdapter()
|
|
1201
|
+
};
|
|
1092
1202
|
|
|
1093
1203
|
// src/adapters/anthropic/adapter.ts
|
|
1094
1204
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -3415,6 +3525,7 @@ registerAdapter(basetenFactory);
|
|
|
3415
3525
|
registerAdapter(moonshotFactory);
|
|
3416
3526
|
registerAdapter(zaiFactory);
|
|
3417
3527
|
registerAdapter(xaiFactory);
|
|
3528
|
+
registerAdapter(bedrockMantleFactory);
|
|
3418
3529
|
registerAdapter(anthropicFactory);
|
|
3419
3530
|
registerAdapter(googleFactory);
|
|
3420
3531
|
registerAdapter(vertexGeminiFactory);
|
|
@@ -3434,6 +3545,7 @@ function normalizeAuth(vendor, raw) {
|
|
|
3434
3545
|
case "moonshot":
|
|
3435
3546
|
case "zai":
|
|
3436
3547
|
case "xai":
|
|
3548
|
+
case "bedrock-mantle":
|
|
3437
3549
|
return requireApiKey(vendor, raw);
|
|
3438
3550
|
case "deepseek":
|
|
3439
3551
|
return {
|