@qvac/llm-llamacpp 0.63.0 → 0.64.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/README.md +23 -0
- package/package.json +21 -15
- 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/README.md
CHANGED
|
@@ -25,6 +25,7 @@ This native C++ addon, built using the `Bare` Runtime, simplifies running Large
|
|
|
25
25
|
- [Architecture](#architecture)
|
|
26
26
|
- [Benchmarking](#benchmarking)
|
|
27
27
|
- [Tests](#tests)
|
|
28
|
+
- [Fuzzing](#fuzzing)
|
|
28
29
|
- [Glossary](#glossary)
|
|
29
30
|
- [License](#license)
|
|
30
31
|
|
|
@@ -698,6 +699,28 @@ npm run test:cpp:models:ci # exactly what .github/workflows/cpp-tests-llm.yml
|
|
|
698
699
|
|
|
699
700
|
First-run downloads pull several GB from Hugging Face. Every fixture is SHA256-verified against a digest pinned in `scripts/download-unit-test-models.js`; mismatched or partial files are re-downloaded automatically. Set `HF_TOKEN` if a repo requires authentication. Override paths with env vars such as `SHARDED_MODEL_FIRST_SHARD_PATH` (see `test/unit/test_common.hpp`).
|
|
700
701
|
|
|
702
|
+
### Fuzzing
|
|
703
|
+
|
|
704
|
+
`forLogMessage`, `toLowerAscii`, and `matchesAnyStopString` have a
|
|
705
|
+
[Google FuzzTest][fuzztest] target, `llm-string-fuzz`. Fuzzing is Linux-only:
|
|
706
|
+
it needs clang with libFuzzer and AddressSanitizer, CMake 3.25 or newer,
|
|
707
|
+
[vcpkg](https://vcpkg.io/) (set `VCPKG_ROOT`) and `bare-make`. The target does
|
|
708
|
+
not link `@qvac/fabric`, so it runs with full ASan and LeakSanitizer.
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
npm install
|
|
712
|
+
npm run fuzz # bounded run of every FUZZ_TEST, as Linux CI does
|
|
713
|
+
npm run fuzz:continuous # coverage-guided, one FUZZ_TEST at a time
|
|
714
|
+
npm run fuzz:continuous -- LlmStringFuzz.MatchesAnyStopNeverCrashes --fuzz_for=30m
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
Flags other than `--continuous` and `--build-dir` go to the fuzz binary. See
|
|
718
|
+
[`docs/architecture/ADDON-FUZZING.md`](../../docs/architecture/ADDON-FUZZING.md)
|
|
719
|
+
for the fuzzing design, the vcpkg-supplied FuzzTest stack, and how to add a
|
|
720
|
+
target.
|
|
721
|
+
|
|
722
|
+
[fuzztest]: https://github.com/google/fuzztest
|
|
723
|
+
|
|
701
724
|
## Glossary
|
|
702
725
|
|
|
703
726
|
• **Bare Runtime** – Small and modular JavaScript runtime for desktop and mobile. [Learn more](https://docs.pears.com/reference/bare-overview).
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/llm-llamacpp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "llama addon for qvac",
|
|
5
5
|
"addon": true,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run build:ts && npm run build:native",
|
|
8
|
-
"build:native": "bare-make generate && bare-make build && bare-make install",
|
|
8
|
+
"build:native": "bare-make generate -D BUILD_FUZZING=OFF && bare-make build && bare-make install",
|
|
9
9
|
"build:ts": "tsc -p tsconfig.build.json",
|
|
10
10
|
"build:pack": "npm run build:ts && mkdir -p dist && npm pack --pack-destination dist",
|
|
11
11
|
"mobile:copy-prebuilds": "cp -r prebuilds/android-arm64 prebuilds/android-ia32 || echo 'Warning: Failed to copy llamacpp prebuilds to android-ia32'; cp -r prebuilds/android-arm64 prebuilds/android-arm || echo 'Warning: Failed to copy llamacpp prebuilds to android-arm'; cp -r prebuilds/android-arm64 prebuilds/android-x64 || echo 'Warning: Failed to copy llamacpp prebuilds to android-x64'; cp -r prebuilds/ios-arm64 prebuilds/ios-arm64-simulator 2>/dev/null || echo 'iOS prebuilds already present'; cp -r prebuilds/ios-arm64 prebuilds/ios-x64-simulator 2>/dev/null || echo 'iOS prebuilds already present'",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"test:unit:generate": "brittle -r test/unit/all.js test/unit/*.test.js",
|
|
33
33
|
"test:prestage": "node --test scripts/__tests__/*.test.js ../../.github/actions/cache-models/warm-models.test.mjs",
|
|
34
34
|
"test:unit": "npm run build:ts && npm run test:unit:generate && bare test/unit/all.js --exit && npm run test:prestage && npm run test:mobile:validate",
|
|
35
|
-
"test:cpp:build": "bare-make generate -D BUILD_TESTING=ON && bare-make build --target addon-test",
|
|
35
|
+
"test:cpp:build": "bare-make generate -D BUILD_TESTING=ON -D BUILD_FUZZING=OFF && bare-make build --target addon-test",
|
|
36
36
|
"test:cpp:models": "node scripts/download-unit-test-models.js",
|
|
37
37
|
"test:cpp:models:ci": "node scripts/download-unit-test-models.js --ci",
|
|
38
38
|
"test:cpp:run": "node scripts/run-cpp-tests.js",
|
|
39
39
|
"test:cpp:run:ci": "node scripts/run-cpp-tests.js --ci",
|
|
40
40
|
"test:cpp": "npm run test:cpp:build && npm run test:cpp:run",
|
|
41
|
-
"coverage:cpp:build": "bare-make generate -D BUILD_TESTING=ON -D ENABLE_COVERAGE=ON && bare-make build --target addon-test",
|
|
41
|
+
"coverage:cpp:build": "bare-make generate -D BUILD_TESTING=ON -D ENABLE_COVERAGE=ON -D BUILD_FUZZING=OFF && bare-make build --target addon-test",
|
|
42
42
|
"coverage:cpp:run": "node scripts/run-cpp-tests.js --coverage",
|
|
43
43
|
"coverage:cpp:run:ci": "node scripts/run-cpp-tests.js --coverage --ci",
|
|
44
44
|
"coverage:cpp:summary": "cd build/test/unit && llvm-cov report ./addon-test --instr-profile=coverage.profdata -ignore-filename-regex='(tests|build|node_modules|gtest|gmock|\\.vcpkg|/usr)/' > coverage-summary.txt",
|
|
@@ -46,7 +46,13 @@
|
|
|
46
46
|
"coverage:cpp": "npm run coverage:cpp:build && npm run coverage:cpp:run && npm run coverage:cpp:report",
|
|
47
47
|
"test:all": "npm run test:unit && npm run test:integration && npm run test:cpp",
|
|
48
48
|
"benchmarks": "./benchmarks/run-benchmarks.sh",
|
|
49
|
-
"benchmarks:windows": "powershell -ExecutionPolicy Bypass -File ./benchmarks/run-benchmarks.ps1"
|
|
49
|
+
"benchmarks:windows": "powershell -ExecutionPolicy Bypass -File ./benchmarks/run-benchmarks.ps1",
|
|
50
|
+
"fuzz:build": "bare-make generate -D BUILD_FUZZING=ON -D BUILD_TESTING=OFF -D FUZZTEST_FUZZING_MODE=OFF && bare-make build --target llm-string-fuzz",
|
|
51
|
+
"fuzz:build:continuous": "bare-make generate -D BUILD_FUZZING=ON -D BUILD_TESTING=OFF -D FUZZTEST_FUZZING_MODE=ON && bare-make build --target llm-string-fuzz",
|
|
52
|
+
"fuzz:run": "npm run test:scripts && node scripts/run-cpp-fuzz.js",
|
|
53
|
+
"test:scripts": "node --test scripts/__tests__/run-cpp-fuzz.test.js",
|
|
54
|
+
"fuzz": "npm run fuzz:build && npm run fuzz:run",
|
|
55
|
+
"fuzz:continuous": "npm run fuzz:build:continuous && node scripts/run-cpp-fuzz.js --continuous"
|
|
50
56
|
},
|
|
51
57
|
"files": [
|
|
52
58
|
"binding.js",
|
|
@@ -73,8 +79,8 @@
|
|
|
73
79
|
"bugs": "https://github.com/tetherto/qvac/issues",
|
|
74
80
|
"homepage": "https://qvac.tether.io",
|
|
75
81
|
"devDependencies": {
|
|
76
|
-
"@qvac/fabric-android-arm64": "0.
|
|
77
|
-
"@qvac/fabric-ios": "0.
|
|
82
|
+
"@qvac/fabric-android-arm64": "0.23.0",
|
|
83
|
+
"@qvac/fabric-ios": "0.23.0",
|
|
78
84
|
"@types/node": "^24.2.1",
|
|
79
85
|
"bare-crypto": "^1.15.3",
|
|
80
86
|
"bare-process": "^4.2.2",
|
|
@@ -96,22 +102,22 @@
|
|
|
96
102
|
"typescript-eslint": "^8.63.0"
|
|
97
103
|
},
|
|
98
104
|
"dependencies": {
|
|
99
|
-
"@qvac/fabric": "^0.
|
|
105
|
+
"@qvac/fabric": "^0.23.0",
|
|
100
106
|
"@qvac/infer-base": "^0.8.0",
|
|
101
107
|
"@qvac/logging": "^0.1.0",
|
|
102
108
|
"bare-fs": "^4.5.1",
|
|
103
109
|
"bare-path": "^3.0.0"
|
|
104
110
|
},
|
|
105
111
|
"optionalDependencies": {
|
|
106
|
-
"@qvac/fabric-linux-x64": "^0.
|
|
107
|
-
"@qvac/fabric-linux-arm64": "^0.
|
|
108
|
-
"@qvac/fabric-darwin-arm64": "^0.
|
|
109
|
-
"@qvac/fabric-darwin-x64": "^0.
|
|
110
|
-
"@qvac/fabric-win32-x64": "^0.
|
|
112
|
+
"@qvac/fabric-linux-x64": "^0.23.0",
|
|
113
|
+
"@qvac/fabric-linux-arm64": "^0.23.0",
|
|
114
|
+
"@qvac/fabric-darwin-arm64": "^0.23.0",
|
|
115
|
+
"@qvac/fabric-darwin-x64": "^0.23.0",
|
|
116
|
+
"@qvac/fabric-win32-x64": "^0.23.0"
|
|
111
117
|
},
|
|
112
118
|
"peerDependencies": {
|
|
113
|
-
"@qvac/fabric-android-arm64": "^0.
|
|
114
|
-
"@qvac/fabric-ios": "^0.
|
|
119
|
+
"@qvac/fabric-android-arm64": "^0.23.0",
|
|
120
|
+
"@qvac/fabric-ios": "^0.23.0"
|
|
115
121
|
},
|
|
116
122
|
"peerDependenciesMeta": {
|
|
117
123
|
"@qvac/fabric-android-arm64": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|