@infersec/conduit 1.30.0 → 1.31.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/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{start-3r2ov9qj.js → start-DvkkeCrj.js} +40 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ const __dirname = __pathDirname(__filename);
|
|
|
6
6
|
|
|
7
7
|
import { parseArgs } from 'node:util';
|
|
8
8
|
import 'node:crypto';
|
|
9
|
-
import { a as asError, s as startInferenceAgent } from './start-
|
|
9
|
+
import { a as asError, s as startInferenceAgent } from './start-DvkkeCrj.js';
|
|
10
10
|
import 'argon2';
|
|
11
11
|
import 'node:child_process';
|
|
12
12
|
import 'node:stream';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
5
5
|
const __dirname = __pathDirname(__filename);
|
|
6
6
|
|
|
7
7
|
import 'node:crypto';
|
|
8
|
-
import { s as startInferenceAgent, a as asError } from './start-
|
|
8
|
+
import { s as startInferenceAgent, a as asError } from './start-DvkkeCrj.js';
|
|
9
9
|
import 'argon2';
|
|
10
10
|
import 'node:child_process';
|
|
11
11
|
import 'node:stream';
|
|
@@ -15452,6 +15452,22 @@ const ServerToClientAPIRequestSchema = APIRequestSchema.extend({
|
|
|
15452
15452
|
|
|
15453
15453
|
_enum(["inf-end", "inf-src", "storage"]);
|
|
15454
15454
|
|
|
15455
|
+
const PlanSlugSchema = _enum(["basic", "business", "free-trial", "open", "team"]);
|
|
15456
|
+
object({
|
|
15457
|
+
href: string$1(),
|
|
15458
|
+
limits: object({
|
|
15459
|
+
endpoints: number$1().int().nonnegative(),
|
|
15460
|
+
sources: number$1().int().nonnegative(),
|
|
15461
|
+
users: number$1().int().nonnegative()
|
|
15462
|
+
}),
|
|
15463
|
+
monthlyCostEUR: number$1().int().nonnegative(),
|
|
15464
|
+
name: string$1(),
|
|
15465
|
+
slug: PlanSlugSchema,
|
|
15466
|
+
trialDays: number$1().int().positive().nullable(),
|
|
15467
|
+
websiteFeatures: array(string$1()),
|
|
15468
|
+
websiteIconPath: string$1()
|
|
15469
|
+
});
|
|
15470
|
+
|
|
15455
15471
|
function readEnvString(name) {
|
|
15456
15472
|
if (typeof process.env[name] !== "string") {
|
|
15457
15473
|
throw new Error(`Expected environment variable was not present: ${name}`);
|
|
@@ -108413,6 +108429,8 @@ async function startLlamacpp({ targetDirectory }) {
|
|
|
108413
108429
|
return processManager;
|
|
108414
108430
|
}
|
|
108415
108431
|
|
|
108432
|
+
// 2 hours
|
|
108433
|
+
const ENGINE_FETCH_TIMEOUT_MS = 7200000;
|
|
108416
108434
|
class ModelManager extends EventEmitter {
|
|
108417
108435
|
engine;
|
|
108418
108436
|
model;
|
|
@@ -108456,9 +108474,28 @@ class ModelManager extends EventEmitter {
|
|
|
108456
108474
|
async fetchOpenAI(path, opts) {
|
|
108457
108475
|
switch (this.engine) {
|
|
108458
108476
|
case "llama.cpp":
|
|
108459
|
-
case "vllm":
|
|
108460
|
-
|
|
108461
|
-
|
|
108477
|
+
case "vllm": {
|
|
108478
|
+
this.logger.debug(`Fetching from engine: ${path}`);
|
|
108479
|
+
const callerSignal = opts?.signal;
|
|
108480
|
+
const controller = new AbortController();
|
|
108481
|
+
const timeout = setTimeout(() => {
|
|
108482
|
+
controller.abort(new Error("Inference request timeout"));
|
|
108483
|
+
}, ENGINE_FETCH_TIMEOUT_MS);
|
|
108484
|
+
const effectiveSignal = callerSignal ?? controller.signal;
|
|
108485
|
+
try {
|
|
108486
|
+
return await undiciExports.fetch(joinURL("http://localhost:8000", path), {
|
|
108487
|
+
...opts,
|
|
108488
|
+
headers: {
|
|
108489
|
+
...opts?.headers,
|
|
108490
|
+
Connection: "keep-alive"
|
|
108491
|
+
},
|
|
108492
|
+
signal: effectiveSignal
|
|
108493
|
+
});
|
|
108494
|
+
}
|
|
108495
|
+
finally {
|
|
108496
|
+
clearTimeout(timeout);
|
|
108497
|
+
}
|
|
108498
|
+
}
|
|
108462
108499
|
// case "ollama":
|
|
108463
108500
|
// console.log("FETCH", path, opts);
|
|
108464
108501
|
// return fetch(
|