@infersec/conduit 1.16.0 → 1.16.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 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-DUnVCZr8.js';
9
+ import { a as asError, s as startInferenceAgent } from './start-Xtxz-3k5.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-DUnVCZr8.js';
8
+ import { s as startInferenceAgent, a as asError } from './start-Xtxz-3k5.js';
9
9
  import 'argon2';
10
10
  import 'node:child_process';
11
11
  import 'node:stream';
@@ -14791,6 +14791,11 @@ const LLMModelSchema = object({
14791
14791
  })
14792
14792
  ])
14793
14793
  });
14794
+ const QuantizationFileSchema = object({
14795
+ filePath: string$1().min(1),
14796
+ sizeBytes: number$1().int().nonnegative().nullable()
14797
+ });
14798
+ array(QuantizationFileSchema);
14794
14799
 
14795
14800
  const InferenceAgentConfigurationSchema = object({
14796
14801
  contextLength: number$1().int().positive().nullable(),
@@ -99576,6 +99581,24 @@ const ModelDownloadProgressSchema = object({
99576
99581
  const DOWNLOAD_PROGRESS_TIMEOUT = 60000;
99577
99582
  const DOWNLOAD_RETRY_ATTEMPTS_FULL = 3;
99578
99583
  const DOWNLOAD_RETRY_ATTEMPTS_RANGE = 10;
99584
+ function matchesQuantizationVariant({ filePath, variant }) {
99585
+ if (!variant) {
99586
+ return false;
99587
+ }
99588
+ const escapedVariant = variant.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
99589
+ const trailingBoundary = variant.includes("_") ? "[\\-./_]" : "[\\-./]";
99590
+ const matcher = new RegExp(`(^|[\\-./_])${escapedVariant}(?=$|${trailingBoundary})`, "i");
99591
+ const normalizedPath = filePath.replace(/\\/g, "/");
99592
+ const segments = normalizedPath.split("/").filter(Boolean);
99593
+ if (segments.length === 0) {
99594
+ return false;
99595
+ }
99596
+ const filename = segments[segments.length - 1].replace(/\.gguf$/i, "");
99597
+ if (matcher.test(filename)) {
99598
+ return true;
99599
+ }
99600
+ return segments.slice(0, -1).some(segment => matcher.test(segment));
99601
+ }
99579
99602
  async function downloadModelViaHuggingFace({ format, huggingFaceToken, modelSlug: rawModelSlug, onProgress, progressFilePath, targetDirectory }) {
99580
99603
  // Sanitise model ID
99581
99604
  const [modelSlugWithRevision, variant = null] = rawModelSlug.split(":");
@@ -99607,7 +99630,10 @@ async function downloadModelViaHuggingFace({ format, huggingFaceToken, modelSlug
99607
99630
  }
99608
99631
  if (variant &&
99609
99632
  filePath.endsWith(".gguf") &&
99610
- filePath.includes(variant.toLowerCase()) === false) {
99633
+ !matchesQuantizationVariant({
99634
+ filePath: file.path,
99635
+ variant
99636
+ })) {
99611
99637
  console.log("Skipping due variant not being needed:", file.path, file.size);
99612
99638
  continue;
99613
99639
  }
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.16.0",
4
+ "version": "1.16.1",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },