llm-strings 1.0.1 → 1.1.1
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/README.md +95 -14
- package/dist/chunk-FCEV23OT.js +37 -0
- package/dist/chunk-FCEV23OT.js.map +1 -0
- package/dist/chunk-MGWGNZDJ.cjs +116 -0
- package/dist/chunk-MGWGNZDJ.cjs.map +1 -0
- package/dist/chunk-MPIHGH6L.js +116 -0
- package/dist/chunk-MPIHGH6L.js.map +1 -0
- package/dist/chunk-N6NVBE43.cjs +37 -0
- package/dist/chunk-N6NVBE43.cjs.map +1 -0
- package/dist/chunk-NSCBY4VD.cjs +370 -0
- package/dist/chunk-NSCBY4VD.cjs.map +1 -0
- package/dist/chunk-RSUXM42X.cjs +180 -0
- package/dist/chunk-RSUXM42X.cjs.map +1 -0
- package/dist/chunk-UYMVUTLV.js +180 -0
- package/dist/chunk-UYMVUTLV.js.map +1 -0
- package/dist/chunk-XID353H7.js +370 -0
- package/dist/chunk-XID353H7.js.map +1 -0
- package/dist/index.cjs +12 -806
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -80
- package/dist/index.d.ts +4 -80
- package/dist/index.js +11 -764
- package/dist/index.js.map +1 -1
- package/dist/normalize.cjs +8 -0
- package/dist/normalize.cjs.map +1 -0
- package/dist/normalize.d.cts +33 -0
- package/dist/normalize.d.ts +33 -0
- package/dist/normalize.js +8 -0
- package/dist/normalize.js.map +1 -0
- package/dist/parse.cjs +9 -0
- package/dist/parse.cjs.map +1 -0
- package/dist/parse.d.cts +32 -0
- package/dist/parse.d.ts +32 -0
- package/dist/parse.js +9 -0
- package/dist/parse.js.map +1 -0
- package/dist/provider-core-DinpG40u.d.cts +53 -0
- package/dist/provider-core-DinpG40u.d.ts +53 -0
- package/dist/providers.cjs +37 -392
- package/dist/providers.cjs.map +1 -1
- package/dist/providers.d.cts +4 -42
- package/dist/providers.d.ts +4 -42
- package/dist/providers.js +20 -336
- package/dist/providers.js.map +1 -1
- package/dist/validate.cjs +10 -0
- package/dist/validate.cjs.map +1 -0
- package/dist/validate.d.cts +21 -0
- package/dist/validate.d.ts +21 -0
- package/dist/validate.js +10 -0
- package/dist/validate.js.map +1 -0
- package/package.json +33 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/dan/code/oss/llm-strings/dist/chunk-RSUXM42X.cjs","../src/validate.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACaA,SAAS,oBAAA,CACP,QAAA,EACwB;AACxB,EAAA,MAAM,IAAA,EAA8B,CAAC,CAAA;AACrC,EAAA,IAAA,CAAA,MAAW,CAAC,SAAA,EAAW,QAAQ,EAAA,GAAK,MAAA,CAAO,OAAA;AAAA,IACzC,iCAAA,CAAgB,QAAQ;AAAA,EAC1B,CAAA,EAAG;AACD,IAAA,GAAA,CAAI,QAAQ,EAAA,EAAI,SAAA;AAAA,EAClB;AACA,EAAA,OAAO,GAAA;AACT;AAMA,SAAS,qBAAA,CACP,gBAAA,EACA,iBAAA,EACA,WAAA,EACA;AACA,EAAA,MAAM,UAAA,mBAAY,iBAAA,CAAkB,gBAAgB,CAAA,UAAK,kBAAA;AACzD,EAAA,MAAM,eAAA,kBAAiB,iCAAA,mBAAgB,WAAW,CAAA,4BAAA,CAAI,SAAS,GAAA;AAC/D,EAAA,GAAA,CAAI,CAAC,cAAA,EAAgB,OAAO,EAAE,IAAA,EAAM,KAAA,CAAA,EAAW,UAAU,CAAA;AACzD,EAAA,OAAO,EAAE,IAAA,kBAAM,6BAAA,qBAAY,WAAW,CAAA,4BAAA,CAAI,cAAc,GAAA,EAAG,UAAU,CAAA;AACvE;AAKA,SAAS,2BAAA,CACP,OAAA,EACA,WAAA,EACa;AACb,EAAA,MAAM,MAAA,kBAAQ,IAAI,GAAA,CAAY,CAAA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QACZ,CAAC,CAAA;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AD3FA;AACA;AACE;AACF,4BAAC","file":"/Users/dan/code/oss/llm-strings/dist/chunk-RSUXM42X.cjs","sourcesContent":[null,"import { parse } from \"./parse.js\";\nimport { normalize } from \"./normalize.js\";\nimport {\n PARAM_SPECS,\n PROVIDER_PARAMS,\n REASONING_MODEL_UNSUPPORTED,\n bedrockSupportsCaching,\n canHostOpenAIModels,\n detectBedrockModelFamily,\n isReasoningModel,\n type ParamSpec,\n type Provider,\n} from \"./provider-core.js\";\n\nexport interface ValidationIssue {\n param: string;\n value: string;\n message: string;\n severity: \"error\" | \"warning\";\n}\n\nexport interface ValidateOptions {\n /** Promote warnings (unknown provider, unknown params) to errors. */\n strict?: boolean;\n}\n\n/**\n * Build a reverse map from provider-specific param names back to canonical names.\n */\nfunction buildReverseParamMap(\n provider: Provider,\n): Record<string, string> {\n const map: Record<string, string> = {};\n for (const [canonical, specific] of Object.entries(\n PROVIDER_PARAMS[provider],\n )) {\n map[specific] = canonical;\n }\n return map;\n}\n\n/**\n * Look up a sub-provider's ParamSpec for a gateway-normalized param name.\n * Maps: gateway param → canonical → sub-provider-specific → spec.\n */\nfunction lookupSubProviderSpec(\n gatewayParamName: string,\n gatewayReverseMap: Record<string, string>,\n subProvider: Provider,\n) {\n const canonical = gatewayReverseMap[gatewayParamName] ?? gatewayParamName;\n const subProviderKey = PROVIDER_PARAMS[subProvider]?.[canonical];\n if (!subProviderKey) return { spec: undefined, canonical };\n return { spec: PARAM_SPECS[subProvider]?.[subProviderKey], canonical };\n}\n\n/**\n * Build the set of gateway param names that correspond to params the sub-provider supports.\n */\nfunction buildSubProviderKnownParams(\n gateway: Provider,\n subProvider: Provider,\n): Set<string> {\n const known = new Set<string>();\n const subProviderCanonicals = new Set(\n Object.keys(PROVIDER_PARAMS[subProvider]),\n );\n for (const [canonical, gatewaySpecific] of Object.entries(\n PROVIDER_PARAMS[gateway],\n )) {\n if (subProviderCanonicals.has(canonical)) {\n known.add(gatewaySpecific);\n }\n }\n return known;\n}\n\n/**\n * Validate an LLM connection string.\n *\n * Parses and normalizes the string, then checks params against provider specs.\n * For gateway providers (OpenRouter, Vercel), detects the sub-provider from the\n * model prefix and validates against the sub-provider's rules when known.\n * Returns a list of issues found. An empty array means all params look valid.\n */\nexport function validate(\n connectionString: string,\n options: ValidateOptions = {},\n): ValidationIssue[] {\n const parsed = parse(connectionString);\n const { config, provider, subProvider } = normalize(parsed);\n const issues: ValidationIssue[] = [];\n\n if (!provider) {\n issues.push({\n param: \"host\",\n value: config.host,\n message: `Unknown provider for host \"${config.host}\". Validation skipped.`,\n severity: options.strict ? \"error\" : \"warning\",\n });\n return issues;\n }\n\n // When routing through a gateway to a known sub-provider, validate against\n // the sub-provider's specs. Fall back to the gateway's loose specs otherwise.\n const effectiveProvider = subProvider ?? provider;\n const specs = PARAM_SPECS[effectiveProvider];\n\n const gatewayReverseMap = subProvider\n ? buildReverseParamMap(provider)\n : undefined;\n\n const knownParams = subProvider\n ? buildSubProviderKnownParams(provider, subProvider)\n : new Set(Object.values(PROVIDER_PARAMS[provider]));\n\n for (const [key, value] of Object.entries(config.params)) {\n // Check for OpenAI reasoning model restrictions (direct or via gateway)\n if (\n canHostOpenAIModels(provider) &&\n isReasoningModel(config.model) &&\n REASONING_MODEL_UNSUPPORTED.has(key)\n ) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" is not supported by OpenAI reasoning model \"${config.model}\". Use \"reasoning_effort\" instead of temperature for controlling output.`,\n severity: \"error\",\n });\n continue;\n }\n\n // Bedrock model-family-specific checks\n if (provider === \"bedrock\") {\n const family = detectBedrockModelFamily(config.model);\n\n // topK is only supported by Claude, Cohere, and Mistral on Bedrock\n if (\n key === \"topK\" &&\n family &&\n family !== \"anthropic\" &&\n family !== \"cohere\" &&\n family !== \"mistral\"\n ) {\n issues.push({\n param: key,\n value,\n message: `\"topK\" is not supported by ${family} models on Bedrock.`,\n severity: \"error\",\n });\n continue;\n }\n\n // cache_control is only supported by Claude and Nova on Bedrock\n if (key === \"cache_control\" && !bedrockSupportsCaching(config.model)) {\n issues.push({\n param: key,\n value,\n message: `Prompt caching is only supported for Anthropic Claude and Amazon Nova models on Bedrock, not ${family ?? \"unknown\"} models.`,\n severity: \"error\",\n });\n continue;\n }\n }\n\n // Check if param is known for this provider (or sub-provider)\n if (!knownParams.has(key) && !specs[key]) {\n issues.push({\n param: key,\n value,\n message: `Unknown param \"${key}\" for ${effectiveProvider}.`,\n severity: options.strict ? \"error\" : \"warning\",\n });\n continue;\n }\n\n // Look up the spec — for gateways with a sub-provider, map through\n // canonical names to find the sub-provider's spec\n let spec: ParamSpec | undefined = specs[key];\n if (subProvider && gatewayReverseMap && !spec) {\n const result = lookupSubProviderSpec(\n key,\n gatewayReverseMap,\n subProvider,\n );\n spec = result.spec;\n }\n if (!spec) continue;\n\n // Anthropic (and Bedrock Claude, and Anthropic via gateway) mutual exclusion for temperature/top_p\n if (\n (effectiveProvider === \"anthropic\" ||\n (provider === \"bedrock\" &&\n detectBedrockModelFamily(config.model) === \"anthropic\")) &&\n (key === \"temperature\" || key === \"top_p\" || key === \"topP\")\n ) {\n const otherKey =\n key === \"temperature\"\n ? provider === \"bedrock\"\n ? \"topP\"\n : \"top_p\"\n : \"temperature\";\n // Only report error once (on the temperature param) to avoid duplicate errors\n if (key === \"temperature\" && config.params[otherKey] !== undefined) {\n issues.push({\n param: key,\n value,\n message: `Cannot specify both \"temperature\" and \"${otherKey}\" for Anthropic models.`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"number\") {\n const num = Number(value);\n if (isNaN(num)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" should be a number, got \"${value}\".`,\n severity: \"error\",\n });\n continue;\n }\n if (spec.min !== undefined && num < spec.min) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be >= ${spec.min}, got ${num}.`,\n severity: \"error\",\n });\n }\n if (spec.max !== undefined && num > spec.max) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be <= ${spec.max}, got ${num}.`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"boolean\") {\n if (![\"true\", \"false\", \"0\", \"1\"].includes(value)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" should be a boolean (true/false), got \"${value}\".`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"string\" && spec.values) {\n if (!spec.values.includes(value)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be one of [${spec.values.join(\", \")}], got \"${value}\".`,\n severity: \"error\",\n });\n }\n }\n }\n\n return issues;\n}\n"]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalize
|
|
3
|
+
} from "./chunk-MPIHGH6L.js";
|
|
4
|
+
import {
|
|
5
|
+
parse
|
|
6
|
+
} from "./chunk-FCEV23OT.js";
|
|
7
|
+
import {
|
|
8
|
+
PARAM_SPECS,
|
|
9
|
+
PROVIDER_PARAMS,
|
|
10
|
+
REASONING_MODEL_UNSUPPORTED,
|
|
11
|
+
bedrockSupportsCaching,
|
|
12
|
+
canHostOpenAIModels,
|
|
13
|
+
detectBedrockModelFamily,
|
|
14
|
+
isReasoningModel
|
|
15
|
+
} from "./chunk-XID353H7.js";
|
|
16
|
+
|
|
17
|
+
// src/validate.ts
|
|
18
|
+
function buildReverseParamMap(provider) {
|
|
19
|
+
const map = {};
|
|
20
|
+
for (const [canonical, specific] of Object.entries(
|
|
21
|
+
PROVIDER_PARAMS[provider]
|
|
22
|
+
)) {
|
|
23
|
+
map[specific] = canonical;
|
|
24
|
+
}
|
|
25
|
+
return map;
|
|
26
|
+
}
|
|
27
|
+
function lookupSubProviderSpec(gatewayParamName, gatewayReverseMap, subProvider) {
|
|
28
|
+
const canonical = gatewayReverseMap[gatewayParamName] ?? gatewayParamName;
|
|
29
|
+
const subProviderKey = PROVIDER_PARAMS[subProvider]?.[canonical];
|
|
30
|
+
if (!subProviderKey) return { spec: void 0, canonical };
|
|
31
|
+
return { spec: PARAM_SPECS[subProvider]?.[subProviderKey], canonical };
|
|
32
|
+
}
|
|
33
|
+
function buildSubProviderKnownParams(gateway, subProvider) {
|
|
34
|
+
const known = /* @__PURE__ */ new Set();
|
|
35
|
+
const subProviderCanonicals = new Set(
|
|
36
|
+
Object.keys(PROVIDER_PARAMS[subProvider])
|
|
37
|
+
);
|
|
38
|
+
for (const [canonical, gatewaySpecific] of Object.entries(
|
|
39
|
+
PROVIDER_PARAMS[gateway]
|
|
40
|
+
)) {
|
|
41
|
+
if (subProviderCanonicals.has(canonical)) {
|
|
42
|
+
known.add(gatewaySpecific);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return known;
|
|
46
|
+
}
|
|
47
|
+
function validate(connectionString, options = {}) {
|
|
48
|
+
const parsed = parse(connectionString);
|
|
49
|
+
const { config, provider, subProvider } = normalize(parsed);
|
|
50
|
+
const issues = [];
|
|
51
|
+
if (!provider) {
|
|
52
|
+
issues.push({
|
|
53
|
+
param: "host",
|
|
54
|
+
value: config.host,
|
|
55
|
+
message: `Unknown provider for host "${config.host}". Validation skipped.`,
|
|
56
|
+
severity: options.strict ? "error" : "warning"
|
|
57
|
+
});
|
|
58
|
+
return issues;
|
|
59
|
+
}
|
|
60
|
+
const effectiveProvider = subProvider ?? provider;
|
|
61
|
+
const specs = PARAM_SPECS[effectiveProvider];
|
|
62
|
+
const gatewayReverseMap = subProvider ? buildReverseParamMap(provider) : void 0;
|
|
63
|
+
const knownParams = subProvider ? buildSubProviderKnownParams(provider, subProvider) : new Set(Object.values(PROVIDER_PARAMS[provider]));
|
|
64
|
+
for (const [key, value] of Object.entries(config.params)) {
|
|
65
|
+
if (canHostOpenAIModels(provider) && isReasoningModel(config.model) && REASONING_MODEL_UNSUPPORTED.has(key)) {
|
|
66
|
+
issues.push({
|
|
67
|
+
param: key,
|
|
68
|
+
value,
|
|
69
|
+
message: `"${key}" is not supported by OpenAI reasoning model "${config.model}". Use "reasoning_effort" instead of temperature for controlling output.`,
|
|
70
|
+
severity: "error"
|
|
71
|
+
});
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (provider === "bedrock") {
|
|
75
|
+
const family = detectBedrockModelFamily(config.model);
|
|
76
|
+
if (key === "topK" && family && family !== "anthropic" && family !== "cohere" && family !== "mistral") {
|
|
77
|
+
issues.push({
|
|
78
|
+
param: key,
|
|
79
|
+
value,
|
|
80
|
+
message: `"topK" is not supported by ${family} models on Bedrock.`,
|
|
81
|
+
severity: "error"
|
|
82
|
+
});
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (key === "cache_control" && !bedrockSupportsCaching(config.model)) {
|
|
86
|
+
issues.push({
|
|
87
|
+
param: key,
|
|
88
|
+
value,
|
|
89
|
+
message: `Prompt caching is only supported for Anthropic Claude and Amazon Nova models on Bedrock, not ${family ?? "unknown"} models.`,
|
|
90
|
+
severity: "error"
|
|
91
|
+
});
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (!knownParams.has(key) && !specs[key]) {
|
|
96
|
+
issues.push({
|
|
97
|
+
param: key,
|
|
98
|
+
value,
|
|
99
|
+
message: `Unknown param "${key}" for ${effectiveProvider}.`,
|
|
100
|
+
severity: options.strict ? "error" : "warning"
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
let spec = specs[key];
|
|
105
|
+
if (subProvider && gatewayReverseMap && !spec) {
|
|
106
|
+
const result = lookupSubProviderSpec(
|
|
107
|
+
key,
|
|
108
|
+
gatewayReverseMap,
|
|
109
|
+
subProvider
|
|
110
|
+
);
|
|
111
|
+
spec = result.spec;
|
|
112
|
+
}
|
|
113
|
+
if (!spec) continue;
|
|
114
|
+
if ((effectiveProvider === "anthropic" || provider === "bedrock" && detectBedrockModelFamily(config.model) === "anthropic") && (key === "temperature" || key === "top_p" || key === "topP")) {
|
|
115
|
+
const otherKey = key === "temperature" ? provider === "bedrock" ? "topP" : "top_p" : "temperature";
|
|
116
|
+
if (key === "temperature" && config.params[otherKey] !== void 0) {
|
|
117
|
+
issues.push({
|
|
118
|
+
param: key,
|
|
119
|
+
value,
|
|
120
|
+
message: `Cannot specify both "temperature" and "${otherKey}" for Anthropic models.`,
|
|
121
|
+
severity: "error"
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (spec.type === "number") {
|
|
126
|
+
const num = Number(value);
|
|
127
|
+
if (isNaN(num)) {
|
|
128
|
+
issues.push({
|
|
129
|
+
param: key,
|
|
130
|
+
value,
|
|
131
|
+
message: `"${key}" should be a number, got "${value}".`,
|
|
132
|
+
severity: "error"
|
|
133
|
+
});
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (spec.min !== void 0 && num < spec.min) {
|
|
137
|
+
issues.push({
|
|
138
|
+
param: key,
|
|
139
|
+
value,
|
|
140
|
+
message: `"${key}" must be >= ${spec.min}, got ${num}.`,
|
|
141
|
+
severity: "error"
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (spec.max !== void 0 && num > spec.max) {
|
|
145
|
+
issues.push({
|
|
146
|
+
param: key,
|
|
147
|
+
value,
|
|
148
|
+
message: `"${key}" must be <= ${spec.max}, got ${num}.`,
|
|
149
|
+
severity: "error"
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (spec.type === "boolean") {
|
|
154
|
+
if (!["true", "false", "0", "1"].includes(value)) {
|
|
155
|
+
issues.push({
|
|
156
|
+
param: key,
|
|
157
|
+
value,
|
|
158
|
+
message: `"${key}" should be a boolean (true/false), got "${value}".`,
|
|
159
|
+
severity: "error"
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (spec.type === "string" && spec.values) {
|
|
164
|
+
if (!spec.values.includes(value)) {
|
|
165
|
+
issues.push({
|
|
166
|
+
param: key,
|
|
167
|
+
value,
|
|
168
|
+
message: `"${key}" must be one of [${spec.values.join(", ")}], got "${value}".`,
|
|
169
|
+
severity: "error"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return issues;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
validate
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=chunk-UYMVUTLV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/validate.ts"],"sourcesContent":["import { parse } from \"./parse.js\";\nimport { normalize } from \"./normalize.js\";\nimport {\n PARAM_SPECS,\n PROVIDER_PARAMS,\n REASONING_MODEL_UNSUPPORTED,\n bedrockSupportsCaching,\n canHostOpenAIModels,\n detectBedrockModelFamily,\n isReasoningModel,\n type ParamSpec,\n type Provider,\n} from \"./provider-core.js\";\n\nexport interface ValidationIssue {\n param: string;\n value: string;\n message: string;\n severity: \"error\" | \"warning\";\n}\n\nexport interface ValidateOptions {\n /** Promote warnings (unknown provider, unknown params) to errors. */\n strict?: boolean;\n}\n\n/**\n * Build a reverse map from provider-specific param names back to canonical names.\n */\nfunction buildReverseParamMap(\n provider: Provider,\n): Record<string, string> {\n const map: Record<string, string> = {};\n for (const [canonical, specific] of Object.entries(\n PROVIDER_PARAMS[provider],\n )) {\n map[specific] = canonical;\n }\n return map;\n}\n\n/**\n * Look up a sub-provider's ParamSpec for a gateway-normalized param name.\n * Maps: gateway param → canonical → sub-provider-specific → spec.\n */\nfunction lookupSubProviderSpec(\n gatewayParamName: string,\n gatewayReverseMap: Record<string, string>,\n subProvider: Provider,\n) {\n const canonical = gatewayReverseMap[gatewayParamName] ?? gatewayParamName;\n const subProviderKey = PROVIDER_PARAMS[subProvider]?.[canonical];\n if (!subProviderKey) return { spec: undefined, canonical };\n return { spec: PARAM_SPECS[subProvider]?.[subProviderKey], canonical };\n}\n\n/**\n * Build the set of gateway param names that correspond to params the sub-provider supports.\n */\nfunction buildSubProviderKnownParams(\n gateway: Provider,\n subProvider: Provider,\n): Set<string> {\n const known = new Set<string>();\n const subProviderCanonicals = new Set(\n Object.keys(PROVIDER_PARAMS[subProvider]),\n );\n for (const [canonical, gatewaySpecific] of Object.entries(\n PROVIDER_PARAMS[gateway],\n )) {\n if (subProviderCanonicals.has(canonical)) {\n known.add(gatewaySpecific);\n }\n }\n return known;\n}\n\n/**\n * Validate an LLM connection string.\n *\n * Parses and normalizes the string, then checks params against provider specs.\n * For gateway providers (OpenRouter, Vercel), detects the sub-provider from the\n * model prefix and validates against the sub-provider's rules when known.\n * Returns a list of issues found. An empty array means all params look valid.\n */\nexport function validate(\n connectionString: string,\n options: ValidateOptions = {},\n): ValidationIssue[] {\n const parsed = parse(connectionString);\n const { config, provider, subProvider } = normalize(parsed);\n const issues: ValidationIssue[] = [];\n\n if (!provider) {\n issues.push({\n param: \"host\",\n value: config.host,\n message: `Unknown provider for host \"${config.host}\". Validation skipped.`,\n severity: options.strict ? \"error\" : \"warning\",\n });\n return issues;\n }\n\n // When routing through a gateway to a known sub-provider, validate against\n // the sub-provider's specs. Fall back to the gateway's loose specs otherwise.\n const effectiveProvider = subProvider ?? provider;\n const specs = PARAM_SPECS[effectiveProvider];\n\n const gatewayReverseMap = subProvider\n ? buildReverseParamMap(provider)\n : undefined;\n\n const knownParams = subProvider\n ? buildSubProviderKnownParams(provider, subProvider)\n : new Set(Object.values(PROVIDER_PARAMS[provider]));\n\n for (const [key, value] of Object.entries(config.params)) {\n // Check for OpenAI reasoning model restrictions (direct or via gateway)\n if (\n canHostOpenAIModels(provider) &&\n isReasoningModel(config.model) &&\n REASONING_MODEL_UNSUPPORTED.has(key)\n ) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" is not supported by OpenAI reasoning model \"${config.model}\". Use \"reasoning_effort\" instead of temperature for controlling output.`,\n severity: \"error\",\n });\n continue;\n }\n\n // Bedrock model-family-specific checks\n if (provider === \"bedrock\") {\n const family = detectBedrockModelFamily(config.model);\n\n // topK is only supported by Claude, Cohere, and Mistral on Bedrock\n if (\n key === \"topK\" &&\n family &&\n family !== \"anthropic\" &&\n family !== \"cohere\" &&\n family !== \"mistral\"\n ) {\n issues.push({\n param: key,\n value,\n message: `\"topK\" is not supported by ${family} models on Bedrock.`,\n severity: \"error\",\n });\n continue;\n }\n\n // cache_control is only supported by Claude and Nova on Bedrock\n if (key === \"cache_control\" && !bedrockSupportsCaching(config.model)) {\n issues.push({\n param: key,\n value,\n message: `Prompt caching is only supported for Anthropic Claude and Amazon Nova models on Bedrock, not ${family ?? \"unknown\"} models.`,\n severity: \"error\",\n });\n continue;\n }\n }\n\n // Check if param is known for this provider (or sub-provider)\n if (!knownParams.has(key) && !specs[key]) {\n issues.push({\n param: key,\n value,\n message: `Unknown param \"${key}\" for ${effectiveProvider}.`,\n severity: options.strict ? \"error\" : \"warning\",\n });\n continue;\n }\n\n // Look up the spec — for gateways with a sub-provider, map through\n // canonical names to find the sub-provider's spec\n let spec: ParamSpec | undefined = specs[key];\n if (subProvider && gatewayReverseMap && !spec) {\n const result = lookupSubProviderSpec(\n key,\n gatewayReverseMap,\n subProvider,\n );\n spec = result.spec;\n }\n if (!spec) continue;\n\n // Anthropic (and Bedrock Claude, and Anthropic via gateway) mutual exclusion for temperature/top_p\n if (\n (effectiveProvider === \"anthropic\" ||\n (provider === \"bedrock\" &&\n detectBedrockModelFamily(config.model) === \"anthropic\")) &&\n (key === \"temperature\" || key === \"top_p\" || key === \"topP\")\n ) {\n const otherKey =\n key === \"temperature\"\n ? provider === \"bedrock\"\n ? \"topP\"\n : \"top_p\"\n : \"temperature\";\n // Only report error once (on the temperature param) to avoid duplicate errors\n if (key === \"temperature\" && config.params[otherKey] !== undefined) {\n issues.push({\n param: key,\n value,\n message: `Cannot specify both \"temperature\" and \"${otherKey}\" for Anthropic models.`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"number\") {\n const num = Number(value);\n if (isNaN(num)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" should be a number, got \"${value}\".`,\n severity: \"error\",\n });\n continue;\n }\n if (spec.min !== undefined && num < spec.min) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be >= ${spec.min}, got ${num}.`,\n severity: \"error\",\n });\n }\n if (spec.max !== undefined && num > spec.max) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be <= ${spec.max}, got ${num}.`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"boolean\") {\n if (![\"true\", \"false\", \"0\", \"1\"].includes(value)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" should be a boolean (true/false), got \"${value}\".`,\n severity: \"error\",\n });\n }\n }\n\n if (spec.type === \"string\" && spec.values) {\n if (!spec.values.includes(value)) {\n issues.push({\n param: key,\n value,\n message: `\"${key}\" must be one of [${spec.values.join(\", \")}], got \"${value}\".`,\n severity: \"error\",\n });\n }\n }\n }\n\n return issues;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,SAAS,qBACP,UACwB;AACxB,QAAM,MAA8B,CAAC;AACrC,aAAW,CAAC,WAAW,QAAQ,KAAK,OAAO;AAAA,IACzC,gBAAgB,QAAQ;AAAA,EAC1B,GAAG;AACD,QAAI,QAAQ,IAAI;AAAA,EAClB;AACA,SAAO;AACT;AAMA,SAAS,sBACP,kBACA,mBACA,aACA;AACA,QAAM,YAAY,kBAAkB,gBAAgB,KAAK;AACzD,QAAM,iBAAiB,gBAAgB,WAAW,IAAI,SAAS;AAC/D,MAAI,CAAC,eAAgB,QAAO,EAAE,MAAM,QAAW,UAAU;AACzD,SAAO,EAAE,MAAM,YAAY,WAAW,IAAI,cAAc,GAAG,UAAU;AACvE;AAKA,SAAS,4BACP,SACA,aACa;AACb,QAAM,QAAQ,oBAAI,IAAY;AAC9B,QAAM,wBAAwB,IAAI;AAAA,IAChC,OAAO,KAAK,gBAAgB,WAAW,CAAC;AAAA,EAC1C;AACA,aAAW,CAAC,WAAW,eAAe,KAAK,OAAO;AAAA,IAChD,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,MACF;AACA,UAAI,KAAK,QAAQ,UAAa,MAAM,KAAK,KAAK;AAC5C,eAAO,KAAK;AAAA,UACV,OAAO;AAAA,UACP;AAAA,UACA,SAAS,IAAI,GAAG,gBAAgB,KAAK,GAAG,SAAS,GAAG;AAAA,UACpD,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AACA,UAAI,KAAK,QAAQ,UAAa,MAAM,KAAK,KAAK;AAC5C,eAAO,KAAK;AAAA,UACV,OAAO;AAAA,UACP;AAAA,UACA,SAAS,IAAI,GAAG,gBAAgB,KAAK,GAAG,SAAS,GAAG;AAAA,UACpD,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,IACF;AAEA,QAAI,KAAK,SAAS,WAAW;AAC3B,UAAI,CAAC,CAAC,QAAQ,SAAS,KAAK,GAAG,EAAE,SAAS,KAAK,GAAG;AAChD,eAAO,KAAK;AAAA,UACV,OAAO;AAAA,UACP;AAAA,UACA,SAAS,IAAI,GAAG,4CAA4C,KAAK;AAAA,UACjE,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,IACF;AAEA,QAAI,KAAK,SAAS,YAAY,KAAK,QAAQ;AACzC,UAAI,CAAC,KAAK,OAAO,SAAS,KAAK,GAAG;AAChC,eAAO,KAAK;AAAA,UACV,OAAO;AAAA,UACP;AAAA,UACA,SAAS,IAAI,GAAG,qBAAqB,KAAK,OAAO,KAAK,IAAI,CAAC,WAAW,KAAK;AAAA,UAC3E,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
// src/provider-core.ts
|
|
2
|
+
function detectProvider(host) {
|
|
3
|
+
if (host.includes("openrouter")) return "openrouter";
|
|
4
|
+
if (host.includes("gateway.ai.vercel")) return "vercel";
|
|
5
|
+
if (host.includes("amazonaws") || host.includes("bedrock")) return "bedrock";
|
|
6
|
+
if (host.includes("openai")) return "openai";
|
|
7
|
+
if (host.includes("anthropic") || host.includes("claude")) return "anthropic";
|
|
8
|
+
if (host.includes("googleapis") || host.includes("google")) return "google";
|
|
9
|
+
if (host.includes("mistral")) return "mistral";
|
|
10
|
+
if (host.includes("cohere")) return "cohere";
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
var ALIASES = {
|
|
14
|
+
// temperature
|
|
15
|
+
temp: "temperature",
|
|
16
|
+
// max_tokens
|
|
17
|
+
max: "max_tokens",
|
|
18
|
+
max_out: "max_tokens",
|
|
19
|
+
max_output: "max_tokens",
|
|
20
|
+
max_output_tokens: "max_tokens",
|
|
21
|
+
max_completion_tokens: "max_tokens",
|
|
22
|
+
maxOutputTokens: "max_tokens",
|
|
23
|
+
maxTokens: "max_tokens",
|
|
24
|
+
// top_p
|
|
25
|
+
topp: "top_p",
|
|
26
|
+
topP: "top_p",
|
|
27
|
+
nucleus: "top_p",
|
|
28
|
+
// top_k
|
|
29
|
+
topk: "top_k",
|
|
30
|
+
topK: "top_k",
|
|
31
|
+
// frequency_penalty
|
|
32
|
+
freq: "frequency_penalty",
|
|
33
|
+
freq_penalty: "frequency_penalty",
|
|
34
|
+
frequencyPenalty: "frequency_penalty",
|
|
35
|
+
repetition_penalty: "frequency_penalty",
|
|
36
|
+
// presence_penalty
|
|
37
|
+
pres: "presence_penalty",
|
|
38
|
+
pres_penalty: "presence_penalty",
|
|
39
|
+
presencePenalty: "presence_penalty",
|
|
40
|
+
// stop
|
|
41
|
+
stop_sequences: "stop",
|
|
42
|
+
stopSequences: "stop",
|
|
43
|
+
stop_sequence: "stop",
|
|
44
|
+
// seed
|
|
45
|
+
random_seed: "seed",
|
|
46
|
+
randomSeed: "seed",
|
|
47
|
+
// n (completions count)
|
|
48
|
+
candidateCount: "n",
|
|
49
|
+
candidate_count: "n",
|
|
50
|
+
num_completions: "n",
|
|
51
|
+
// effort / reasoning
|
|
52
|
+
reasoning_effort: "effort",
|
|
53
|
+
reasoning: "effort",
|
|
54
|
+
// cache
|
|
55
|
+
cache_control: "cache",
|
|
56
|
+
cacheControl: "cache",
|
|
57
|
+
cachePoint: "cache",
|
|
58
|
+
cache_point: "cache"
|
|
59
|
+
};
|
|
60
|
+
var PROVIDER_PARAMS = {
|
|
61
|
+
openai: {
|
|
62
|
+
temperature: "temperature",
|
|
63
|
+
max_tokens: "max_tokens",
|
|
64
|
+
top_p: "top_p",
|
|
65
|
+
frequency_penalty: "frequency_penalty",
|
|
66
|
+
presence_penalty: "presence_penalty",
|
|
67
|
+
stop: "stop",
|
|
68
|
+
n: "n",
|
|
69
|
+
seed: "seed",
|
|
70
|
+
stream: "stream",
|
|
71
|
+
effort: "reasoning_effort"
|
|
72
|
+
},
|
|
73
|
+
anthropic: {
|
|
74
|
+
temperature: "temperature",
|
|
75
|
+
max_tokens: "max_tokens",
|
|
76
|
+
top_p: "top_p",
|
|
77
|
+
top_k: "top_k",
|
|
78
|
+
stop: "stop_sequences",
|
|
79
|
+
stream: "stream",
|
|
80
|
+
effort: "effort",
|
|
81
|
+
cache: "cache_control",
|
|
82
|
+
cache_ttl: "cache_ttl"
|
|
83
|
+
},
|
|
84
|
+
google: {
|
|
85
|
+
temperature: "temperature",
|
|
86
|
+
max_tokens: "maxOutputTokens",
|
|
87
|
+
top_p: "topP",
|
|
88
|
+
top_k: "topK",
|
|
89
|
+
frequency_penalty: "frequencyPenalty",
|
|
90
|
+
presence_penalty: "presencePenalty",
|
|
91
|
+
stop: "stopSequences",
|
|
92
|
+
n: "candidateCount",
|
|
93
|
+
stream: "stream",
|
|
94
|
+
seed: "seed",
|
|
95
|
+
responseMimeType: "responseMimeType",
|
|
96
|
+
responseSchema: "responseSchema"
|
|
97
|
+
},
|
|
98
|
+
mistral: {
|
|
99
|
+
temperature: "temperature",
|
|
100
|
+
max_tokens: "max_tokens",
|
|
101
|
+
top_p: "top_p",
|
|
102
|
+
frequency_penalty: "frequency_penalty",
|
|
103
|
+
presence_penalty: "presence_penalty",
|
|
104
|
+
stop: "stop",
|
|
105
|
+
n: "n",
|
|
106
|
+
seed: "random_seed",
|
|
107
|
+
stream: "stream",
|
|
108
|
+
safe_prompt: "safe_prompt",
|
|
109
|
+
min_tokens: "min_tokens"
|
|
110
|
+
},
|
|
111
|
+
cohere: {
|
|
112
|
+
temperature: "temperature",
|
|
113
|
+
max_tokens: "max_tokens",
|
|
114
|
+
top_p: "p",
|
|
115
|
+
top_k: "k",
|
|
116
|
+
frequency_penalty: "frequency_penalty",
|
|
117
|
+
presence_penalty: "presence_penalty",
|
|
118
|
+
stop: "stop_sequences",
|
|
119
|
+
stream: "stream",
|
|
120
|
+
seed: "seed"
|
|
121
|
+
},
|
|
122
|
+
bedrock: {
|
|
123
|
+
// Bedrock Converse API uses camelCase
|
|
124
|
+
temperature: "temperature",
|
|
125
|
+
max_tokens: "maxTokens",
|
|
126
|
+
top_p: "topP",
|
|
127
|
+
top_k: "topK",
|
|
128
|
+
// Claude models via additionalModelRequestFields
|
|
129
|
+
stop: "stopSequences",
|
|
130
|
+
stream: "stream",
|
|
131
|
+
cache: "cache_control",
|
|
132
|
+
cache_ttl: "cache_ttl"
|
|
133
|
+
},
|
|
134
|
+
openrouter: {
|
|
135
|
+
// OpenAI-compatible API with extra routing params
|
|
136
|
+
temperature: "temperature",
|
|
137
|
+
max_tokens: "max_tokens",
|
|
138
|
+
top_p: "top_p",
|
|
139
|
+
top_k: "top_k",
|
|
140
|
+
frequency_penalty: "frequency_penalty",
|
|
141
|
+
presence_penalty: "presence_penalty",
|
|
142
|
+
stop: "stop",
|
|
143
|
+
n: "n",
|
|
144
|
+
seed: "seed",
|
|
145
|
+
stream: "stream",
|
|
146
|
+
effort: "reasoning_effort"
|
|
147
|
+
},
|
|
148
|
+
vercel: {
|
|
149
|
+
// OpenAI-compatible gateway
|
|
150
|
+
temperature: "temperature",
|
|
151
|
+
max_tokens: "max_tokens",
|
|
152
|
+
top_p: "top_p",
|
|
153
|
+
top_k: "top_k",
|
|
154
|
+
frequency_penalty: "frequency_penalty",
|
|
155
|
+
presence_penalty: "presence_penalty",
|
|
156
|
+
stop: "stop",
|
|
157
|
+
n: "n",
|
|
158
|
+
seed: "seed",
|
|
159
|
+
stream: "stream",
|
|
160
|
+
effort: "reasoning_effort"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var PARAM_SPECS = {
|
|
164
|
+
openai: {
|
|
165
|
+
temperature: { type: "number", min: 0, max: 2, default: 0.7, description: "Controls randomness" },
|
|
166
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
167
|
+
top_p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
168
|
+
frequency_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize frequent tokens" },
|
|
169
|
+
presence_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize repeated topics" },
|
|
170
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
171
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
172
|
+
seed: { type: "number", description: "Random seed" },
|
|
173
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
174
|
+
reasoning_effort: {
|
|
175
|
+
type: "string",
|
|
176
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
177
|
+
default: "medium",
|
|
178
|
+
description: "Reasoning effort"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
anthropic: {
|
|
182
|
+
temperature: { type: "number", min: 0, max: 1, default: 0.7, description: "Controls randomness" },
|
|
183
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
184
|
+
top_p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
185
|
+
top_k: { type: "number", min: 0, default: 40, description: "Top-K sampling" },
|
|
186
|
+
stop_sequences: { type: "string", description: "Stop sequences" },
|
|
187
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
188
|
+
effort: { type: "string", values: ["low", "medium", "high", "max"], default: "medium", description: "Thinking effort" },
|
|
189
|
+
cache_control: { type: "string", values: ["ephemeral"], default: "ephemeral", description: "Cache control" },
|
|
190
|
+
cache_ttl: { type: "string", values: ["5m", "1h"], default: "5m", description: "Cache TTL" }
|
|
191
|
+
},
|
|
192
|
+
google: {
|
|
193
|
+
temperature: { type: "number", min: 0, max: 2, default: 0.7, description: "Controls randomness" },
|
|
194
|
+
maxOutputTokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
195
|
+
topP: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
196
|
+
topK: { type: "number", min: 0, default: 40, description: "Top-K sampling" },
|
|
197
|
+
frequencyPenalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize frequent tokens" },
|
|
198
|
+
presencePenalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize repeated topics" },
|
|
199
|
+
stopSequences: { type: "string", description: "Stop sequences" },
|
|
200
|
+
candidateCount: { type: "number", min: 1, default: 1, description: "Candidate count" },
|
|
201
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
202
|
+
seed: { type: "number", description: "Random seed" },
|
|
203
|
+
responseMimeType: { type: "string", description: "Response MIME type" },
|
|
204
|
+
responseSchema: { type: "string", description: "Response schema" }
|
|
205
|
+
},
|
|
206
|
+
mistral: {
|
|
207
|
+
temperature: { type: "number", min: 0, max: 1, default: 0.7, description: "Controls randomness" },
|
|
208
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
209
|
+
top_p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
210
|
+
frequency_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize frequent tokens" },
|
|
211
|
+
presence_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize repeated topics" },
|
|
212
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
213
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
214
|
+
random_seed: { type: "number", description: "Random seed" },
|
|
215
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
216
|
+
safe_prompt: { type: "boolean", default: false, description: "Enable safe prompt" },
|
|
217
|
+
min_tokens: { type: "number", min: 0, default: 0, description: "Minimum tokens" }
|
|
218
|
+
},
|
|
219
|
+
cohere: {
|
|
220
|
+
temperature: { type: "number", min: 0, max: 1, default: 0.7, description: "Controls randomness" },
|
|
221
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
222
|
+
p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling (p)" },
|
|
223
|
+
k: { type: "number", min: 0, max: 500, default: 40, description: "Top-K sampling (k)" },
|
|
224
|
+
frequency_penalty: { type: "number", min: 0, max: 1, default: 0, description: "Penalize frequent tokens" },
|
|
225
|
+
presence_penalty: { type: "number", min: 0, max: 1, default: 0, description: "Penalize repeated topics" },
|
|
226
|
+
stop_sequences: { type: "string", description: "Stop sequences" },
|
|
227
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
228
|
+
seed: { type: "number", description: "Random seed" }
|
|
229
|
+
},
|
|
230
|
+
bedrock: {
|
|
231
|
+
// Converse API inferenceConfig params
|
|
232
|
+
temperature: { type: "number", min: 0, max: 1, default: 0.7, description: "Controls randomness" },
|
|
233
|
+
maxTokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
234
|
+
topP: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
235
|
+
topK: { type: "number", min: 0, default: 40, description: "Top-K sampling" },
|
|
236
|
+
stopSequences: { type: "string", description: "Stop sequences" },
|
|
237
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
238
|
+
cache_control: { type: "string", values: ["ephemeral"], default: "ephemeral", description: "Cache control" },
|
|
239
|
+
cache_ttl: { type: "string", values: ["5m", "1h"], default: "5m", description: "Cache TTL" }
|
|
240
|
+
},
|
|
241
|
+
openrouter: {
|
|
242
|
+
// Loose validation — proxies to many providers with varying ranges
|
|
243
|
+
temperature: { type: "number", min: 0, max: 2, default: 0.7, description: "Controls randomness" },
|
|
244
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
245
|
+
top_p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
246
|
+
top_k: { type: "number", min: 0, default: 40, description: "Top-K sampling" },
|
|
247
|
+
frequency_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize frequent tokens" },
|
|
248
|
+
presence_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize repeated topics" },
|
|
249
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
250
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
251
|
+
seed: { type: "number", description: "Random seed" },
|
|
252
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
253
|
+
reasoning_effort: {
|
|
254
|
+
type: "string",
|
|
255
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
256
|
+
default: "medium",
|
|
257
|
+
description: "Reasoning effort"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
vercel: {
|
|
261
|
+
// Loose validation — proxies to many providers with varying ranges
|
|
262
|
+
temperature: { type: "number", min: 0, max: 2, default: 0.7, description: "Controls randomness" },
|
|
263
|
+
max_tokens: { type: "number", min: 1, default: 4096, description: "Maximum output tokens" },
|
|
264
|
+
top_p: { type: "number", min: 0, max: 1, default: 1, description: "Nucleus sampling" },
|
|
265
|
+
top_k: { type: "number", min: 0, default: 40, description: "Top-K sampling" },
|
|
266
|
+
frequency_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize frequent tokens" },
|
|
267
|
+
presence_penalty: { type: "number", min: -2, max: 2, default: 0, description: "Penalize repeated topics" },
|
|
268
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
269
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
270
|
+
seed: { type: "number", description: "Random seed" },
|
|
271
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
272
|
+
reasoning_effort: {
|
|
273
|
+
type: "string",
|
|
274
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
275
|
+
default: "medium",
|
|
276
|
+
description: "Reasoning effort"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
function isReasoningModel(model) {
|
|
281
|
+
const name = model.includes("/") ? model.split("/").pop() : model;
|
|
282
|
+
return /^o[134]/.test(name);
|
|
283
|
+
}
|
|
284
|
+
function canHostOpenAIModels(provider) {
|
|
285
|
+
return provider === "openai" || provider === "openrouter" || provider === "vercel";
|
|
286
|
+
}
|
|
287
|
+
function isGatewayProvider(provider) {
|
|
288
|
+
return provider === "openrouter" || provider === "vercel";
|
|
289
|
+
}
|
|
290
|
+
function detectGatewaySubProvider(model) {
|
|
291
|
+
const slash = model.indexOf("/");
|
|
292
|
+
if (slash < 1) return void 0;
|
|
293
|
+
const prefix = model.slice(0, slash);
|
|
294
|
+
const direct = ["openai", "anthropic", "google", "mistral", "cohere"];
|
|
295
|
+
return direct.find((p) => p === prefix);
|
|
296
|
+
}
|
|
297
|
+
var REASONING_MODEL_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
298
|
+
"temperature",
|
|
299
|
+
"top_p",
|
|
300
|
+
"frequency_penalty",
|
|
301
|
+
"presence_penalty",
|
|
302
|
+
"n"
|
|
303
|
+
]);
|
|
304
|
+
function detectBedrockModelFamily(model) {
|
|
305
|
+
const parts = model.split(".");
|
|
306
|
+
let prefix = parts[0];
|
|
307
|
+
if (["us", "eu", "apac", "global"].includes(prefix) && parts.length > 1) {
|
|
308
|
+
prefix = parts[1];
|
|
309
|
+
}
|
|
310
|
+
const families = [
|
|
311
|
+
"anthropic",
|
|
312
|
+
"meta",
|
|
313
|
+
"amazon",
|
|
314
|
+
"mistral",
|
|
315
|
+
"cohere",
|
|
316
|
+
"ai21"
|
|
317
|
+
];
|
|
318
|
+
return families.find((f) => prefix === f);
|
|
319
|
+
}
|
|
320
|
+
function bedrockSupportsCaching(model) {
|
|
321
|
+
const family = detectBedrockModelFamily(model);
|
|
322
|
+
if (family === "anthropic") return true;
|
|
323
|
+
if (family === "amazon" && model.includes("nova")) return true;
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
var CACHE_VALUES = {
|
|
327
|
+
openai: void 0,
|
|
328
|
+
// OpenAI auto-caches; no explicit param
|
|
329
|
+
anthropic: "ephemeral",
|
|
330
|
+
google: void 0,
|
|
331
|
+
// Google uses explicit caching API, not a param
|
|
332
|
+
mistral: void 0,
|
|
333
|
+
cohere: void 0,
|
|
334
|
+
bedrock: "ephemeral",
|
|
335
|
+
// Supported for Claude models on Bedrock
|
|
336
|
+
openrouter: void 0,
|
|
337
|
+
// Depends on underlying provider
|
|
338
|
+
vercel: void 0
|
|
339
|
+
// Depends on underlying provider
|
|
340
|
+
};
|
|
341
|
+
var CACHE_TTLS = {
|
|
342
|
+
openai: void 0,
|
|
343
|
+
anthropic: ["5m", "1h"],
|
|
344
|
+
google: void 0,
|
|
345
|
+
mistral: void 0,
|
|
346
|
+
cohere: void 0,
|
|
347
|
+
bedrock: ["5m", "1h"],
|
|
348
|
+
// Claude on Bedrock uses same TTLs as direct Anthropic
|
|
349
|
+
openrouter: void 0,
|
|
350
|
+
vercel: void 0
|
|
351
|
+
};
|
|
352
|
+
var DURATION_RE = /^\d+[mh]$/;
|
|
353
|
+
|
|
354
|
+
export {
|
|
355
|
+
detectProvider,
|
|
356
|
+
ALIASES,
|
|
357
|
+
PROVIDER_PARAMS,
|
|
358
|
+
PARAM_SPECS,
|
|
359
|
+
isReasoningModel,
|
|
360
|
+
canHostOpenAIModels,
|
|
361
|
+
isGatewayProvider,
|
|
362
|
+
detectGatewaySubProvider,
|
|
363
|
+
REASONING_MODEL_UNSUPPORTED,
|
|
364
|
+
detectBedrockModelFamily,
|
|
365
|
+
bedrockSupportsCaching,
|
|
366
|
+
CACHE_VALUES,
|
|
367
|
+
CACHE_TTLS,
|
|
368
|
+
DURATION_RE
|
|
369
|
+
};
|
|
370
|
+
//# sourceMappingURL=chunk-XID353H7.js.map
|