@infersec/conduit 1.113.0 → 1.114.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.
@@ -2,6 +2,7 @@ import type { CreateEngineBody, UpdateEngineBody } from "../managementClient/ind
2
2
  import type { ManagementCommandOptions } from "./managementOptions.js";
3
3
  export interface EngineCreateCommandOptions extends ManagementCommandOptions {
4
4
  arg?: string[];
5
+ baseUrl?: string;
5
6
  type?: string;
6
7
  }
7
8
  export declare function buildEngineCreateBody(options: EngineCreateCommandOptions): CreateEngineBody;
@@ -18,8 +18,11 @@ export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
18
18
  private uniqueName;
19
19
  readonly contextLength: number | null;
20
20
  protected readonly logger: Logger;
21
+ private discoveredModelNames;
22
+ private customProbeCount;
21
23
  private engineProcess;
22
24
  private healthPollInterval;
25
+ private lastCustomReadinessReport;
23
26
  private lastEngineError;
24
27
  private lifecycleState;
25
28
  private downloadLockHandle;
@@ -49,8 +52,12 @@ export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
49
52
  get lastExitCode(): number | null;
50
53
  get lastExitSignal(): NodeJS.Signals | null;
51
54
  get state(): EngineLifecycleState;
55
+ get resolvedServedModelName(): string | null;
52
56
  get wasRunning(): boolean;
57
+ private get customBaseURL();
53
58
  private checkEngineReadiness;
59
+ private checkCustomReadiness;
60
+ private reportCustomReadinessChange;
54
61
  private checkGenericHealthReadiness;
55
62
  private checkLlamacppReadiness;
56
63
  private checkVLLMReadiness;
@@ -60,6 +67,7 @@ export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
60
67
  private get lockFilePath();
61
68
  private acquireDownloadLock;
62
69
  private recordEngineError;
70
+ private requireCustomBaseURL;
63
71
  private releaseDownloadLock;
64
72
  private bindEngineProcessEvents;
65
73
  private startEngineProcess;
@@ -19,7 +19,8 @@ export interface EngineExecutionReportSource {
19
19
  * Flattens flat CLI extra-arg tokens into [arg, value] pairs, sorted by ARG NAME (ascending, ties by
20
20
  * value). `--flag=value` pairs split on the first `=`; a bare `--flag` consumes the following token
21
21
  * as its value when that token does not start with "-" (classic CLI convention); anything else
22
- * (flags, non-strings) is dropped.
22
+ * (flags, non-strings) is dropped. Secret-like option values are masked before pairing so they
23
+ * never reach execution reports.
23
24
  */
24
25
  export declare function pairExtraArgs(tokens: unknown): Array<[string, string]>;
25
26
  /**
@@ -27,6 +27,7 @@ interface MonitorEngineResponseOptions extends EngineMetricsLoggerOptions {
27
27
  engineType: string;
28
28
  onComplete?: (result: EngineMetricsCompletion) => void | Promise<void>;
29
29
  requestStartedAt?: number;
30
+ responseModelName?: string | null;
30
31
  }
31
32
  interface EngineMetricsLogOptions extends EngineMetricsLoggerOptions {
32
33
  error?: Error;
@@ -37,7 +38,7 @@ interface EngineMetricsLogOptions extends EngineMetricsLoggerOptions {
37
38
  interface MonitorEngineResponseResult {
38
39
  stream: Readable;
39
40
  }
40
- export declare function monitorEngineResponseStream({ agentEngineType, body, contextLength, engineConfig, engineType, logger, onComplete, requestBodyBytes, requestPath, requestStartedAt }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
41
- export declare function monitorEngineResponseSingle({ agentEngineType, body, contextLength, engineConfig, engineType, logger, onComplete, requestBodyBytes, requestPath, requestStartedAt }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
41
+ export declare function monitorEngineResponseStream({ agentEngineType, body, contextLength, engineConfig, engineType, logger, onComplete, requestBodyBytes, requestPath, requestStartedAt, responseModelName }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
42
+ export declare function monitorEngineResponseSingle({ agentEngineType, body, contextLength, engineConfig, engineType, logger, onComplete, requestBodyBytes, requestPath, requestStartedAt, responseModelName }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
42
43
  export declare function logEngineMetrics({ agentEngineType, error, level, logger, requestBodyBytes, requestPath, responseBytes, usage }: EngineMetricsLogOptions): void;
43
44
  export {};
@@ -19,6 +19,14 @@ export declare function applyChatTemplateKwargs({ body, model }: {
19
19
  body: PlainObject;
20
20
  model: LLMModel;
21
21
  }): PlainObject;
22
+ export declare function serializeRequestBody(body: unknown, { model, path, servedModelName }?: {
23
+ model?: LLMModel;
24
+ path?: string;
25
+ servedModelName?: string | null;
26
+ }): {
27
+ bytes: number;
28
+ payload: string;
29
+ };
22
30
  export declare function proxyEmbeddingsRoute({ body, conduitConfiguration, endpointId, logger, modelID, modelManager, reportMetrics, signal }: {
23
31
  body: unknown;
24
32
  conduitConfiguration: InferenceAgentConfiguration;
@@ -36,6 +44,12 @@ export declare function proxyEmbeddingsRoute({ body, conduitConfiguration, endpo
36
44
  status: number;
37
45
  statusText: string;
38
46
  }>;
47
+ /**
48
+ * Forwards upstream headers, dropping content-length when the response body
49
+ * is rewritten (model-name substitution changes its length; a stale
50
+ * content-length desyncs the stream and aborts downstream readers).
51
+ */
52
+ export declare function buildProxyResponseHeaders(headers: Headers, rewriteActive: boolean): Record<string, string>;
39
53
  export declare function proxyOpenAIStreamingRoute({ body, conduitConfiguration, endpointId, logger, modelID, modelManager, path, reportMetrics, signal }: {
40
54
  body: unknown;
41
55
  conduitConfiguration: InferenceAgentConfiguration;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infersec/conduit",
3
3
  "description": "End user conduit agent for connecting local LLMs to the cloud.",
4
- "version": "1.113.0",
4
+ "version": "1.114.1",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },