@qvac/llm-llamacpp 0.59.1 → 0.60.0
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/addon.d.ts +0 -1
- package/addon.js +0 -25
- package/binding.js +1 -1
- package/fit.js +1 -6
- package/package.json +24 -6
- package/prebuilds/android-arm64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__llm-llamacpp.bare.exports +1 -1
- package/prebuilds/darwin-x64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/darwin-x64/qvac__llm-llamacpp.bare.exports +1 -1
- package/prebuilds/ios-arm64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/ios-arm64/qvac__llm-llamacpp.bare.exports +1 -1
- package/prebuilds/ios-arm64-simulator/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/ios-arm64-simulator/qvac__llm-llamacpp.bare.exports +1 -1
- package/prebuilds/ios-x64-simulator/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/ios-x64-simulator/qvac__llm-llamacpp.bare.exports +1 -1
- package/prebuilds/linux-arm64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/linux-x64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/win32-x64/qvac__llm-llamacpp.bare +0 -0
- package/prebuilds/win32-x64/qvac__llm-llamacpp.bare.exports +0 -0
package/addon.d.ts
CHANGED
|
@@ -90,7 +90,6 @@ export type MappedAddonEvent = {
|
|
|
90
90
|
* `FinetuneProgress`, or `null` to drop it.
|
|
91
91
|
*/
|
|
92
92
|
export declare function mapAddonEvent(rawEvent: unknown, rawData: unknown, rawError: unknown): MappedAddonEvent | null;
|
|
93
|
-
export declare function resolveBackendsDir(): string;
|
|
94
93
|
/**
|
|
95
94
|
* An interface between Bare addon in C++ and JS runtime.
|
|
96
95
|
*/
|
package/addon.js
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LlamaInterface = void 0;
|
|
4
4
|
exports.mapAddonEvent = mapAddonEvent;
|
|
5
|
-
exports.resolveBackendsDir = resolveBackendsDir;
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-require-imports -- Bare modules expose CommonJS export shapes. */
|
|
7
|
-
const fs = require("bare-fs");
|
|
8
|
-
const path = require("bare-path");
|
|
9
|
-
const fabricBackends = require("@qvac/fabric/backends");
|
|
10
5
|
// Index-matched to the C++ GenerationStopReason enum (SequenceDriver.hpp).
|
|
11
6
|
const STOP_REASONS = [
|
|
12
7
|
"none",
|
|
@@ -72,22 +67,6 @@ function mapAddonEvent(rawEvent, rawData, rawError) {
|
|
|
72
67
|
}
|
|
73
68
|
return { type: type, data: rawData, error: rawError };
|
|
74
69
|
}
|
|
75
|
-
// The ggml compute backends ship next to the @qvac/fabric runtime
|
|
76
|
-
// (<root>/<host>/qvac__fabric). We deliberately do not copy them into this
|
|
77
|
-
// addon to avoid duplicating tens of MB per fabric consumer. On desktop,
|
|
78
|
-
// @qvac/fabric/backends resolves that root in whichever package holds the
|
|
79
|
-
// runtime. On mobile the package tree isn't resolvable at runtime (the worklet
|
|
80
|
-
// runs from a packed bundle), so fall back to this addon's own prebuilds, where
|
|
81
|
-
// the mobile packaging stages the backends. The native side appends
|
|
82
|
-
// BACKENDS_SUBDIR ("<host>/qvac__fabric") to whichever root we return.
|
|
83
|
-
function resolveBackendsDir() {
|
|
84
|
-
// fabric's resolver only checks that the platform package resolves, not that
|
|
85
|
-
// its prebuilds are on disk.
|
|
86
|
-
const fabricRoot = fabricBackends.resolveBackendsDir();
|
|
87
|
-
if (fabricRoot !== null && fs.existsSync(fabricRoot))
|
|
88
|
-
return fabricRoot;
|
|
89
|
-
return path.join(__dirname, "prebuilds");
|
|
90
|
-
}
|
|
91
70
|
/**
|
|
92
71
|
* An interface between Bare addon in C++ and JS runtime.
|
|
93
72
|
*/
|
|
@@ -99,9 +78,6 @@ class LlamaInterface {
|
|
|
99
78
|
if (!configurationParams.config) {
|
|
100
79
|
configurationParams.config = {};
|
|
101
80
|
}
|
|
102
|
-
if (!configurationParams.config.backendsDir) {
|
|
103
|
-
configurationParams.config.backendsDir = resolveBackendsDir();
|
|
104
|
-
}
|
|
105
81
|
this._handle = this._binding.createInstance(this, configurationParams, outputCb, null);
|
|
106
82
|
}
|
|
107
83
|
loadWeights(weightsData) {
|
|
@@ -208,5 +184,4 @@ exports.LlamaInterface = LlamaInterface;
|
|
|
208
184
|
module.exports = {
|
|
209
185
|
LlamaInterface,
|
|
210
186
|
mapAddonEvent,
|
|
211
|
-
resolveBackendsDir,
|
|
212
187
|
};
|
package/binding.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Pre-load @qvac/fabric so its shared .bare module (the llama.cpp + ggml
|
|
2
2
|
// runtime) is registered with the bare runtime before our addon resolves its
|
|
3
|
-
// DT_NEEDED dependency qvac__fabric
|
|
3
|
+
// DT_NEEDED dependency qvac__fabric-<host>@0.bare (shipped by @qvac/fabric-<host>).
|
|
4
4
|
require('@qvac/fabric')
|
|
5
5
|
|
|
6
6
|
module.exports = require.addon()
|
package/fit.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assessFit = assessFit;
|
|
4
|
-
const addon_1 = require("./addon");
|
|
5
4
|
/**
|
|
6
5
|
* Projects one model against the memory free right now, reading GGUF metadata
|
|
7
6
|
* and never weight data. The registry's weightless copy of a model answers the
|
|
@@ -22,9 +21,5 @@ const addon_1 = require("./addon");
|
|
|
22
21
|
function assessFit(request) {
|
|
23
22
|
// eslint-disable-next-line @typescript-eslint/no-require-imports -- native binding is resolved lazily from package prebuilds.
|
|
24
23
|
const binding = require('./binding.js');
|
|
25
|
-
|
|
26
|
-
if (config['backendsDir'] === undefined || config['backendsDir'] === '') {
|
|
27
|
-
config['backendsDir'] = (0, addon_1.resolveBackendsDir)();
|
|
28
|
-
}
|
|
29
|
-
return binding.assessFit({ ...request, config });
|
|
24
|
+
return binding.assessFit({ ...request, config: { ...request.config } });
|
|
30
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/llm-llamacpp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "llama addon for qvac",
|
|
5
5
|
"addon": true,
|
|
6
6
|
"scripts": {
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"bugs": "https://github.com/tetherto/qvac/issues",
|
|
74
74
|
"homepage": "https://qvac.tether.io",
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@qvac/fabric-android-arm64": "
|
|
77
|
-
"@qvac/fabric-ios": "
|
|
76
|
+
"@qvac/fabric-android-arm64": "0.21.1",
|
|
77
|
+
"@qvac/fabric-ios": "0.21.1",
|
|
78
78
|
"@types/node": "^24.2.1",
|
|
79
79
|
"bare-crypto": "^1.15.3",
|
|
80
80
|
"bare-process": "^4.2.2",
|
|
81
81
|
"bare-subprocess": "^6.1.0",
|
|
82
82
|
"bare-url": "^2.1.6",
|
|
83
83
|
"brittle": "^3.16.5",
|
|
84
|
-
"cmake-bare": "^1.
|
|
84
|
+
"cmake-bare": "^1.9.0",
|
|
85
85
|
"cmake-vcpkg": "^1.1.0",
|
|
86
86
|
"eslint": "^9.39.4",
|
|
87
87
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
@@ -96,16 +96,34 @@
|
|
|
96
96
|
"typescript-eslint": "^8.63.0"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@qvac/fabric": "^0.
|
|
99
|
+
"@qvac/fabric": "^0.21.1",
|
|
100
100
|
"@qvac/infer-base": "^0.6.2",
|
|
101
101
|
"@qvac/logging": "^0.1.0",
|
|
102
102
|
"bare-fs": "^4.5.1",
|
|
103
103
|
"bare-path": "^3.0.0"
|
|
104
104
|
},
|
|
105
|
+
"optionalDependencies": {
|
|
106
|
+
"@qvac/fabric-linux-x64": "^0.21.1",
|
|
107
|
+
"@qvac/fabric-linux-arm64": "^0.21.1",
|
|
108
|
+
"@qvac/fabric-darwin-arm64": "^0.21.1",
|
|
109
|
+
"@qvac/fabric-darwin-x64": "^0.21.1",
|
|
110
|
+
"@qvac/fabric-win32-x64": "^0.21.1"
|
|
111
|
+
},
|
|
112
|
+
"peerDependencies": {
|
|
113
|
+
"@qvac/fabric-android-arm64": "^0.21.1",
|
|
114
|
+
"@qvac/fabric-ios": "^0.21.1"
|
|
115
|
+
},
|
|
116
|
+
"peerDependenciesMeta": {
|
|
117
|
+
"@qvac/fabric-android-arm64": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@qvac/fabric-ios": {
|
|
121
|
+
"optional": true
|
|
122
|
+
}
|
|
123
|
+
},
|
|
105
124
|
"engines": {
|
|
106
125
|
"bare": ">=1.24.0"
|
|
107
126
|
},
|
|
108
|
-
"peerDependencies": {},
|
|
109
127
|
"exports": {
|
|
110
128
|
"./package": "./package.json",
|
|
111
129
|
".": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|