@jambonz/llm 0.5.5 → 0.5.6

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 CHANGED
@@ -989,6 +989,101 @@ var zaiFactory = {
989
989
  manifest: zaiManifest,
990
990
  create: () => new ZaiAdapter()
991
991
  };
992
+ var xaiManifest = {
993
+ vendor: "xai",
994
+ displayName: "xAI (Grok)",
995
+ authKinds: [
996
+ {
997
+ kind: "apiKey",
998
+ displayName: "API Key",
999
+ fields: [
1000
+ {
1001
+ name: "apiKey",
1002
+ label: "API Key",
1003
+ type: "password",
1004
+ required: true,
1005
+ help: "Get an API key from https://console.x.ai/team/default/api-keys"
1006
+ },
1007
+ {
1008
+ name: "baseURL",
1009
+ label: "Base URL",
1010
+ type: "url",
1011
+ required: false,
1012
+ default: "https://api.x.ai/v1",
1013
+ help: "Override for proxy endpoints. Defaults to xAI production."
1014
+ }
1015
+ ]
1016
+ }
1017
+ ],
1018
+ knownModels: [
1019
+ {
1020
+ id: "grok-4.3",
1021
+ displayName: "Grok 4.3",
1022
+ capabilities: {
1023
+ streaming: true,
1024
+ tools: true,
1025
+ vision: true,
1026
+ systemPrompt: true,
1027
+ maxContextTokens: 1e6
1028
+ }
1029
+ },
1030
+ {
1031
+ id: "grok-4.20-0309-reasoning",
1032
+ displayName: "Grok 4.20 (Reasoning)",
1033
+ capabilities: {
1034
+ streaming: true,
1035
+ tools: true,
1036
+ vision: true,
1037
+ systemPrompt: true,
1038
+ maxContextTokens: 1e6
1039
+ }
1040
+ },
1041
+ {
1042
+ id: "grok-4.20-0309-non-reasoning",
1043
+ displayName: "Grok 4.20 (Non-Reasoning)",
1044
+ capabilities: {
1045
+ streaming: true,
1046
+ tools: true,
1047
+ vision: true,
1048
+ systemPrompt: true,
1049
+ maxContextTokens: 1e6
1050
+ }
1051
+ },
1052
+ {
1053
+ id: "grok-4.20-multi-agent-0309",
1054
+ displayName: "Grok 4.20 Multi-Agent",
1055
+ capabilities: {
1056
+ streaming: true,
1057
+ tools: true,
1058
+ vision: true,
1059
+ systemPrompt: true,
1060
+ maxContextTokens: 1e6
1061
+ }
1062
+ }
1063
+ ],
1064
+ supportsModelListing: true,
1065
+ docsUrl: "https://docs.x.ai/"
1066
+ };
1067
+ var XaiAdapter = class extends OpenAIAdapter {
1068
+ vendor = xaiManifest.vendor;
1069
+ init(auth, client) {
1070
+ super.init(
1071
+ {
1072
+ ...auth,
1073
+ baseURL: auth.baseURL ?? "https://api.x.ai/v1"
1074
+ },
1075
+ client
1076
+ );
1077
+ }
1078
+ knownModels() {
1079
+ return xaiManifest.knownModels;
1080
+ }
1081
+ };
1082
+ var xaiFactory = {
1083
+ vendor: xaiManifest.vendor,
1084
+ manifest: xaiManifest,
1085
+ create: () => new XaiAdapter()
1086
+ };
992
1087
 
993
1088
  // src/adapters/anthropic/adapter.ts
994
1089
  var import_sdk = __toESM(require("@anthropic-ai/sdk"), 1);
@@ -3164,6 +3259,7 @@ registerAdapter(deepseekFactory);
3164
3259
  registerAdapter(basetenFactory);
3165
3260
  registerAdapter(moonshotFactory);
3166
3261
  registerAdapter(zaiFactory);
3262
+ registerAdapter(xaiFactory);
3167
3263
  registerAdapter(anthropicFactory);
3168
3264
  registerAdapter(googleFactory);
3169
3265
  registerAdapter(vertexGeminiFactory);
@@ -3182,6 +3278,7 @@ function normalizeAuth(vendor, raw) {
3182
3278
  case "huggingface":
3183
3279
  case "moonshot":
3184
3280
  case "zai":
3281
+ case "xai":
3185
3282
  return requireApiKey(vendor, raw);
3186
3283
  case "deepseek":
3187
3284
  return {