node-llama-cpp 0.0.1 → 1.1.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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/AbortError.d.ts +3 -0
- package/dist/AbortError.js +6 -0
- package/dist/AbortError.js.map +1 -0
- package/dist/ChatPromptWrapper.d.ts +7 -0
- package/dist/ChatPromptWrapper.js +14 -0
- package/dist/ChatPromptWrapper.js.map +1 -0
- package/dist/LlamaChatSession.d.ts +24 -0
- package/dist/LlamaChatSession.js +86 -0
- package/dist/LlamaChatSession.js.map +1 -0
- package/dist/LlamaModel.d.ts +13 -0
- package/dist/LlamaModel.js +43 -0
- package/dist/LlamaModel.js.map +1 -0
- package/dist/chatWrappers/EmptyChatPromptWrapper.d.ts +3 -0
- package/dist/chatWrappers/EmptyChatPromptWrapper.js +4 -0
- package/dist/chatWrappers/EmptyChatPromptWrapper.js.map +1 -0
- package/dist/chatWrappers/LlamaChatPromptWrapper.d.ts +8 -0
- package/dist/chatWrappers/LlamaChatPromptWrapper.js +16 -0
- package/dist/chatWrappers/LlamaChatPromptWrapper.js.map +1 -0
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.js +33 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands/BuildCommand.d.ts +8 -0
- package/dist/cli/commands/BuildCommand.js +41 -0
- package/dist/cli/commands/BuildCommand.js.map +1 -0
- package/dist/cli/commands/ChatCommand.d.ts +8 -0
- package/dist/cli/commands/ChatCommand.js +83 -0
- package/dist/cli/commands/ChatCommand.js.map +1 -0
- package/dist/cli/commands/ClearCommand.d.ts +7 -0
- package/dist/cli/commands/ClearCommand.js +42 -0
- package/dist/cli/commands/ClearCommand.js.map +1 -0
- package/dist/cli/commands/DownloadCommand.d.ts +11 -0
- package/dist/cli/commands/DownloadCommand.js +179 -0
- package/dist/cli/commands/DownloadCommand.js.map +1 -0
- package/dist/cli/commands/OnPostInstallCommand.d.ts +4 -0
- package/dist/cli/commands/OnPostInstallCommand.js +24 -0
- package/dist/cli/commands/OnPostInstallCommand.js.map +1 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +5 -0
- package/dist/commands.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +25 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/clearLlamaBuild.d.ts +1 -0
- package/dist/utils/clearLlamaBuild.js +12 -0
- package/dist/utils/clearLlamaBuild.js.map +1 -0
- package/dist/utils/clearTempFolder.d.ts +1 -0
- package/dist/utils/clearTempFolder.js +16 -0
- package/dist/utils/clearTempFolder.js.map +1 -0
- package/dist/utils/compileLLamaCpp.d.ts +6 -0
- package/dist/utils/compileLLamaCpp.js +43 -0
- package/dist/utils/compileLLamaCpp.js.map +1 -0
- package/dist/utils/getBin.d.ts +18 -0
- package/dist/utils/getBin.js +70 -0
- package/dist/utils/getBin.js.map +1 -0
- package/dist/utils/spawnCommand.d.ts +1 -0
- package/dist/utils/spawnCommand.js +39 -0
- package/dist/utils/spawnCommand.js.map +1 -0
- package/dist/utils/usedBinFlag.d.ts +6 -0
- package/dist/utils/usedBinFlag.js +15 -0
- package/dist/utils/usedBinFlag.js.map +1 -0
- package/dist/utils/withLock.d.ts +1 -0
- package/dist/utils/withLock.js +19 -0
- package/dist/utils/withLock.js.map +1 -0
- package/dist/utils/withOra.d.ts +5 -0
- package/dist/utils/withOra.js +21 -0
- package/dist/utils/withOra.js.map +1 -0
- package/llama/.clang-format +46 -0
- package/llama/addon.cpp +183 -0
- package/llama/binding.gyp +24 -0
- package/llama/usedBin.json +3 -0
- package/llamaBins/linux-arm64-16.node +0 -0
- package/llamaBins/linux-arm64-17.node +0 -0
- package/llamaBins/linux-arm64-18.node +0 -0
- package/llamaBins/linux-arm64-19.node +0 -0
- package/llamaBins/linux-arm64-20.node +0 -0
- package/llamaBins/linux-armv7l-16.node +0 -0
- package/llamaBins/linux-armv7l-17.node +0 -0
- package/llamaBins/linux-armv7l-18.node +0 -0
- package/llamaBins/linux-armv7l-19.node +0 -0
- package/llamaBins/linux-armv7l-20.node +0 -0
- package/llamaBins/linux-ppc64le-16.node +0 -0
- package/llamaBins/linux-ppc64le-17.node +0 -0
- package/llamaBins/linux-ppc64le-18.node +0 -0
- package/llamaBins/linux-ppc64le-19.node +0 -0
- package/llamaBins/linux-ppc64le-20.node +0 -0
- package/llamaBins/linux-x64-16.node +0 -0
- package/llamaBins/linux-x64-17.node +0 -0
- package/llamaBins/linux-x64-18.node +0 -0
- package/llamaBins/linux-x64-19.node +0 -0
- package/llamaBins/linux-x64-20.node +0 -0
- package/llamaBins/mac-arm64-16.node +0 -0
- package/llamaBins/mac-arm64-17.node +0 -0
- package/llamaBins/mac-arm64-18.node +0 -0
- package/llamaBins/mac-arm64-19.node +0 -0
- package/llamaBins/mac-arm64-20.node +0 -0
- package/llamaBins/mac-x64-16.node +0 -0
- package/llamaBins/mac-x64-17.node +0 -0
- package/llamaBins/mac-x64-18.node +0 -0
- package/llamaBins/mac-x64-19.node +0 -0
- package/llamaBins/mac-x64-20.node +0 -0
- package/llamaBins/win-x64-16.node +0 -0
- package/llamaBins/win-x64-17.node +0 -0
- package/llamaBins/win-x64-18.node +0 -0
- package/llamaBins/win-x64-19.node +0 -0
- package/llamaBins/win-x64-20.node +0 -0
- package/package.json +71 -10
package/package.json
CHANGED
|
@@ -1,52 +1,95 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-llama-cpp",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "node.js bindings for llama.cpp",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"node-llama-cpp": "./dist/cli/cli.js"
|
|
10
|
+
},
|
|
8
11
|
"files": [
|
|
9
12
|
"dist/",
|
|
13
|
+
"llama/",
|
|
14
|
+
"llamaBins/",
|
|
10
15
|
"package.json",
|
|
11
|
-
"README.md"
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
12
18
|
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"default": "./dist/index.js",
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"node": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./commands": {
|
|
27
|
+
"default": "./dist/commands.js",
|
|
28
|
+
"import": "./dist/commands.js",
|
|
29
|
+
"node": "./dist/commands.js",
|
|
30
|
+
"types": "./dist/commands.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./commands.js": {
|
|
33
|
+
"default": "./dist/commands.js",
|
|
34
|
+
"import": "./dist/commands.js",
|
|
35
|
+
"node": "./dist/commands.js",
|
|
36
|
+
"types": "./dist/commands.d.ts"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
13
42
|
"scripts": {
|
|
43
|
+
"postinstall": "node ./dist/cli/cli.js postinstall",
|
|
14
44
|
"prepare": "[ $CI = true ] || [ -d '.husky/_' ] || husky install",
|
|
15
45
|
"prebuild": "rm -rf ./dist ./tsconfig.tsbuildinfo",
|
|
16
46
|
"build": "tsc --build tsconfig.json --force",
|
|
17
47
|
"prewatch": "rm -rf ./dist ./tsconfig.tsbuildinfo",
|
|
18
48
|
"watch": "tsc --build tsconfig.json --watch --force",
|
|
49
|
+
"node-gyp-llama": "cd llama && node-gyp",
|
|
50
|
+
"node-gyp-llama-build": "cd llama && cross-env CXXFLAGS=\"-fexceptions\" CFLAGS=\"-fexceptions\" node-gyp build -j max",
|
|
19
51
|
"test": "npm run test:typescript && npm run lint:eslint",
|
|
20
52
|
"test:typescript": "tsc --build tsconfig.json --dry --force",
|
|
21
53
|
"lint": "npm run lint:eslint",
|
|
22
54
|
"lint:eslint": "eslint --ext .js --ext .ts .",
|
|
23
|
-
"
|
|
55
|
+
"format": "npm run lint:eslint -- --fix",
|
|
24
56
|
"clean": "rm -rf ./node_modules ./dist ./tsconfig.tsbuildinfo"
|
|
25
57
|
},
|
|
26
58
|
"repository": {
|
|
27
59
|
"type": "git",
|
|
28
|
-
"url": "git+
|
|
60
|
+
"url": "git+https://github.com/withcatai/node-llama-cpp.git"
|
|
29
61
|
},
|
|
30
62
|
"keywords": [
|
|
31
63
|
"llama",
|
|
32
64
|
"llama-cpp",
|
|
33
65
|
"bindings",
|
|
34
|
-
"node-gyp",
|
|
35
66
|
"ai",
|
|
67
|
+
"node-gyp",
|
|
68
|
+
"prebuilt-binaries",
|
|
36
69
|
"llm",
|
|
37
70
|
"ggml",
|
|
38
|
-
"ggmlv3"
|
|
71
|
+
"ggmlv3",
|
|
72
|
+
"raspberry-pi",
|
|
73
|
+
"self-hosted",
|
|
74
|
+
"local",
|
|
75
|
+
"catai"
|
|
39
76
|
],
|
|
40
77
|
"author": "Gilad S.",
|
|
41
78
|
"license": "ISC",
|
|
42
79
|
"bugs": {
|
|
43
|
-
"url": "https://github.com/
|
|
80
|
+
"url": "https://github.com/withcatai/node-llama-cpp/issues"
|
|
44
81
|
},
|
|
45
|
-
"homepage": "https://github.com/
|
|
82
|
+
"homepage": "https://github.com/withcatai/node-llama-cpp#readme",
|
|
46
83
|
"devDependencies": {
|
|
47
84
|
"@commitlint/cli": "^17.7.1",
|
|
48
85
|
"@commitlint/config-conventional": "^17.7.0",
|
|
86
|
+
"@types/bytes": "^3.1.1",
|
|
87
|
+
"@types/cli-progress": "^3.11.0",
|
|
88
|
+
"@types/cross-spawn": "^6.0.2",
|
|
89
|
+
"@types/fs-extra": "^11.0.1",
|
|
49
90
|
"@types/node": "^20.4.9",
|
|
91
|
+
"@types/uuid": "^9.0.2",
|
|
92
|
+
"@types/yargs": "^17.0.24",
|
|
50
93
|
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
51
94
|
"@typescript-eslint/parser": "^6.3.0",
|
|
52
95
|
"eslint": "^8.46.0",
|
|
@@ -56,6 +99,24 @@
|
|
|
56
99
|
"semantic-release": "^21.0.7",
|
|
57
100
|
"ts-node": "^10.9.1",
|
|
58
101
|
"tslib": "^2.6.1",
|
|
59
|
-
"typescript": "^5.1.6"
|
|
102
|
+
"typescript": "^5.1.6",
|
|
103
|
+
"zx": "^7.2.3"
|
|
104
|
+
},
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"bytes": "^3.1.2",
|
|
107
|
+
"chalk": "^5.3.0",
|
|
108
|
+
"cli-progress": "^3.12.0",
|
|
109
|
+
"cross-env": "^7.0.3",
|
|
110
|
+
"cross-spawn": "^7.0.3",
|
|
111
|
+
"env-var": "^7.3.1",
|
|
112
|
+
"fs-extra": "^11.1.1",
|
|
113
|
+
"node-addon-api": "^7.0.0",
|
|
114
|
+
"node-downloader-helper": "^2.1.9",
|
|
115
|
+
"node-gyp": "^9.4.0",
|
|
116
|
+
"node-stream-zip": "^1.15.0",
|
|
117
|
+
"octokit": "^3.1.0",
|
|
118
|
+
"ora": "^7.0.1",
|
|
119
|
+
"uuid": "^9.0.0",
|
|
120
|
+
"yargs": "^17.7.2"
|
|
60
121
|
}
|
|
61
122
|
}
|