@mlx-node/core 0.0.3 → 0.0.5
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/index.cjs +53 -52
- package/index.d.cts +66 -4
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -78,12 +78,12 @@ function requireNative() {
|
|
|
78
78
|
const binding = require('@mlx-node/core-android-arm64');
|
|
79
79
|
const bindingPackageVersion = require('@mlx-node/core-android-arm64/package.json').version;
|
|
80
80
|
if (
|
|
81
|
-
bindingPackageVersion !== '0.0.
|
|
81
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
82
82
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
83
83
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
84
84
|
) {
|
|
85
85
|
throw new Error(
|
|
86
|
-
`Native binding package version mismatch, expected 0.0.
|
|
86
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
return binding;
|
|
@@ -100,12 +100,12 @@ function requireNative() {
|
|
|
100
100
|
const binding = require('@mlx-node/core-android-arm-eabi');
|
|
101
101
|
const bindingPackageVersion = require('@mlx-node/core-android-arm-eabi/package.json').version;
|
|
102
102
|
if (
|
|
103
|
-
bindingPackageVersion !== '0.0.
|
|
103
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
104
104
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
105
105
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
106
106
|
) {
|
|
107
107
|
throw new Error(
|
|
108
|
-
`Native binding package version mismatch, expected 0.0.
|
|
108
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
return binding;
|
|
@@ -130,12 +130,12 @@ function requireNative() {
|
|
|
130
130
|
const binding = require('@mlx-node/core-win32-x64-gnu');
|
|
131
131
|
const bindingPackageVersion = require('@mlx-node/core-win32-x64-gnu/package.json').version;
|
|
132
132
|
if (
|
|
133
|
-
bindingPackageVersion !== '0.0.
|
|
133
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
134
134
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
135
135
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
136
136
|
) {
|
|
137
137
|
throw new Error(
|
|
138
|
-
`Native binding package version mismatch, expected 0.0.
|
|
138
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
return binding;
|
|
@@ -152,12 +152,12 @@ function requireNative() {
|
|
|
152
152
|
const binding = require('@mlx-node/core-win32-x64-msvc');
|
|
153
153
|
const bindingPackageVersion = require('@mlx-node/core-win32-x64-msvc/package.json').version;
|
|
154
154
|
if (
|
|
155
|
-
bindingPackageVersion !== '0.0.
|
|
155
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
156
156
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
157
157
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
158
158
|
) {
|
|
159
159
|
throw new Error(
|
|
160
|
-
`Native binding package version mismatch, expected 0.0.
|
|
160
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
return binding;
|
|
@@ -175,12 +175,12 @@ function requireNative() {
|
|
|
175
175
|
const binding = require('@mlx-node/core-win32-ia32-msvc');
|
|
176
176
|
const bindingPackageVersion = require('@mlx-node/core-win32-ia32-msvc/package.json').version;
|
|
177
177
|
if (
|
|
178
|
-
bindingPackageVersion !== '0.0.
|
|
178
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
179
179
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
180
180
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
181
181
|
) {
|
|
182
182
|
throw new Error(
|
|
183
|
-
`Native binding package version mismatch, expected 0.0.
|
|
183
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
186
|
return binding;
|
|
@@ -197,12 +197,12 @@ function requireNative() {
|
|
|
197
197
|
const binding = require('@mlx-node/core-win32-arm64-msvc');
|
|
198
198
|
const bindingPackageVersion = require('@mlx-node/core-win32-arm64-msvc/package.json').version;
|
|
199
199
|
if (
|
|
200
|
-
bindingPackageVersion !== '0.0.
|
|
200
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
201
201
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
202
202
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
203
203
|
) {
|
|
204
204
|
throw new Error(
|
|
205
|
-
`Native binding package version mismatch, expected 0.0.
|
|
205
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
208
|
return binding;
|
|
@@ -222,12 +222,12 @@ function requireNative() {
|
|
|
222
222
|
const binding = require('@mlx-node/core-darwin-universal');
|
|
223
223
|
const bindingPackageVersion = require('@mlx-node/core-darwin-universal/package.json').version;
|
|
224
224
|
if (
|
|
225
|
-
bindingPackageVersion !== '0.0.
|
|
225
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
226
226
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
227
227
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
228
228
|
) {
|
|
229
229
|
throw new Error(
|
|
230
|
-
`Native binding package version mismatch, expected 0.0.
|
|
230
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
231
231
|
);
|
|
232
232
|
}
|
|
233
233
|
return binding;
|
|
@@ -244,12 +244,12 @@ function requireNative() {
|
|
|
244
244
|
const binding = require('@mlx-node/core-darwin-x64');
|
|
245
245
|
const bindingPackageVersion = require('@mlx-node/core-darwin-x64/package.json').version;
|
|
246
246
|
if (
|
|
247
|
-
bindingPackageVersion !== '0.0.
|
|
247
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
248
248
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
249
249
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
250
250
|
) {
|
|
251
251
|
throw new Error(
|
|
252
|
-
`Native binding package version mismatch, expected 0.0.
|
|
252
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
return binding;
|
|
@@ -266,12 +266,12 @@ function requireNative() {
|
|
|
266
266
|
const binding = require('@mlx-node/core-darwin-arm64');
|
|
267
267
|
const bindingPackageVersion = require('@mlx-node/core-darwin-arm64/package.json').version;
|
|
268
268
|
if (
|
|
269
|
-
bindingPackageVersion !== '0.0.
|
|
269
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
270
270
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
271
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
272
272
|
) {
|
|
273
273
|
throw new Error(
|
|
274
|
-
`Native binding package version mismatch, expected 0.0.
|
|
274
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
return binding;
|
|
@@ -292,12 +292,12 @@ function requireNative() {
|
|
|
292
292
|
const binding = require('@mlx-node/core-freebsd-x64');
|
|
293
293
|
const bindingPackageVersion = require('@mlx-node/core-freebsd-x64/package.json').version;
|
|
294
294
|
if (
|
|
295
|
-
bindingPackageVersion !== '0.0.
|
|
295
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
296
296
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
297
297
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
298
298
|
) {
|
|
299
299
|
throw new Error(
|
|
300
|
-
`Native binding package version mismatch, expected 0.0.
|
|
300
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
303
|
return binding;
|
|
@@ -314,12 +314,12 @@ function requireNative() {
|
|
|
314
314
|
const binding = require('@mlx-node/core-freebsd-arm64');
|
|
315
315
|
const bindingPackageVersion = require('@mlx-node/core-freebsd-arm64/package.json').version;
|
|
316
316
|
if (
|
|
317
|
-
bindingPackageVersion !== '0.0.
|
|
317
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
318
318
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
319
319
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
320
320
|
) {
|
|
321
321
|
throw new Error(
|
|
322
|
-
`Native binding package version mismatch, expected 0.0.
|
|
322
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
return binding;
|
|
@@ -341,12 +341,12 @@ function requireNative() {
|
|
|
341
341
|
const binding = require('@mlx-node/core-linux-x64-musl');
|
|
342
342
|
const bindingPackageVersion = require('@mlx-node/core-linux-x64-musl/package.json').version;
|
|
343
343
|
if (
|
|
344
|
-
bindingPackageVersion !== '0.0.
|
|
344
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
345
345
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
346
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
347
347
|
) {
|
|
348
348
|
throw new Error(
|
|
349
|
-
`Native binding package version mismatch, expected 0.0.
|
|
349
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
352
|
return binding;
|
|
@@ -363,12 +363,12 @@ function requireNative() {
|
|
|
363
363
|
const binding = require('@mlx-node/core-linux-x64-gnu');
|
|
364
364
|
const bindingPackageVersion = require('@mlx-node/core-linux-x64-gnu/package.json').version;
|
|
365
365
|
if (
|
|
366
|
-
bindingPackageVersion !== '0.0.
|
|
366
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
367
367
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
368
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
369
|
) {
|
|
370
370
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 0.0.
|
|
371
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
return binding;
|
|
@@ -387,12 +387,12 @@ function requireNative() {
|
|
|
387
387
|
const binding = require('@mlx-node/core-linux-arm64-musl');
|
|
388
388
|
const bindingPackageVersion = require('@mlx-node/core-linux-arm64-musl/package.json').version;
|
|
389
389
|
if (
|
|
390
|
-
bindingPackageVersion !== '0.0.
|
|
390
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
391
391
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
392
392
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
393
393
|
) {
|
|
394
394
|
throw new Error(
|
|
395
|
-
`Native binding package version mismatch, expected 0.0.
|
|
395
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
396
396
|
);
|
|
397
397
|
}
|
|
398
398
|
return binding;
|
|
@@ -409,12 +409,12 @@ function requireNative() {
|
|
|
409
409
|
const binding = require('@mlx-node/core-linux-arm64-gnu');
|
|
410
410
|
const bindingPackageVersion = require('@mlx-node/core-linux-arm64-gnu/package.json').version;
|
|
411
411
|
if (
|
|
412
|
-
bindingPackageVersion !== '0.0.
|
|
412
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
413
413
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
414
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
415
415
|
) {
|
|
416
416
|
throw new Error(
|
|
417
|
-
`Native binding package version mismatch, expected 0.0.
|
|
417
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
418
|
);
|
|
419
419
|
}
|
|
420
420
|
return binding;
|
|
@@ -433,12 +433,12 @@ function requireNative() {
|
|
|
433
433
|
const binding = require('@mlx-node/core-linux-arm-musleabihf');
|
|
434
434
|
const bindingPackageVersion = require('@mlx-node/core-linux-arm-musleabihf/package.json').version;
|
|
435
435
|
if (
|
|
436
|
-
bindingPackageVersion !== '0.0.
|
|
436
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
437
437
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
438
438
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
439
439
|
) {
|
|
440
440
|
throw new Error(
|
|
441
|
-
`Native binding package version mismatch, expected 0.0.
|
|
441
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
442
442
|
);
|
|
443
443
|
}
|
|
444
444
|
return binding;
|
|
@@ -455,12 +455,12 @@ function requireNative() {
|
|
|
455
455
|
const binding = require('@mlx-node/core-linux-arm-gnueabihf');
|
|
456
456
|
const bindingPackageVersion = require('@mlx-node/core-linux-arm-gnueabihf/package.json').version;
|
|
457
457
|
if (
|
|
458
|
-
bindingPackageVersion !== '0.0.
|
|
458
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
459
459
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
460
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
461
|
) {
|
|
462
462
|
throw new Error(
|
|
463
|
-
`Native binding package version mismatch, expected 0.0.
|
|
463
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
466
|
return binding;
|
|
@@ -479,12 +479,12 @@ function requireNative() {
|
|
|
479
479
|
const binding = require('@mlx-node/core-linux-loong64-musl');
|
|
480
480
|
const bindingPackageVersion = require('@mlx-node/core-linux-loong64-musl/package.json').version;
|
|
481
481
|
if (
|
|
482
|
-
bindingPackageVersion !== '0.0.
|
|
482
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
483
483
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
484
484
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
485
485
|
) {
|
|
486
486
|
throw new Error(
|
|
487
|
-
`Native binding package version mismatch, expected 0.0.
|
|
487
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
490
|
return binding;
|
|
@@ -501,12 +501,12 @@ function requireNative() {
|
|
|
501
501
|
const binding = require('@mlx-node/core-linux-loong64-gnu');
|
|
502
502
|
const bindingPackageVersion = require('@mlx-node/core-linux-loong64-gnu/package.json').version;
|
|
503
503
|
if (
|
|
504
|
-
bindingPackageVersion !== '0.0.
|
|
504
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
505
505
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
506
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
507
507
|
) {
|
|
508
508
|
throw new Error(
|
|
509
|
-
`Native binding package version mismatch, expected 0.0.
|
|
509
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
512
|
return binding;
|
|
@@ -525,12 +525,12 @@ function requireNative() {
|
|
|
525
525
|
const binding = require('@mlx-node/core-linux-riscv64-musl');
|
|
526
526
|
const bindingPackageVersion = require('@mlx-node/core-linux-riscv64-musl/package.json').version;
|
|
527
527
|
if (
|
|
528
|
-
bindingPackageVersion !== '0.0.
|
|
528
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
529
529
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
530
530
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
531
531
|
) {
|
|
532
532
|
throw new Error(
|
|
533
|
-
`Native binding package version mismatch, expected 0.0.
|
|
533
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
534
534
|
);
|
|
535
535
|
}
|
|
536
536
|
return binding;
|
|
@@ -547,12 +547,12 @@ function requireNative() {
|
|
|
547
547
|
const binding = require('@mlx-node/core-linux-riscv64-gnu');
|
|
548
548
|
const bindingPackageVersion = require('@mlx-node/core-linux-riscv64-gnu/package.json').version;
|
|
549
549
|
if (
|
|
550
|
-
bindingPackageVersion !== '0.0.
|
|
550
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
551
551
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
552
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
553
553
|
) {
|
|
554
554
|
throw new Error(
|
|
555
|
-
`Native binding package version mismatch, expected 0.0.
|
|
555
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
556
|
);
|
|
557
557
|
}
|
|
558
558
|
return binding;
|
|
@@ -570,12 +570,12 @@ function requireNative() {
|
|
|
570
570
|
const binding = require('@mlx-node/core-linux-ppc64-gnu');
|
|
571
571
|
const bindingPackageVersion = require('@mlx-node/core-linux-ppc64-gnu/package.json').version;
|
|
572
572
|
if (
|
|
573
|
-
bindingPackageVersion !== '0.0.
|
|
573
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
574
574
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
575
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
576
576
|
) {
|
|
577
577
|
throw new Error(
|
|
578
|
-
`Native binding package version mismatch, expected 0.0.
|
|
578
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
579
|
);
|
|
580
580
|
}
|
|
581
581
|
return binding;
|
|
@@ -592,12 +592,12 @@ function requireNative() {
|
|
|
592
592
|
const binding = require('@mlx-node/core-linux-s390x-gnu');
|
|
593
593
|
const bindingPackageVersion = require('@mlx-node/core-linux-s390x-gnu/package.json').version;
|
|
594
594
|
if (
|
|
595
|
-
bindingPackageVersion !== '0.0.
|
|
595
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
596
596
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
597
597
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
598
598
|
) {
|
|
599
599
|
throw new Error(
|
|
600
|
-
`Native binding package version mismatch, expected 0.0.
|
|
600
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
603
|
return binding;
|
|
@@ -618,12 +618,12 @@ function requireNative() {
|
|
|
618
618
|
const binding = require('@mlx-node/core-openharmony-arm64');
|
|
619
619
|
const bindingPackageVersion = require('@mlx-node/core-openharmony-arm64/package.json').version;
|
|
620
620
|
if (
|
|
621
|
-
bindingPackageVersion !== '0.0.
|
|
621
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
622
622
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
623
623
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
624
624
|
) {
|
|
625
625
|
throw new Error(
|
|
626
|
-
`Native binding package version mismatch, expected 0.0.
|
|
626
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
627
627
|
);
|
|
628
628
|
}
|
|
629
629
|
return binding;
|
|
@@ -640,12 +640,12 @@ function requireNative() {
|
|
|
640
640
|
const binding = require('@mlx-node/core-openharmony-x64');
|
|
641
641
|
const bindingPackageVersion = require('@mlx-node/core-openharmony-x64/package.json').version;
|
|
642
642
|
if (
|
|
643
|
-
bindingPackageVersion !== '0.0.
|
|
643
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
644
644
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
645
645
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
646
646
|
) {
|
|
647
647
|
throw new Error(
|
|
648
|
-
`Native binding package version mismatch, expected 0.0.
|
|
648
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
651
|
return binding;
|
|
@@ -662,12 +662,12 @@ function requireNative() {
|
|
|
662
662
|
const binding = require('@mlx-node/core-openharmony-arm');
|
|
663
663
|
const bindingPackageVersion = require('@mlx-node/core-openharmony-arm/package.json').version;
|
|
664
664
|
if (
|
|
665
|
-
bindingPackageVersion !== '0.0.
|
|
665
|
+
bindingPackageVersion !== '0.0.5' &&
|
|
666
666
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
667
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
668
668
|
) {
|
|
669
669
|
throw new Error(
|
|
670
|
-
`Native binding package version mismatch, expected 0.0.
|
|
670
|
+
`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
671
|
);
|
|
672
672
|
}
|
|
673
673
|
return binding;
|
|
@@ -747,6 +747,7 @@ module.exports.GRPOTrainingEngine = nativeBinding.GRPOTrainingEngine;
|
|
|
747
747
|
module.exports.MxArray = nativeBinding.MxArray;
|
|
748
748
|
module.exports.NativeRewardRegistry = nativeBinding.NativeRewardRegistry;
|
|
749
749
|
module.exports.OutputStore = nativeBinding.OutputStore;
|
|
750
|
+
module.exports.PromptCache = nativeBinding.PromptCache;
|
|
750
751
|
module.exports.Qwen35Model = nativeBinding.Qwen35Model;
|
|
751
752
|
module.exports.Qwen3_5Model = nativeBinding.Qwen3_5Model;
|
|
752
753
|
module.exports.Qwen35MoeModel = nativeBinding.Qwen35MoeModel;
|
package/index.d.cts
CHANGED
|
@@ -63,7 +63,7 @@ export declare class DocLayoutModel {
|
|
|
63
63
|
* # Returns
|
|
64
64
|
* * Vec of LayoutElements sorted by reading order
|
|
65
65
|
*/
|
|
66
|
-
detect(imageData:
|
|
66
|
+
detect(imageData: Uint8Array, threshold?: number | undefined | null): Array<LayoutElement>;
|
|
67
67
|
}
|
|
68
68
|
export type PPDocLayoutV3Model = DocLayoutModel;
|
|
69
69
|
|
|
@@ -87,7 +87,7 @@ export declare class DocOrientationModel {
|
|
|
87
87
|
*
|
|
88
88
|
* Returns classification result plus corrected PNG image bytes.
|
|
89
89
|
*/
|
|
90
|
-
classifyAndRotate(imageData:
|
|
90
|
+
classifyAndRotate(imageData: Uint8Array): ClassifyRotateResult;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
@@ -100,7 +100,7 @@ export declare class DocUnwarpModel {
|
|
|
100
100
|
/** Load a DocUnwarpModel from a directory containing model.safetensors. */
|
|
101
101
|
static load(modelPath: string): DocUnwarpModel;
|
|
102
102
|
/** Unwarp a document image and return the corrected image bytes. */
|
|
103
|
-
unwarp(imageData:
|
|
103
|
+
unwarp(imageData: Uint8Array): UnwarpResult;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/** Result from text generation with detailed metadata */
|
|
@@ -639,6 +639,25 @@ export declare class OutputStore {
|
|
|
639
639
|
queryRaw(sql: string): Promise<string>;
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
+
/**
|
|
643
|
+
* Opaque handle to KV cache state from a previous chat() call.
|
|
644
|
+
*
|
|
645
|
+
* Pass this back to the next chat() call via `model.setCache(cache)`
|
|
646
|
+
* to enable incremental prefill — only new tokens since the last turn
|
|
647
|
+
* are processed, avoiding redundant computation.
|
|
648
|
+
*
|
|
649
|
+
* Created internally by the model when `reuseCache: true` (default).
|
|
650
|
+
* Extract via `model.takeCache()`, restore via `model.setCache(cache)`.
|
|
651
|
+
*/
|
|
652
|
+
export declare class PromptCache {
|
|
653
|
+
/** Number of tokens stored in this cache. */
|
|
654
|
+
get tokenCount(): number;
|
|
655
|
+
/** Whether this cache has been consumed (caches moved out). */
|
|
656
|
+
get isEmpty(): boolean;
|
|
657
|
+
/** Release GPU memory held by this cache. */
|
|
658
|
+
dispose(): void;
|
|
659
|
+
}
|
|
660
|
+
|
|
642
661
|
/**
|
|
643
662
|
* Qwen3.5 Model -- hybrid linear/full attention with optional MoE.
|
|
644
663
|
*
|
|
@@ -653,6 +672,21 @@ export declare class Qwen35Model {
|
|
|
653
672
|
initCaches(): void;
|
|
654
673
|
/** Reset all caches. */
|
|
655
674
|
resetCaches(): void;
|
|
675
|
+
/**
|
|
676
|
+
* Take the KV cache from the model, returning a `PromptCache` handle.
|
|
677
|
+
*
|
|
678
|
+
* The cache is moved out of the model — calling `takeCache()` twice
|
|
679
|
+
* returns `null` the second time. Pass the cache back via `setCache()`
|
|
680
|
+
* before the next `chat()` call for incremental prefill.
|
|
681
|
+
*/
|
|
682
|
+
takeCache(): PromptCache | null;
|
|
683
|
+
/**
|
|
684
|
+
* Restore a previously taken `PromptCache` into the model.
|
|
685
|
+
*
|
|
686
|
+
* On the next `chat()` call with `reuseCache: true`, the model will
|
|
687
|
+
* prefix-match the new tokens against the cache and only prefill the delta.
|
|
688
|
+
*/
|
|
689
|
+
setCache(cache: PromptCache): void;
|
|
656
690
|
/**
|
|
657
691
|
* Forward pass through the model.
|
|
658
692
|
*
|
|
@@ -726,6 +760,21 @@ export type Qwen3_5Model = Qwen35Model;
|
|
|
726
760
|
*/
|
|
727
761
|
export declare class Qwen35MoeModel {
|
|
728
762
|
constructor(config: Qwen35MoeConfig);
|
|
763
|
+
/**
|
|
764
|
+
* Take the KV cache from the model, returning a `PromptCache` handle.
|
|
765
|
+
*
|
|
766
|
+
* The cache is moved out of the model — calling `takeCache()` twice
|
|
767
|
+
* returns `null` the second time. Pass the cache back via `setCache()`
|
|
768
|
+
* before the next `chat()` call for incremental prefill.
|
|
769
|
+
*/
|
|
770
|
+
takeCache(): PromptCache | null;
|
|
771
|
+
/**
|
|
772
|
+
* Restore a previously taken `PromptCache` into the model.
|
|
773
|
+
*
|
|
774
|
+
* On the next `chat()` call with `reuseCache: true`, the model will
|
|
775
|
+
* prefix-match the new tokens against the cache and only prefill the delta.
|
|
776
|
+
*/
|
|
777
|
+
setCache(cache: PromptCache): void;
|
|
729
778
|
initCaches(): void;
|
|
730
779
|
resetCaches(): void;
|
|
731
780
|
forward(inputIds: MxArray): MxArray;
|
|
@@ -771,6 +820,11 @@ export type Qwen3_5MoeModel = Qwen35MoeModel;
|
|
|
771
820
|
export declare class Qwen3Model {
|
|
772
821
|
/** Create a new Qwen3 model with the given configuration */
|
|
773
822
|
constructor(config: Qwen3Config);
|
|
823
|
+
/**
|
|
824
|
+
* Reset the KV cache used for cache reuse across chat() calls.
|
|
825
|
+
* Call this when starting a new conversation to ensure a full prefill.
|
|
826
|
+
*/
|
|
827
|
+
resetCache(): void;
|
|
774
828
|
/**
|
|
775
829
|
* Forward pass through the model
|
|
776
830
|
*
|
|
@@ -1932,6 +1986,14 @@ export interface ChatConfig {
|
|
|
1932
1986
|
enableThinking?: boolean | undefined;
|
|
1933
1987
|
/** When true, include performance metrics (TTFT, prefill tok/s, decode tok/s) in the result */
|
|
1934
1988
|
reportPerformance?: boolean | undefined;
|
|
1989
|
+
/**
|
|
1990
|
+
* Reuse KV cache across chat() calls for incremental prefill. Default: true.
|
|
1991
|
+
* When true, the model preserves its KV cache after generation. On the next
|
|
1992
|
+
* chat() call, it prefix-matches the new token sequence against the cached
|
|
1993
|
+
* tokens and only prefills the delta — avoiding redundant computation for
|
|
1994
|
+
* multi-turn conversations.
|
|
1995
|
+
*/
|
|
1996
|
+
reuseCache?: boolean | undefined;
|
|
1935
1997
|
}
|
|
1936
1998
|
|
|
1937
1999
|
/** Chat message with tool calling support */
|
|
@@ -1996,7 +2058,7 @@ export interface ClassifyRotateResult {
|
|
|
1996
2058
|
/** Angle label as string */
|
|
1997
2059
|
label: string;
|
|
1998
2060
|
/** Corrected image as PNG bytes (or original bytes if angle=0) */
|
|
1999
|
-
image:
|
|
2061
|
+
image: Uint8Array;
|
|
2000
2062
|
}
|
|
2001
2063
|
|
|
2002
2064
|
/** Statistics about cleanup operations (NAPI wrapper) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlx-node/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Internal native bindings - import from @mlx-node/lm or @mlx-node/trl instead",
|
|
5
5
|
"homepage": "https://github.com/mlx-node/mlx-node",
|
|
6
6
|
"bugs": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"oxfmt": "^0.40.0"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@mlx-node/core-darwin-arm64": "0.0.
|
|
39
|
+
"@mlx-node/core-darwin-arm64": "0.0.5"
|
|
40
40
|
},
|
|
41
41
|
"napi": {
|
|
42
42
|
"binaryName": "mlx-core",
|