@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.cjs
CHANGED
|
@@ -1134,6 +1134,116 @@ var xaiFactory = {
|
|
|
1134
1134
|
manifest: xaiManifest,
|
|
1135
1135
|
create: () => new XaiAdapter()
|
|
1136
1136
|
};
|
|
1137
|
+
var BEDROCK_MANTLE_DEFAULT_BASE_URL = "https://bedrock-mantle.us-east-1.api.aws/v1";
|
|
1138
|
+
var bedrockMantleManifest = {
|
|
1139
|
+
vendor: "bedrock-mantle",
|
|
1140
|
+
displayName: "AWS Bedrock (OpenAI-compatible)",
|
|
1141
|
+
authKinds: [
|
|
1142
|
+
{
|
|
1143
|
+
kind: "apiKey",
|
|
1144
|
+
displayName: "API Key",
|
|
1145
|
+
fields: [
|
|
1146
|
+
{
|
|
1147
|
+
name: "apiKey",
|
|
1148
|
+
label: "Bedrock API Key",
|
|
1149
|
+
type: "password",
|
|
1150
|
+
required: true,
|
|
1151
|
+
help: "Generate a long-term Bedrock API key in the AWS console (Amazon Bedrock \u2192 API keys)."
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
name: "baseURL",
|
|
1155
|
+
label: "Base URL",
|
|
1156
|
+
type: "url",
|
|
1157
|
+
required: false,
|
|
1158
|
+
default: BEDROCK_MANTLE_DEFAULT_BASE_URL,
|
|
1159
|
+
help: "Change the region to match your key. xAI models are served only on the /openai/v1 path."
|
|
1160
|
+
}
|
|
1161
|
+
]
|
|
1162
|
+
}
|
|
1163
|
+
],
|
|
1164
|
+
/* A convenience seed, NOT the source of truth: the live `/v1/models`
|
|
1165
|
+
* endpoint is authoritative and grows continuously, which is why
|
|
1166
|
+
* `supportsModelListing` is true. Any model the endpoint lists can be used
|
|
1167
|
+
* by id without appearing here.
|
|
1168
|
+
*
|
|
1169
|
+
* AWS publishes no context-window metadata (neither `/v1/models` nor
|
|
1170
|
+
* `GetFoundationModel` returns it), so these limits are carried over from
|
|
1171
|
+
* the native-vendor manifests above for the same underlying models. Vision
|
|
1172
|
+
* follows Bedrock's `inputModalities`. */
|
|
1173
|
+
knownModels: [
|
|
1174
|
+
{
|
|
1175
|
+
id: "zai.glm-5",
|
|
1176
|
+
displayName: "GLM 5",
|
|
1177
|
+
capabilities: {
|
|
1178
|
+
streaming: true,
|
|
1179
|
+
tools: true,
|
|
1180
|
+
vision: false,
|
|
1181
|
+
systemPrompt: true,
|
|
1182
|
+
maxContextTokens: 202800
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
id: "zai.glm-4.7",
|
|
1187
|
+
displayName: "GLM 4.7",
|
|
1188
|
+
capabilities: {
|
|
1189
|
+
streaming: true,
|
|
1190
|
+
tools: true,
|
|
1191
|
+
vision: false,
|
|
1192
|
+
systemPrompt: true,
|
|
1193
|
+
maxContextTokens: 2e5
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
id: "moonshotai.kimi-k2.5",
|
|
1198
|
+
displayName: "Kimi K2.5",
|
|
1199
|
+
capabilities: {
|
|
1200
|
+
streaming: true,
|
|
1201
|
+
tools: true,
|
|
1202
|
+
vision: true,
|
|
1203
|
+
systemPrompt: true,
|
|
1204
|
+
maxContextTokens: 262144
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
id: "xai.grok-4.3",
|
|
1209
|
+
displayName: "Grok 4.3",
|
|
1210
|
+
capabilities: {
|
|
1211
|
+
streaming: true,
|
|
1212
|
+
tools: true,
|
|
1213
|
+
vision: true,
|
|
1214
|
+
systemPrompt: true,
|
|
1215
|
+
maxContextTokens: 1e6
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
],
|
|
1219
|
+
supportsModelListing: true,
|
|
1220
|
+
docsUrl: "https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html"
|
|
1221
|
+
};
|
|
1222
|
+
var BedrockMantleAdapter = class extends OpenAIAdapter {
|
|
1223
|
+
vendor = bedrockMantleManifest.vendor;
|
|
1224
|
+
init(auth, client) {
|
|
1225
|
+
super.init(
|
|
1226
|
+
{
|
|
1227
|
+
...auth,
|
|
1228
|
+
baseURL: auth.baseURL ?? BEDROCK_MANTLE_DEFAULT_BASE_URL
|
|
1229
|
+
},
|
|
1230
|
+
client
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
knownModels() {
|
|
1234
|
+
return bedrockMantleManifest.knownModels;
|
|
1235
|
+
}
|
|
1236
|
+
// Mantle fronts many third-party runtimes with differing param strictness,
|
|
1237
|
+
// and prompt_cache_key is unverified against all of them — do not forward.
|
|
1238
|
+
forwardCacheKey() {
|
|
1239
|
+
return false;
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1242
|
+
var bedrockMantleFactory = {
|
|
1243
|
+
vendor: bedrockMantleManifest.vendor,
|
|
1244
|
+
manifest: bedrockMantleManifest,
|
|
1245
|
+
create: () => new BedrockMantleAdapter()
|
|
1246
|
+
};
|
|
1137
1247
|
|
|
1138
1248
|
// src/adapters/anthropic/adapter.ts
|
|
1139
1249
|
var import_sdk = __toESM(require("@anthropic-ai/sdk"), 1);
|
|
@@ -3454,6 +3564,7 @@ registerAdapter(basetenFactory);
|
|
|
3454
3564
|
registerAdapter(moonshotFactory);
|
|
3455
3565
|
registerAdapter(zaiFactory);
|
|
3456
3566
|
registerAdapter(xaiFactory);
|
|
3567
|
+
registerAdapter(bedrockMantleFactory);
|
|
3457
3568
|
registerAdapter(anthropicFactory);
|
|
3458
3569
|
registerAdapter(googleFactory);
|
|
3459
3570
|
registerAdapter(vertexGeminiFactory);
|
|
@@ -3473,6 +3584,7 @@ function normalizeAuth(vendor, raw) {
|
|
|
3473
3584
|
case "moonshot":
|
|
3474
3585
|
case "zai":
|
|
3475
3586
|
case "xai":
|
|
3587
|
+
case "bedrock-mantle":
|
|
3476
3588
|
return requireApiKey(vendor, raw);
|
|
3477
3589
|
case "deepseek":
|
|
3478
3590
|
return {
|