@infersec/conduit 1.92.1 → 1.92.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/cli.js +94 -60
- package/dist/cli.sea.cjs +94 -60
- package/dist/modelManagement/createEngineProcess.d.ts +8 -0
- package/dist/modelManagement/exllamav3/index.d.ts +1 -1
- package/dist/modelManagement/extraArgs.d.ts +1 -0
- package/dist/modelManagement/llamacpp.d.ts +1 -1
- package/dist/modelManagement/mlxlm.d.ts +1 -1
- package/dist/modelManagement/sglang.d.ts +1 -1
- package/dist/modelManagement/tensorrtllm.d.ts +1 -1
- package/dist/modelManagement/vllm.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -112706,6 +112706,88 @@ function requireExpressPromiseRouter () {
|
|
|
112706
112706
|
var expressPromiseRouterExports = requireExpressPromiseRouter();
|
|
112707
112707
|
var createRouter = /*@__PURE__*/getDefaultExportFromCjs(expressPromiseRouterExports);
|
|
112708
112708
|
|
|
112709
|
+
const SECRET_FLAGS = new Set([
|
|
112710
|
+
"api-key",
|
|
112711
|
+
"auth-token",
|
|
112712
|
+
"hf-token",
|
|
112713
|
+
"key",
|
|
112714
|
+
"password",
|
|
112715
|
+
"secret",
|
|
112716
|
+
"token"
|
|
112717
|
+
]);
|
|
112718
|
+
function redactSecretArgs(args) {
|
|
112719
|
+
return args.map((arg, index) => {
|
|
112720
|
+
const equalsIndex = arg.indexOf("=");
|
|
112721
|
+
if (arg.startsWith("--") && equalsIndex > 0) {
|
|
112722
|
+
const flag = arg.slice(2, equalsIndex);
|
|
112723
|
+
if (SECRET_FLAGS.has(flag)) {
|
|
112724
|
+
return `${arg.slice(0, equalsIndex + 1)}***`;
|
|
112725
|
+
}
|
|
112726
|
+
}
|
|
112727
|
+
const previous = args[index - 1];
|
|
112728
|
+
if (previous &&
|
|
112729
|
+
previous.startsWith("--") &&
|
|
112730
|
+
!previous.includes("=") &&
|
|
112731
|
+
SECRET_FLAGS.has(previous.slice(2))) {
|
|
112732
|
+
return "***";
|
|
112733
|
+
}
|
|
112734
|
+
return arg;
|
|
112735
|
+
});
|
|
112736
|
+
}
|
|
112737
|
+
async function createEngineProcess({ args, bin, logger }) {
|
|
112738
|
+
logger.info("Starting engine process", {
|
|
112739
|
+
command: { args: redactSecretArgs(args), bin }
|
|
112740
|
+
});
|
|
112741
|
+
const processManager = new ProcessManager({ args, command: bin });
|
|
112742
|
+
await processManager.start();
|
|
112743
|
+
return processManager;
|
|
112744
|
+
}
|
|
112745
|
+
|
|
112746
|
+
function parseExtraArgs(extraArgs) {
|
|
112747
|
+
if (!Array.isArray(extraArgs) ||
|
|
112748
|
+
!extraArgs.every((value) => typeof value === "string")) {
|
|
112749
|
+
return [];
|
|
112750
|
+
}
|
|
112751
|
+
return extraArgs.flatMap(tokenizeShellLine);
|
|
112752
|
+
}
|
|
112753
|
+
function tokenizeShellLine(input) {
|
|
112754
|
+
const tokens = [];
|
|
112755
|
+
let buffer = "";
|
|
112756
|
+
let inQuote = null;
|
|
112757
|
+
let hasBuffer = false;
|
|
112758
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
112759
|
+
const char = input[index];
|
|
112760
|
+
if (inQuote) {
|
|
112761
|
+
if (char === inQuote) {
|
|
112762
|
+
inQuote = null;
|
|
112763
|
+
}
|
|
112764
|
+
else {
|
|
112765
|
+
buffer += char;
|
|
112766
|
+
}
|
|
112767
|
+
hasBuffer = true;
|
|
112768
|
+
}
|
|
112769
|
+
else if (char === '"' || char === "'") {
|
|
112770
|
+
inQuote = char;
|
|
112771
|
+
hasBuffer = true;
|
|
112772
|
+
}
|
|
112773
|
+
else if (char === " " || char === "\t") {
|
|
112774
|
+
if (hasBuffer) {
|
|
112775
|
+
tokens.push(buffer);
|
|
112776
|
+
buffer = "";
|
|
112777
|
+
hasBuffer = false;
|
|
112778
|
+
}
|
|
112779
|
+
}
|
|
112780
|
+
else {
|
|
112781
|
+
buffer += char;
|
|
112782
|
+
hasBuffer = true;
|
|
112783
|
+
}
|
|
112784
|
+
}
|
|
112785
|
+
if (hasBuffer) {
|
|
112786
|
+
tokens.push(buffer);
|
|
112787
|
+
}
|
|
112788
|
+
return tokens;
|
|
112789
|
+
}
|
|
112790
|
+
|
|
112709
112791
|
const balanced = (a, b, str) => {
|
|
112710
112792
|
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
112711
112793
|
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
@@ -121134,22 +121216,14 @@ async function startVLLM({ enginePort, targetDirectory }) {
|
|
|
121134
121216
|
if (dtype) {
|
|
121135
121217
|
args.push("--dtype", dtype);
|
|
121136
121218
|
}
|
|
121137
|
-
|
|
121138
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
121139
|
-
args.push(...extraArgs);
|
|
121140
|
-
}
|
|
121219
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
121141
121220
|
if (this.model.multimodalEnabled) {
|
|
121142
121221
|
args.push("--limit-mm-per-prompt", process.env.VLLM_MM_LIMIT ?? '{"image":5}');
|
|
121143
121222
|
}
|
|
121144
121223
|
if (process.env.VLLM_TRUST_REMOTE_CODE === "true") {
|
|
121145
121224
|
args.push("--trust-remote-code");
|
|
121146
121225
|
}
|
|
121147
|
-
|
|
121148
|
-
command: VLLM_EXECUTABLE,
|
|
121149
|
-
args
|
|
121150
|
-
});
|
|
121151
|
-
await processManager.start();
|
|
121152
|
-
return processManager;
|
|
121226
|
+
return createEngineProcess({ args, bin: VLLM_EXECUTABLE, logger: this.logger });
|
|
121153
121227
|
}
|
|
121154
121228
|
|
|
121155
121229
|
// src/lib/cache-management.ts
|
|
@@ -122776,16 +122850,8 @@ async function startExllamav3({ enginePort, targetDirectory }) {
|
|
|
122776
122850
|
if (gpuSplit) {
|
|
122777
122851
|
args.push("--gpu-split", gpuSplit);
|
|
122778
122852
|
}
|
|
122779
|
-
|
|
122780
|
-
|
|
122781
|
-
args.push(...extraArgs);
|
|
122782
|
-
}
|
|
122783
|
-
const processManager = new ProcessManager({
|
|
122784
|
-
command: EXLLAMAV3_EXECUTABLE,
|
|
122785
|
-
args
|
|
122786
|
-
});
|
|
122787
|
-
await processManager.start();
|
|
122788
|
-
return processManager;
|
|
122853
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122854
|
+
return createEngineProcess({ args, bin: EXLLAMAV3_EXECUTABLE, logger: this.logger });
|
|
122789
122855
|
}
|
|
122790
122856
|
|
|
122791
122857
|
const DEFAULT_LLAMACPP_GPU_LAYERS = 999;
|
|
@@ -122861,10 +122927,7 @@ async function startLlamacpp({ enginePort, targetDirectory }) {
|
|
|
122861
122927
|
if (mainGpu !== null) {
|
|
122862
122928
|
args.push("--main-gpu", String(mainGpu));
|
|
122863
122929
|
}
|
|
122864
|
-
|
|
122865
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
122866
|
-
args.push(...extraArgs);
|
|
122867
|
-
}
|
|
122930
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122868
122931
|
if (this.model.multimodalEnabled) {
|
|
122869
122932
|
const projector = await findMultimodalProjector({ path: targetDirectory });
|
|
122870
122933
|
if (projector) {
|
|
@@ -122879,12 +122942,7 @@ async function startLlamacpp({ enginePort, targetDirectory }) {
|
|
|
122879
122942
|
if (process.env.LLAMACPP_REASONING === "off") {
|
|
122880
122943
|
args.push("--reasoning", "off");
|
|
122881
122944
|
}
|
|
122882
|
-
|
|
122883
|
-
command: LLAMACPP_EXECUTABLE,
|
|
122884
|
-
args
|
|
122885
|
-
});
|
|
122886
|
-
await processManager.start();
|
|
122887
|
-
return processManager;
|
|
122945
|
+
return createEngineProcess({ args, bin: LLAMACPP_EXECUTABLE, logger: this.logger });
|
|
122888
122946
|
}
|
|
122889
122947
|
|
|
122890
122948
|
const MLXLM_EXECUTABLE = process.env.MLXLM_EXECUTABLE ?? "python3";
|
|
@@ -122915,16 +122973,8 @@ async function startMLXLM({ enginePort, targetDirectory }) {
|
|
|
122915
122973
|
if (trustRemoteCode || process.env.MLXLM_TRUST_REMOTE_CODE === "true") {
|
|
122916
122974
|
args.push("--trust-remote-code");
|
|
122917
122975
|
}
|
|
122918
|
-
|
|
122919
|
-
|
|
122920
|
-
args.push(...extraArgs);
|
|
122921
|
-
}
|
|
122922
|
-
const processManager = new ProcessManager({
|
|
122923
|
-
command: MLXLM_EXECUTABLE,
|
|
122924
|
-
args
|
|
122925
|
-
});
|
|
122926
|
-
await processManager.start();
|
|
122927
|
-
return processManager;
|
|
122976
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122977
|
+
return createEngineProcess({ args, bin: MLXLM_EXECUTABLE, logger: this.logger });
|
|
122928
122978
|
}
|
|
122929
122979
|
|
|
122930
122980
|
const SAFE_CHARS = /[a-zA-Z0-9\-_.]/;
|
|
@@ -122982,22 +123032,14 @@ async function startSGLang({ enginePort, targetDirectory }) {
|
|
|
122982
123032
|
if (dtype) {
|
|
122983
123033
|
args.push("--dtype", dtype);
|
|
122984
123034
|
}
|
|
122985
|
-
|
|
122986
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
122987
|
-
args.push(...extraArgs);
|
|
122988
|
-
}
|
|
123035
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122989
123036
|
if (this.model.multimodalEnabled) {
|
|
122990
123037
|
args.push("--limit-mm-per-prompt", process.env.SGLANG_MM_LIMIT ?? '{"image":5}');
|
|
122991
123038
|
}
|
|
122992
123039
|
if (process.env.SGLANG_TRUST_REMOTE_CODE === "true") {
|
|
122993
123040
|
args.push("--trust-remote-code");
|
|
122994
123041
|
}
|
|
122995
|
-
|
|
122996
|
-
command: SGLANG_EXECUTABLE,
|
|
122997
|
-
args
|
|
122998
|
-
});
|
|
122999
|
-
await processManager.start();
|
|
123000
|
-
return processManager;
|
|
123042
|
+
return createEngineProcess({ args, bin: SGLANG_EXECUTABLE, logger: this.logger });
|
|
123001
123043
|
}
|
|
123002
123044
|
|
|
123003
123045
|
const TRTLLM_EXECUTABLE = process.env.TRTLLM_EXECUTABLE ?? "trtllm-serve";
|
|
@@ -123028,16 +123070,8 @@ async function startTensorRTLLM({ enginePort, targetDirectory }) {
|
|
|
123028
123070
|
if (dtype) {
|
|
123029
123071
|
args.push("--dtype", dtype);
|
|
123030
123072
|
}
|
|
123031
|
-
|
|
123032
|
-
|
|
123033
|
-
args.push(...extraArgs);
|
|
123034
|
-
}
|
|
123035
|
-
const processManager = new ProcessManager({
|
|
123036
|
-
command: TRTLLM_EXECUTABLE,
|
|
123037
|
-
args
|
|
123038
|
-
});
|
|
123039
|
-
await processManager.start();
|
|
123040
|
-
return processManager;
|
|
123073
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
123074
|
+
return createEngineProcess({ args, bin: TRTLLM_EXECUTABLE, logger: this.logger });
|
|
123041
123075
|
}
|
|
123042
123076
|
|
|
123043
123077
|
const ENGINE_FETCH_TIMEOUT_MS$1 = 7200000;
|
package/dist/cli.sea.cjs
CHANGED
|
@@ -112721,6 +112721,88 @@ function requireExpressPromiseRouter () {
|
|
|
112721
112721
|
var expressPromiseRouterExports = requireExpressPromiseRouter();
|
|
112722
112722
|
var createRouter = /*@__PURE__*/getDefaultExportFromCjs(expressPromiseRouterExports);
|
|
112723
112723
|
|
|
112724
|
+
const SECRET_FLAGS = new Set([
|
|
112725
|
+
"api-key",
|
|
112726
|
+
"auth-token",
|
|
112727
|
+
"hf-token",
|
|
112728
|
+
"key",
|
|
112729
|
+
"password",
|
|
112730
|
+
"secret",
|
|
112731
|
+
"token"
|
|
112732
|
+
]);
|
|
112733
|
+
function redactSecretArgs(args) {
|
|
112734
|
+
return args.map((arg, index) => {
|
|
112735
|
+
const equalsIndex = arg.indexOf("=");
|
|
112736
|
+
if (arg.startsWith("--") && equalsIndex > 0) {
|
|
112737
|
+
const flag = arg.slice(2, equalsIndex);
|
|
112738
|
+
if (SECRET_FLAGS.has(flag)) {
|
|
112739
|
+
return `${arg.slice(0, equalsIndex + 1)}***`;
|
|
112740
|
+
}
|
|
112741
|
+
}
|
|
112742
|
+
const previous = args[index - 1];
|
|
112743
|
+
if (previous &&
|
|
112744
|
+
previous.startsWith("--") &&
|
|
112745
|
+
!previous.includes("=") &&
|
|
112746
|
+
SECRET_FLAGS.has(previous.slice(2))) {
|
|
112747
|
+
return "***";
|
|
112748
|
+
}
|
|
112749
|
+
return arg;
|
|
112750
|
+
});
|
|
112751
|
+
}
|
|
112752
|
+
async function createEngineProcess({ args, bin, logger }) {
|
|
112753
|
+
logger.info("Starting engine process", {
|
|
112754
|
+
command: { args: redactSecretArgs(args), bin }
|
|
112755
|
+
});
|
|
112756
|
+
const processManager = new ProcessManager({ args, command: bin });
|
|
112757
|
+
await processManager.start();
|
|
112758
|
+
return processManager;
|
|
112759
|
+
}
|
|
112760
|
+
|
|
112761
|
+
function parseExtraArgs(extraArgs) {
|
|
112762
|
+
if (!Array.isArray(extraArgs) ||
|
|
112763
|
+
!extraArgs.every((value) => typeof value === "string")) {
|
|
112764
|
+
return [];
|
|
112765
|
+
}
|
|
112766
|
+
return extraArgs.flatMap(tokenizeShellLine);
|
|
112767
|
+
}
|
|
112768
|
+
function tokenizeShellLine(input) {
|
|
112769
|
+
const tokens = [];
|
|
112770
|
+
let buffer = "";
|
|
112771
|
+
let inQuote = null;
|
|
112772
|
+
let hasBuffer = false;
|
|
112773
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
112774
|
+
const char = input[index];
|
|
112775
|
+
if (inQuote) {
|
|
112776
|
+
if (char === inQuote) {
|
|
112777
|
+
inQuote = null;
|
|
112778
|
+
}
|
|
112779
|
+
else {
|
|
112780
|
+
buffer += char;
|
|
112781
|
+
}
|
|
112782
|
+
hasBuffer = true;
|
|
112783
|
+
}
|
|
112784
|
+
else if (char === '"' || char === "'") {
|
|
112785
|
+
inQuote = char;
|
|
112786
|
+
hasBuffer = true;
|
|
112787
|
+
}
|
|
112788
|
+
else if (char === " " || char === "\t") {
|
|
112789
|
+
if (hasBuffer) {
|
|
112790
|
+
tokens.push(buffer);
|
|
112791
|
+
buffer = "";
|
|
112792
|
+
hasBuffer = false;
|
|
112793
|
+
}
|
|
112794
|
+
}
|
|
112795
|
+
else {
|
|
112796
|
+
buffer += char;
|
|
112797
|
+
hasBuffer = true;
|
|
112798
|
+
}
|
|
112799
|
+
}
|
|
112800
|
+
if (hasBuffer) {
|
|
112801
|
+
tokens.push(buffer);
|
|
112802
|
+
}
|
|
112803
|
+
return tokens;
|
|
112804
|
+
}
|
|
112805
|
+
|
|
112724
112806
|
const balanced = (a, b, str) => {
|
|
112725
112807
|
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
112726
112808
|
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
@@ -121149,22 +121231,14 @@ async function startVLLM({ enginePort, targetDirectory }) {
|
|
|
121149
121231
|
if (dtype) {
|
|
121150
121232
|
args.push("--dtype", dtype);
|
|
121151
121233
|
}
|
|
121152
|
-
|
|
121153
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
121154
|
-
args.push(...extraArgs);
|
|
121155
|
-
}
|
|
121234
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
121156
121235
|
if (this.model.multimodalEnabled) {
|
|
121157
121236
|
args.push("--limit-mm-per-prompt", process.env.VLLM_MM_LIMIT ?? '{"image":5}');
|
|
121158
121237
|
}
|
|
121159
121238
|
if (process.env.VLLM_TRUST_REMOTE_CODE === "true") {
|
|
121160
121239
|
args.push("--trust-remote-code");
|
|
121161
121240
|
}
|
|
121162
|
-
|
|
121163
|
-
command: VLLM_EXECUTABLE,
|
|
121164
|
-
args
|
|
121165
|
-
});
|
|
121166
|
-
await processManager.start();
|
|
121167
|
-
return processManager;
|
|
121241
|
+
return createEngineProcess({ args, bin: VLLM_EXECUTABLE, logger: this.logger });
|
|
121168
121242
|
}
|
|
121169
121243
|
|
|
121170
121244
|
// src/lib/cache-management.ts
|
|
@@ -122791,16 +122865,8 @@ async function startExllamav3({ enginePort, targetDirectory }) {
|
|
|
122791
122865
|
if (gpuSplit) {
|
|
122792
122866
|
args.push("--gpu-split", gpuSplit);
|
|
122793
122867
|
}
|
|
122794
|
-
|
|
122795
|
-
|
|
122796
|
-
args.push(...extraArgs);
|
|
122797
|
-
}
|
|
122798
|
-
const processManager = new ProcessManager({
|
|
122799
|
-
command: EXLLAMAV3_EXECUTABLE,
|
|
122800
|
-
args
|
|
122801
|
-
});
|
|
122802
|
-
await processManager.start();
|
|
122803
|
-
return processManager;
|
|
122868
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122869
|
+
return createEngineProcess({ args, bin: EXLLAMAV3_EXECUTABLE, logger: this.logger });
|
|
122804
122870
|
}
|
|
122805
122871
|
|
|
122806
122872
|
const DEFAULT_LLAMACPP_GPU_LAYERS = 999;
|
|
@@ -122876,10 +122942,7 @@ async function startLlamacpp({ enginePort, targetDirectory }) {
|
|
|
122876
122942
|
if (mainGpu !== null) {
|
|
122877
122943
|
args.push("--main-gpu", String(mainGpu));
|
|
122878
122944
|
}
|
|
122879
|
-
|
|
122880
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
122881
|
-
args.push(...extraArgs);
|
|
122882
|
-
}
|
|
122945
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122883
122946
|
if (this.model.multimodalEnabled) {
|
|
122884
122947
|
const projector = await findMultimodalProjector({ path: targetDirectory });
|
|
122885
122948
|
if (projector) {
|
|
@@ -122894,12 +122957,7 @@ async function startLlamacpp({ enginePort, targetDirectory }) {
|
|
|
122894
122957
|
if (process.env.LLAMACPP_REASONING === "off") {
|
|
122895
122958
|
args.push("--reasoning", "off");
|
|
122896
122959
|
}
|
|
122897
|
-
|
|
122898
|
-
command: LLAMACPP_EXECUTABLE,
|
|
122899
|
-
args
|
|
122900
|
-
});
|
|
122901
|
-
await processManager.start();
|
|
122902
|
-
return processManager;
|
|
122960
|
+
return createEngineProcess({ args, bin: LLAMACPP_EXECUTABLE, logger: this.logger });
|
|
122903
122961
|
}
|
|
122904
122962
|
|
|
122905
122963
|
const MLXLM_EXECUTABLE = process.env.MLXLM_EXECUTABLE ?? "python3";
|
|
@@ -122930,16 +122988,8 @@ async function startMLXLM({ enginePort, targetDirectory }) {
|
|
|
122930
122988
|
if (trustRemoteCode || process.env.MLXLM_TRUST_REMOTE_CODE === "true") {
|
|
122931
122989
|
args.push("--trust-remote-code");
|
|
122932
122990
|
}
|
|
122933
|
-
|
|
122934
|
-
|
|
122935
|
-
args.push(...extraArgs);
|
|
122936
|
-
}
|
|
122937
|
-
const processManager = new ProcessManager({
|
|
122938
|
-
command: MLXLM_EXECUTABLE,
|
|
122939
|
-
args
|
|
122940
|
-
});
|
|
122941
|
-
await processManager.start();
|
|
122942
|
-
return processManager;
|
|
122991
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
122992
|
+
return createEngineProcess({ args, bin: MLXLM_EXECUTABLE, logger: this.logger });
|
|
122943
122993
|
}
|
|
122944
122994
|
|
|
122945
122995
|
const SAFE_CHARS = /[a-zA-Z0-9\-_.]/;
|
|
@@ -122997,22 +123047,14 @@ async function startSGLang({ enginePort, targetDirectory }) {
|
|
|
122997
123047
|
if (dtype) {
|
|
122998
123048
|
args.push("--dtype", dtype);
|
|
122999
123049
|
}
|
|
123000
|
-
|
|
123001
|
-
if (Array.isArray(extraArgs) && extraArgs.every((v) => typeof v === "string")) {
|
|
123002
|
-
args.push(...extraArgs);
|
|
123003
|
-
}
|
|
123050
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
123004
123051
|
if (this.model.multimodalEnabled) {
|
|
123005
123052
|
args.push("--limit-mm-per-prompt", process.env.SGLANG_MM_LIMIT ?? '{"image":5}');
|
|
123006
123053
|
}
|
|
123007
123054
|
if (process.env.SGLANG_TRUST_REMOTE_CODE === "true") {
|
|
123008
123055
|
args.push("--trust-remote-code");
|
|
123009
123056
|
}
|
|
123010
|
-
|
|
123011
|
-
command: SGLANG_EXECUTABLE,
|
|
123012
|
-
args
|
|
123013
|
-
});
|
|
123014
|
-
await processManager.start();
|
|
123015
|
-
return processManager;
|
|
123057
|
+
return createEngineProcess({ args, bin: SGLANG_EXECUTABLE, logger: this.logger });
|
|
123016
123058
|
}
|
|
123017
123059
|
|
|
123018
123060
|
const TRTLLM_EXECUTABLE = process.env.TRTLLM_EXECUTABLE ?? "trtllm-serve";
|
|
@@ -123043,16 +123085,8 @@ async function startTensorRTLLM({ enginePort, targetDirectory }) {
|
|
|
123043
123085
|
if (dtype) {
|
|
123044
123086
|
args.push("--dtype", dtype);
|
|
123045
123087
|
}
|
|
123046
|
-
|
|
123047
|
-
|
|
123048
|
-
args.push(...extraArgs);
|
|
123049
|
-
}
|
|
123050
|
-
const processManager = new ProcessManager({
|
|
123051
|
-
command: TRTLLM_EXECUTABLE,
|
|
123052
|
-
args
|
|
123053
|
-
});
|
|
123054
|
-
await processManager.start();
|
|
123055
|
-
return processManager;
|
|
123088
|
+
args.push(...parseExtraArgs(engineConfig?.extraArgs));
|
|
123089
|
+
return createEngineProcess({ args, bin: TRTLLM_EXECUTABLE, logger: this.logger });
|
|
123056
123090
|
}
|
|
123057
123091
|
|
|
123058
123092
|
const ENGINE_FETCH_TIMEOUT_MS$1 = 7200000;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Logger } from "@infersec/logger";
|
|
2
|
+
import { ProcessManager } from "@infersec/utils";
|
|
3
|
+
export declare function redactSecretArgs(args: Array<string>): Array<string>;
|
|
4
|
+
export declare function createEngineProcess({ args, bin, logger }: {
|
|
5
|
+
args: Array<string>;
|
|
6
|
+
bin: string;
|
|
7
|
+
logger: Logger;
|
|
8
|
+
}): Promise<ProcessManager>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import type { ModelManager } from "../ModelManager.js";
|
|
3
3
|
export declare function startExllamav3(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseExtraArgs(extraArgs: unknown): Array<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import { ModelManager } from "./ModelManager.js";
|
|
3
3
|
export declare function startLlamacpp(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import type { ModelManager } from "./ModelManager.js";
|
|
3
3
|
export declare function startMLXLM(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import type { ModelManager } from "./ModelManager.js";
|
|
3
3
|
export declare function startSGLang(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import type { ModelManager } from "./ModelManager.js";
|
|
3
3
|
export declare function startTensorRTLLM(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessManager } from "@infersec/utils";
|
|
1
|
+
import type { ProcessManager } from "@infersec/utils";
|
|
2
2
|
import type { ModelManager } from "./ModelManager.js";
|
|
3
3
|
export declare function startVLLM(this: ModelManager, { enginePort, targetDirectory }: {
|
|
4
4
|
enginePort: number;
|