node-llama-cpp 3.0.0 → 3.0.2
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 +1 -1
- package/dist/cli/recommendedModels.js +48 -118
- package/dist/cli/recommendedModels.js.map +1 -1
- package/llama/binariesGithubRelease.json +1 -1
- package/llama/gitRelease.bundle +0 -0
- package/llama/llama.cpp.info.json +1 -1
- package/package.json +12 -12
- package/templates/packed/node-typescript.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img alt="node-llama-cpp Logo" src="https://raw.githubusercontent.com/withcatai/node-llama-cpp/master/assets/logo.v3.roundEdges.
|
|
2
|
+
<img alt="node-llama-cpp Logo" src="https://raw.githubusercontent.com/withcatai/node-llama-cpp/master/assets/logo.v3.roundEdges.avif" width="360px" />
|
|
3
3
|
<h1>node-llama-cpp</h1>
|
|
4
4
|
<p>Run AI models locally on your machine</p>
|
|
5
5
|
<sub>Pre-built bindings are provided with a fallback to building from source with cmake</sub>
|
|
@@ -72,6 +72,37 @@ export const recommendedModels = [{
|
|
|
72
72
|
file: "Meta-Llama-3.1-405B-Instruct.Q3_K_M.gguf.part1of4"
|
|
73
73
|
}
|
|
74
74
|
}]
|
|
75
|
+
}, {
|
|
76
|
+
name: "Mistral Nemo 12B",
|
|
77
|
+
abilities: ["chat", "complete", "functionCalling"],
|
|
78
|
+
description: "Mistral Nemo model was created by Mistral AI and was trained on large proportion of multilingual and code data, with support for function calling.\n" +
|
|
79
|
+
"It was trained jointly by Mistral AI and NVIDIA.\n" +
|
|
80
|
+
"This is a 12 billion parameters model.",
|
|
81
|
+
fileOptions: [{
|
|
82
|
+
huggingFace: {
|
|
83
|
+
model: "mradermacher/Mistral-Nemo-Instruct-2407-GGUF",
|
|
84
|
+
branch: "main",
|
|
85
|
+
file: "Mistral-Nemo-Instruct-2407.Q8_0.gguf"
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
huggingFace: {
|
|
89
|
+
model: "mradermacher/Mistral-Nemo-Instruct-2407-GGUF",
|
|
90
|
+
branch: "main",
|
|
91
|
+
file: "Mistral-Nemo-Instruct-2407.Q6_K.gguf"
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
huggingFace: {
|
|
95
|
+
model: "mradermacher/Mistral-Nemo-Instruct-2407-GGUF",
|
|
96
|
+
branch: "main",
|
|
97
|
+
file: "Mistral-Nemo-Instruct-2407.Q4_K_M.gguf"
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
huggingFace: {
|
|
101
|
+
model: "mradermacher/Mistral-Nemo-Instruct-2407-GGUF",
|
|
102
|
+
branch: "main",
|
|
103
|
+
file: "Mistral-Nemo-Instruct-2407.Q4_K_S.gguf"
|
|
104
|
+
}
|
|
105
|
+
}]
|
|
75
106
|
}, {
|
|
76
107
|
name: "Phi 3 3.8B",
|
|
77
108
|
abilities: ["chat", "complete", "functionCalling"],
|
|
@@ -91,58 +122,41 @@ export const recommendedModels = [{
|
|
|
91
122
|
}
|
|
92
123
|
}]
|
|
93
124
|
}, {
|
|
94
|
-
name: "
|
|
95
|
-
abilities: ["chat"
|
|
96
|
-
description: "
|
|
97
|
-
"
|
|
125
|
+
name: "OLMoE 1B 7B MoE",
|
|
126
|
+
abilities: ["chat"],
|
|
127
|
+
description: "OLMoE models were created by AllenAI, and are fully open source models that utilize a Mixture of Experts architecture.\n" +
|
|
128
|
+
"Mixtures of Experts (MoE) is a technique where different models, each skilled in solving a particular kind of problem, work together to the improve the overall performance on complex tasks.\n" +
|
|
129
|
+
"This model includes 64 expert models, with a total of 7 billion parameters.\n" +
|
|
130
|
+
"This model generates output extremely fast.",
|
|
98
131
|
fileOptions: [{
|
|
99
132
|
huggingFace: {
|
|
100
|
-
model: "
|
|
133
|
+
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
101
134
|
branch: "main",
|
|
102
|
-
file: "
|
|
135
|
+
file: "olmoe-1b-7b-0924-instruct-q8_0.gguf"
|
|
103
136
|
}
|
|
104
137
|
}, {
|
|
105
138
|
huggingFace: {
|
|
106
|
-
model: "
|
|
107
|
-
branch: "main",
|
|
108
|
-
file: "llama-2-7b-chat.Q4_K_M.gguf"
|
|
109
|
-
}
|
|
110
|
-
}]
|
|
111
|
-
}, {
|
|
112
|
-
name: "Llama 2 Chat 13B",
|
|
113
|
-
abilities: ["chat", "complete"],
|
|
114
|
-
description: "Llama 2 Chat model was created by Meta and is optimized for an assistant-like chat use cases.\n" +
|
|
115
|
-
"This is the 13 billion parameters version of the model.",
|
|
116
|
-
fileOptions: [{
|
|
117
|
-
huggingFace: {
|
|
118
|
-
model: "TheBloke/Llama-2-13B-chat-GGUF",
|
|
139
|
+
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
119
140
|
branch: "main",
|
|
120
|
-
file: "
|
|
141
|
+
file: "olmoe-1b-7b-0924-instruct-q6_k.gguf"
|
|
121
142
|
}
|
|
122
143
|
}, {
|
|
123
144
|
huggingFace: {
|
|
124
|
-
model: "
|
|
145
|
+
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
125
146
|
branch: "main",
|
|
126
|
-
file: "
|
|
147
|
+
file: "olmoe-1b-7b-0924-instruct-q5_k_m.gguf"
|
|
127
148
|
}
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
name: "Llama 2 Chat 70B",
|
|
131
|
-
abilities: ["chat", "complete"],
|
|
132
|
-
description: "Llama 2 Chat model was created by Meta and is optimized for an assistant-like chat use cases.\n" +
|
|
133
|
-
"This is the 70 billion parameters version of the model. " +
|
|
134
|
-
"You need a GPU with a lot of VRAM to use this version.",
|
|
135
|
-
fileOptions: [{
|
|
149
|
+
}, {
|
|
136
150
|
huggingFace: {
|
|
137
|
-
model: "
|
|
151
|
+
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
138
152
|
branch: "main",
|
|
139
|
-
file: "
|
|
153
|
+
file: "olmoe-1b-7b-0924-instruct-q4_k_s.gguf"
|
|
140
154
|
}
|
|
141
155
|
}, {
|
|
142
156
|
huggingFace: {
|
|
143
|
-
model: "
|
|
157
|
+
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
144
158
|
branch: "main",
|
|
145
|
-
file: "
|
|
159
|
+
file: "olmoe-1b-7b-0924-instruct-q4_k_m.gguf"
|
|
146
160
|
}
|
|
147
161
|
}]
|
|
148
162
|
}, {
|
|
@@ -201,90 +215,6 @@ export const recommendedModels = [{
|
|
|
201
215
|
file: "dolphin-2.5-mixtral-8x7b.Q4_K_M.gguf"
|
|
202
216
|
}
|
|
203
217
|
}]
|
|
204
|
-
}, /* {
|
|
205
|
-
name: "Functionary Medium v2.4",
|
|
206
|
-
abilities: ["chat", "complete", "functionCalling"],
|
|
207
|
-
description: "Functionary models were created by Meetkai and are optimized for function calling.\n" +
|
|
208
|
-
"This is the medium version of the model.",
|
|
209
|
-
|
|
210
|
-
fileOptions: [{
|
|
211
|
-
huggingFace: {
|
|
212
|
-
model: "meetkai/functionary-medium-v2.4-GGUF",
|
|
213
|
-
branch: "main",
|
|
214
|
-
file: "functionary-medium-v2.4.Q8_0.gguf"
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
huggingFace: {
|
|
218
|
-
model: "meetkai/functionary-medium-v2.4-GGUF",
|
|
219
|
-
branch: "main",
|
|
220
|
-
file: "functionary-medium-v2.4.Q4_0.gguf"
|
|
221
|
-
}
|
|
222
|
-
}]
|
|
223
|
-
}, */ /* {
|
|
224
|
-
name: "Functionary Small v2.5",
|
|
225
|
-
abilities: ["chat", "complete", "functionCalling"],
|
|
226
|
-
description: "Functionary models were created by Meetkai and are optimized for function calling.\n" +
|
|
227
|
-
"This model is based on Llama 3.\n" +
|
|
228
|
-
"This is the small version of the model.",
|
|
229
|
-
|
|
230
|
-
fileOptions: [{
|
|
231
|
-
huggingFace: {
|
|
232
|
-
model: "meetkai/functionary-small-v2.5-GGUF",
|
|
233
|
-
branch: "main",
|
|
234
|
-
file: "functionary-small-v2.5.f16.gguf"
|
|
235
|
-
}
|
|
236
|
-
}, {
|
|
237
|
-
huggingFace: {
|
|
238
|
-
model: "meetkai/functionary-small-v2.5-GGUF",
|
|
239
|
-
branch: "main",
|
|
240
|
-
file: "functionary-small-v2.5.Q8_0.gguf"
|
|
241
|
-
}
|
|
242
|
-
}, {
|
|
243
|
-
huggingFace: {
|
|
244
|
-
model: "meetkai/functionary-small-v2.5-GGUF",
|
|
245
|
-
branch: "main",
|
|
246
|
-
file: "functionary-small-v2.5.Q4_0.gguf"
|
|
247
|
-
}
|
|
248
|
-
}]
|
|
249
|
-
}, */
|
|
250
|
-
{
|
|
251
|
-
name: "OLMoE 1b 7B MoE",
|
|
252
|
-
abilities: ["chat"],
|
|
253
|
-
description: "OLMoE models were created by AllenAI, and are fully open source models that utilize a Mixture of Experts architecture" +
|
|
254
|
-
"Mixtures of Experts (MoE) is a technique where different models, each skilled in solving a particular kind of problem, work together to the improve the overall performance on complex tasks.\n" +
|
|
255
|
-
"This model includes 64 expert models, with a total of 7 billion parameters.\n" +
|
|
256
|
-
"This model generates output extremely fast.",
|
|
257
|
-
fileOptions: [{
|
|
258
|
-
huggingFace: {
|
|
259
|
-
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
260
|
-
branch: "main",
|
|
261
|
-
file: "olmoe-1b-7b-0924-instruct-q8_0.gguf"
|
|
262
|
-
}
|
|
263
|
-
}, {
|
|
264
|
-
huggingFace: {
|
|
265
|
-
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
266
|
-
branch: "main",
|
|
267
|
-
file: "olmoe-1b-7b-0924-instruct-q6_k.gguf"
|
|
268
|
-
}
|
|
269
|
-
}, {
|
|
270
|
-
huggingFace: {
|
|
271
|
-
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
272
|
-
branch: "main",
|
|
273
|
-
file: "olmoe-1b-7b-0924-instruct-q5_k_m.gguf"
|
|
274
|
-
}
|
|
275
|
-
}, {
|
|
276
|
-
huggingFace: {
|
|
277
|
-
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
278
|
-
branch: "main",
|
|
279
|
-
file: "olmoe-1b-7b-0924-instruct-q4_k_s.gguf"
|
|
280
|
-
}
|
|
281
|
-
}, {
|
|
282
|
-
huggingFace: {
|
|
283
|
-
model: "allenai/OLMoE-1B-7B-0924-Instruct-GGUF",
|
|
284
|
-
branch: "main",
|
|
285
|
-
file: "olmoe-1b-7b-0924-instruct-q4_k_m.gguf"
|
|
286
|
-
}
|
|
287
|
-
}]
|
|
288
218
|
}, {
|
|
289
219
|
name: "Gemma 2 9B",
|
|
290
220
|
abilities: ["chat", "complete"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommendedModels.js","sourceRoot":"","sources":["../../src/cli/recommendedModels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAA0B,CAAC;QACrD,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,CAAC;QAClD,WAAW,EAAE,iIAAiI;YAC1I,wDAAwD;QAE5D,WAAW,EAAE,CAAC;gBACV,WAAW,EAAE;oBACT,KAAK,EAAE,8CAA8C;oBACrD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,sCAAsC;iBAC/C;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,8CAA8C;oBACrD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,sCAAsC;iBAC/C;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,8CAA8C;oBACrD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,wCAAwC;iBACjD;aACJ,CAAC;KACL,EAAE;QACC,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,CAAC;QAClD,WAAW,EAAE,iIAAiI;YAC1I,0DAA0D;YAC1D,wDAAwD;QAE5D,WAAW,EAAE,CAAC;gBACV,WAAW,EAAE;oBACT,KAAK,EAAE,+CAA+C;oBACtD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,gDAAgD;iBACzD;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,+CAA+C;oBACtD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,gDAAgD;iBACzD;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,+CAA+C;oBACtD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,yCAAyC;iBAClD;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,+CAA+C;oBACtD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,yCAAyC;iBAClD;aACJ,CAAC;KACL,EAAE;QACC,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,CAAC;QAClD,WAAW,EAAE,iIAAiI;YAC1I,yJAAyJ;YACzJ,qEAAqE;QAEzE,WAAW,EAAE,CAAC;gBACV,WAAW,EAAE;oBACT,KAAK,EAAE,gDAAgD;oBACvD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,mDAAmD;iBAC5D;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,gDAAgD;oBACvD,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,mDAAmD;iBAC5D;aACJ,CAAC;KACL,EAAE;QACC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"recommendedModels.js","sourceRoot":"","sources":["../../src/cli/recommendedModels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAA0B,CAAC;QACrD,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,CAAC;QAClD,WAAW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3C,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,iCAAiC;iBAC1C;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,iCAAiC;iBAC1C;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,iCAAiC;iBAC1C;aACJ,CAAC;KACL,EAAE;QACC,IAAI,EAAE,yBAAyB;QAC/B,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC;QACzC,WAAW,EAAE,wFAAwF;QAErG,WAAW,EAAE,CAAC;gBACV,WAAW,EAAE;oBACT,KAAK,EAAE,qCAAqC;oBAC5C,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,4BAA4B;iBACrC;aACJ,EAAE;gBACC,WAAW,EAAE;oBACT,KAAK,EAAE,qCAAqC;oBAC5C,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,4BAA4B;iBACrC;aACJ,CAAC;KACL,CAAC,CAAC"}
|
package/llama/gitRelease.bundle
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-llama-cpp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Run AI models locally on your machine with node.js bindings for llama.cpp. Enforce a JSON schema on the model output on the generation level",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -209,16 +209,16 @@
|
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
"optionalDependencies": {
|
|
212
|
-
"@node-llama-cpp/linux-arm64": "3.0.
|
|
213
|
-
"@node-llama-cpp/linux-armv7l": "3.0.
|
|
214
|
-
"@node-llama-cpp/linux-x64": "3.0.
|
|
215
|
-
"@node-llama-cpp/linux-x64-cuda": "3.0.
|
|
216
|
-
"@node-llama-cpp/linux-x64-vulkan": "3.0.
|
|
217
|
-
"@node-llama-cpp/mac-arm64-metal": "3.0.
|
|
218
|
-
"@node-llama-cpp/mac-x64": "3.0.
|
|
219
|
-
"@node-llama-cpp/win-arm64": "3.0.
|
|
220
|
-
"@node-llama-cpp/win-x64": "3.0.
|
|
221
|
-
"@node-llama-cpp/win-x64-cuda": "3.0.
|
|
222
|
-
"@node-llama-cpp/win-x64-vulkan": "3.0.
|
|
212
|
+
"@node-llama-cpp/linux-arm64": "3.0.2",
|
|
213
|
+
"@node-llama-cpp/linux-armv7l": "3.0.2",
|
|
214
|
+
"@node-llama-cpp/linux-x64": "3.0.2",
|
|
215
|
+
"@node-llama-cpp/linux-x64-cuda": "3.0.2",
|
|
216
|
+
"@node-llama-cpp/linux-x64-vulkan": "3.0.2",
|
|
217
|
+
"@node-llama-cpp/mac-arm64-metal": "3.0.2",
|
|
218
|
+
"@node-llama-cpp/mac-x64": "3.0.2",
|
|
219
|
+
"@node-llama-cpp/win-arm64": "3.0.2",
|
|
220
|
+
"@node-llama-cpp/win-x64": "3.0.2",
|
|
221
|
+
"@node-llama-cpp/win-x64-cuda": "3.0.2",
|
|
222
|
+
"@node-llama-cpp/win-x64-vulkan": "3.0.2"
|
|
223
223
|
}
|
|
224
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":[{"path":[".editorconfig"],"content":"root = true\n\n[*]\nindent_style = space\nindent_size = 4\n\n[{*.ts,*.tsx,*.js,*.jsx,*.css,*.scss}]\ninsert_final_newline = true\n\n[{package.json,package-lock.json,manifest.json}]\nindent_size = 2\n\n[*.yml]\nindent_size = 2\n"},{"path":[".eslintrc.json"],"content":"{\n \"root\": true,\n \"env\": {\n \"node\": true,\n \"browser\": false,\n \"es6\": true\n },\n \"ignorePatterns\": [\"/dist\", \"/models\"],\n \"extends\": [\n \"eslint:recommended\",\n \"plugin:jsdoc/recommended\"\n ],\n \"globals\": {\n \"Atomics\": \"readonly\",\n \"SharedArrayBuffer\": \"readonly\"\n },\n \"parserOptions\": {\n \"ecmaVersion\": 2023,\n \"sourceType\": \"module\"\n },\n \"overrides\": [{\n \"files\": [\"**.ts\"],\n \"extends\": [\n \"eslint:recommended\",\n \"plugin:@typescript-eslint/recommended\",\n \"plugin:jsdoc/recommended-typescript\"\n ],\n \"parser\": \"@typescript-eslint/parser\",\n \"plugins\": [\n \"@typescript-eslint\",\n \"import\",\n \"jsdoc\",\n \"n\"\n ],\n \"rules\": {\n \"@typescript-eslint/explicit-module-boundary-types\": [\"off\"],\n \"@typescript-eslint/ban-ts-comment\": [\"off\"],\n \"@typescript-eslint/no-explicit-any\": [\"off\"],\n \"semi\": [\"off\"],\n \"@typescript-eslint/semi\": [\"warn\", \"always\"],\n \"@typescript-eslint/no-inferrable-types\": [\"off\"],\n \"@typescript-eslint/member-ordering\": [\"warn\", {\n \"default\": [\"field\", \"constructor\", \"method\", \"signature\"],\n \"typeLiterals\": []\n }],\n \"@typescript-eslint/parameter-properties\": [\"warn\", {\n \"allow\": []\n }],\n \"@typescript-eslint/explicit-member-accessibility\": [\"warn\"],\n \"@typescript-eslint/member-delimiter-style\": [\"warn\", {\n \"multiline\": {\n \"delimiter\": \"comma\",\n \"requireLast\": false\n },\n \"singleline\": {\n \"delimiter\": \"comma\",\n \"requireLast\": false\n },\n \"multilineDetection\": \"brackets\"\n }],\n \"jsdoc/require-param\": [\"off\"],\n \"jsdoc/check-param-names\": [\"warn\", {\n \"checkDestructured\": false\n }],\n \"jsdoc/require-returns\": [\"off\"],\n \"jsdoc/require-jsdoc\": [\"off\"],\n \"jsdoc/require-yields\": [\"off\"],\n \"jsdoc/require-param-description\": [\"off\"]\n }\n }],\n \"plugins\": [\n \"@typescript-eslint\",\n \"import\",\n \"jsdoc\",\n \"n\"\n ],\n \"settings\": {\n \"import/parsers\": {\n \"@typescript-eslint/parser\": [\".ts\"]\n },\n \"jsdoc\": {\n \"exemptDestructuredRootsFromChecks\": true,\n \"tagNamePreference\": {\n \"hidden\": \"hidden\"\n }\n }\n },\n \"rules\": {\n \"indent\": [\"warn\", 4, {\n \"SwitchCase\": 1,\n \"FunctionDeclaration\": {\n \"parameters\": \"first\"\n }\n }],\n \"eqeqeq\": [\"off\"],\n \"no-undef\": \"off\",\n \"quotes\": [\"warn\", \"double\", { \"avoidEscape\": true }],\n \"no-unused-vars\": [\"warn\", {\n \"args\": \"none\",\n \"ignoreRestSiblings\": true,\n \"varsIgnorePattern\": \"^set\"\n }],\n \"no-prototype-builtins\": [\"off\"],\n \"object-curly-spacing\": [\"warn\", \"never\"],\n \"semi\": [\"warn\", \"always\"],\n \"no-undefined\": [\"off\"],\n \"array-bracket-newline\": [\"error\", \"consistent\"],\n \"brace-style\": [\"error\", \"1tbs\", {\n \"allowSingleLine\": false\n }],\n \"comma-spacing\": [\"error\", {\n \"before\": false,\n \"after\": true\n }],\n \"comma-style\": [\"error\", \"last\"],\n \"comma-dangle\": [\"error\", \"never\"],\n \"no-var\": [\"error\"],\n \"import/order\": [\"error\", {\n \"groups\": [\"builtin\", \"external\",\"internal\", \"parent\", \"sibling\", \"index\", \"type\", \"object\", \"unknown\"],\n \"warnOnUnassignedImports\": true\n }],\n \"n/file-extension-in-import\": [\"error\", \"always\"],\n \"newline-per-chained-call\": [\"error\", {\n \"ignoreChainWithDepth\": 2\n }],\n \"no-confusing-arrow\": [\"error\"],\n \"no-const-assign\": [\"error\"],\n \"no-duplicate-imports\": [\"error\", {\n \"includeExports\": true\n }],\n \"camelcase\": [\"warn\"],\n \"jsx-quotes\": [\"warn\"],\n \"yoda\": [\"error\", \"never\", {\n \"exceptRange\": true\n }],\n \"no-eval\": [\"error\"],\n \"array-callback-return\": [\"error\"],\n \"no-empty\": [\"error\", {\n \"allowEmptyCatch\": true\n }],\n \"keyword-spacing\": [\"warn\"],\n \"space-infix-ops\": [\"warn\"],\n \"spaced-comment\": [\"warn\", \"always\", {\n \"markers\": [\"/\"]\n }],\n \"eol-last\": [\"warn\", \"always\"],\n \"max-len\": [\"warn\", {\n \"code\": 140,\n \"tabWidth\": 4,\n \"ignoreStrings\": true\n }]\n }\n}\n"},{"path":[".gitignore"],"content":"/.idea\n/.vscode\nnode_modules\n.DS_Store\n\n/dist\n/models\n"},{"path":["README.md"],"content":"# Node + TypeScript + `node-llama-cpp`\nThis template provides a minimal setup to get Node working with TypeScript and `node-llama-cpp`, and some ESLint rules.\n\n## Get started\nInstall node modules and download the model files used by `node-llama-cpp`:\n```bash\nnpm install\n```\n\nStart the project:\n```bash\nnpm start\n```\n"},{"path":["package.json"],"content":"{\n \"name\": \"node-llama-cpp-project\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"main\": \"./dist/index.js\",\n \"type\": \"module\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist/\",\n \"package.json\",\n \"README.md\"\n ],\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"node\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"scripts\": {\n \"postinstall\": \"npm run models:pull\",\n \"models:pull\": \"node-llama-cpp pull --dir ./models \\\"{{modelUrl|escape|escape}}\\\"\",\n \"start\": \"vite-node ./src/index.ts\",\n \"start:build\": \"node ./dist/index.ts\",\n \"prebuild\": \"rimraf ./dist ./tsconfig.tsbuildinfo\",\n \"build\": \"tsc --build tsconfig.json --force\",\n \"lint\": \"npm run lint:eslint\",\n \"lint:eslint\": \"eslint --ext .js --ext .ts --report-unused-disable-directives .\",\n \"format\": \"npm run lint:eslint -- --fix\",\n \"clean\": \"rm -rf ./node_modules ./dist ./tsconfig.tsbuildinfo ./models\"\n },\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"node-llama-cpp\": \"^{{currentNodeLlamaCppModuleVersion|escape}}\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.5.5\",\n \"@typescript-eslint/eslint-plugin\": \"^7.12.0\",\n \"@typescript-eslint/parser\": \"^7.12.0\",\n \"eslint\": \"^8.46.0\",\n \"eslint-plugin-import\": \"^2.29.1\",\n \"eslint-plugin-jsdoc\": \"^46.9.0\",\n \"eslint-plugin-n\": \"^17.8.1\",\n \"rimraf\": \"^6.0.1\",\n \"tslib\": \"^2.7.0\",\n \"typescript\": \"^5.6.2\",\n \"vite-node\": \"^2.1.1\"\n }\n}"},{"path":["src","index.ts"],"content":"import {fileURLToPath} from \"url\";\nimport path from \"path\";\nimport chalk from \"chalk\";\nimport {getLlama, LlamaChatSession} from \"node-llama-cpp\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst modelsFolderDirectory = path.join(__dirname, \"..\", \"models\");\n\n\nconst llama = await getLlama();\n\nconsole.log(chalk.yellow(\"Loading model...\"));\nconst model = await llama.loadModel({\n modelPath: path.join(modelsFolderDirectory, \"{{modelFilename|escape}}\")\n});\n\nconsole.log(chalk.yellow(\"Creating context...\"));\nconst context = await model.createContext();\n\nconst session = new LlamaChatSession({\n contextSequence: context.getSequence()\n});\nconsole.log();\n\n\nconst q1 = \"Hi there, how are you?\";\nconsole.log(chalk.yellow(\"User: \") + q1);\n\nprocess.stdout.write(chalk.yellow(\"AI: \"));\nconst a1 = await session.prompt(q1, {\n onTextChunk(chunk) {\n // stream the response to the console as it's being generated\n process.stdout.write(chunk);\n }\n});\nprocess.stdout.write(\"\\n\");\nconsole.log(chalk.yellow(\"Consolidated AI answer: \") + a1);\nconsole.log();\n\n\nconst q2 = \"Summarize what you said\";\nconsole.log(chalk.yellow(\"User: \") + q2);\n\nconst a2 = await session.prompt(q2);\nconsole.log(chalk.yellow(\"AI: \") + a2);\nconsole.log();\n\n\nconst q3 = \"What are the verbs in this sentence: 'The cat sat on the mat'\";\nconsole.log(chalk.yellow(\"User: \") + q3);\n\n// force the model to respond in accordance to the specified JSON schema format, so we can parse it and use it programmatically\nconst responseGrammar = await llama.createGrammarForJsonSchema({\n type: \"object\",\n properties: {\n verbs: {\n type: \"array\",\n items: {\n type: \"string\"\n }\n }\n }\n});\nconst a3 = await session.prompt(q2, {grammar: responseGrammar});\nconst parsedResponse = responseGrammar.parse(a3);\nconsole.log(chalk.yellow(\"AI:\"), parsedResponse.verbs);\nconsole.log();\n\nif (parsedResponse.verbs.length > 0) {\n const q4 = `Define the verb \"${parsedResponse.verbs[0]}\"`;\n console.log(chalk.yellow(\"User: \") + q4);\n\n const a4 = await session.prompt(q4);\n console.log(chalk.yellow(\"AI: \") + a4);\n console.log();\n} else {\n const q4 = \"Are you sure there are no verbs in the sentence?\";\n console.log(chalk.yellow(\"User: \") + q4);\n\n const a4 = await session.prompt(q4);\n console.log(chalk.yellow(\"AI: \") + a4);\n console.log();\n}\n"},{"path":["tsconfig.json"],"content":"{\n \"compilerOptions\": {\n \"lib\": [\"es2022\"],\n \"module\": \"es2022\",\n \"target\": \"es2022\",\n \"esModuleInterop\": true,\n \"noImplicitAny\": true,\n \"noImplicitReturns\": true,\n \"noImplicitThis\": true,\n \"noImplicitOverride\": true,\n \"removeComments\": false,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedIndexedAccess\": true,\n \"moduleDetection\": \"force\",\n \"skipLibCheck\": true,\n \"moduleResolution\": \"node\",\n \"resolveJsonModule\": false,\n \"strictNullChecks\": true,\n \"isolatedModules\": true,\n \"noEmit\": false,\n \"outDir\": \"./dist\",\n \"strict\": true,\n \"sourceMap\": true,\n \"composite\": false,\n \"declaration\": true\n },\n \"files\": [\n \"./src/index.ts\"\n ],\n \"include\": [\n \"./src\"\n ]\n}\n"}]}
|
|
1
|
+
{"files":[{"path":[".editorconfig"],"content":"root = true\n\n[*]\nindent_style = space\nindent_size = 4\n\n[{*.ts,*.tsx,*.js,*.jsx,*.css,*.scss}]\ninsert_final_newline = true\n\n[{package.json,package-lock.json,manifest.json}]\nindent_size = 2\n\n[*.yml]\nindent_size = 2\n"},{"path":[".eslintrc.json"],"content":"{\n \"root\": true,\n \"env\": {\n \"node\": true,\n \"browser\": false,\n \"es6\": true\n },\n \"ignorePatterns\": [\"/dist\", \"/models\"],\n \"extends\": [\n \"eslint:recommended\",\n \"plugin:jsdoc/recommended\"\n ],\n \"globals\": {\n \"Atomics\": \"readonly\",\n \"SharedArrayBuffer\": \"readonly\"\n },\n \"parserOptions\": {\n \"ecmaVersion\": 2023,\n \"sourceType\": \"module\"\n },\n \"overrides\": [{\n \"files\": [\"**.ts\"],\n \"extends\": [\n \"eslint:recommended\",\n \"plugin:@typescript-eslint/recommended\",\n \"plugin:jsdoc/recommended-typescript\"\n ],\n \"parser\": \"@typescript-eslint/parser\",\n \"plugins\": [\n \"@typescript-eslint\",\n \"import\",\n \"jsdoc\",\n \"n\"\n ],\n \"rules\": {\n \"@typescript-eslint/explicit-module-boundary-types\": [\"off\"],\n \"@typescript-eslint/ban-ts-comment\": [\"off\"],\n \"@typescript-eslint/no-explicit-any\": [\"off\"],\n \"semi\": [\"off\"],\n \"@typescript-eslint/semi\": [\"warn\", \"always\"],\n \"@typescript-eslint/no-inferrable-types\": [\"off\"],\n \"@typescript-eslint/member-ordering\": [\"warn\", {\n \"default\": [\"field\", \"constructor\", \"method\", \"signature\"],\n \"typeLiterals\": []\n }],\n \"@typescript-eslint/parameter-properties\": [\"warn\", {\n \"allow\": []\n }],\n \"@typescript-eslint/explicit-member-accessibility\": [\"warn\"],\n \"@typescript-eslint/member-delimiter-style\": [\"warn\", {\n \"multiline\": {\n \"delimiter\": \"comma\",\n \"requireLast\": false\n },\n \"singleline\": {\n \"delimiter\": \"comma\",\n \"requireLast\": false\n },\n \"multilineDetection\": \"brackets\"\n }],\n \"jsdoc/require-param\": [\"off\"],\n \"jsdoc/check-param-names\": [\"warn\", {\n \"checkDestructured\": false\n }],\n \"jsdoc/require-returns\": [\"off\"],\n \"jsdoc/require-jsdoc\": [\"off\"],\n \"jsdoc/require-yields\": [\"off\"],\n \"jsdoc/require-param-description\": [\"off\"]\n }\n }],\n \"plugins\": [\n \"@typescript-eslint\",\n \"import\",\n \"jsdoc\",\n \"n\"\n ],\n \"settings\": {\n \"import/parsers\": {\n \"@typescript-eslint/parser\": [\".ts\"]\n },\n \"jsdoc\": {\n \"exemptDestructuredRootsFromChecks\": true,\n \"tagNamePreference\": {\n \"hidden\": \"hidden\"\n }\n }\n },\n \"rules\": {\n \"indent\": [\"warn\", 4, {\n \"SwitchCase\": 1,\n \"FunctionDeclaration\": {\n \"parameters\": \"first\"\n }\n }],\n \"eqeqeq\": [\"off\"],\n \"no-undef\": \"off\",\n \"quotes\": [\"warn\", \"double\", { \"avoidEscape\": true }],\n \"no-unused-vars\": [\"warn\", {\n \"args\": \"none\",\n \"ignoreRestSiblings\": true,\n \"varsIgnorePattern\": \"^set\"\n }],\n \"no-prototype-builtins\": [\"off\"],\n \"object-curly-spacing\": [\"warn\", \"never\"],\n \"semi\": [\"warn\", \"always\"],\n \"no-undefined\": [\"off\"],\n \"array-bracket-newline\": [\"error\", \"consistent\"],\n \"brace-style\": [\"error\", \"1tbs\", {\n \"allowSingleLine\": false\n }],\n \"comma-spacing\": [\"error\", {\n \"before\": false,\n \"after\": true\n }],\n \"comma-style\": [\"error\", \"last\"],\n \"comma-dangle\": [\"error\", \"never\"],\n \"no-var\": [\"error\"],\n \"import/order\": [\"error\", {\n \"groups\": [\"builtin\", \"external\",\"internal\", \"parent\", \"sibling\", \"index\", \"type\", \"object\", \"unknown\"],\n \"warnOnUnassignedImports\": true\n }],\n \"n/file-extension-in-import\": [\"error\", \"always\"],\n \"newline-per-chained-call\": [\"error\", {\n \"ignoreChainWithDepth\": 2\n }],\n \"no-confusing-arrow\": [\"error\"],\n \"no-const-assign\": [\"error\"],\n \"no-duplicate-imports\": [\"error\", {\n \"includeExports\": true\n }],\n \"camelcase\": [\"warn\"],\n \"jsx-quotes\": [\"warn\"],\n \"yoda\": [\"error\", \"never\", {\n \"exceptRange\": true\n }],\n \"no-eval\": [\"error\"],\n \"array-callback-return\": [\"error\"],\n \"no-empty\": [\"error\", {\n \"allowEmptyCatch\": true\n }],\n \"keyword-spacing\": [\"warn\"],\n \"space-infix-ops\": [\"warn\"],\n \"spaced-comment\": [\"warn\", \"always\", {\n \"markers\": [\"/\"]\n }],\n \"eol-last\": [\"warn\", \"always\"],\n \"max-len\": [\"warn\", {\n \"code\": 140,\n \"tabWidth\": 4,\n \"ignoreStrings\": true\n }]\n }\n}\n"},{"path":[".gitignore"],"content":"/.idea\n/.vscode\nnode_modules\n.DS_Store\n\n/dist\n/models\n"},{"path":["README.md"],"content":"# Node + TypeScript + `node-llama-cpp`\nThis template provides a minimal setup to get Node working with TypeScript and `node-llama-cpp`, and some ESLint rules.\n\n## Get started\nInstall node modules and download the model files used by `node-llama-cpp`:\n```bash\nnpm install\n```\n\nStart the project:\n```bash\nnpm start\n```\n"},{"path":["package.json"],"content":"{\n \"name\": \"node-llama-cpp-project\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"main\": \"./dist/index.js\",\n \"type\": \"module\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist/\",\n \"package.json\",\n \"README.md\"\n ],\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"node\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"scripts\": {\n \"postinstall\": \"npm run models:pull\",\n \"models:pull\": \"node-llama-cpp pull --dir ./models \\\"{{modelUrl|escape|escape}}\\\"\",\n \"start\": \"vite-node ./src/index.ts\",\n \"start:build\": \"node ./dist/index.ts\",\n \"prebuild\": \"rimraf ./dist ./tsconfig.tsbuildinfo\",\n \"build\": \"tsc --build tsconfig.json --force\",\n \"lint\": \"npm run lint:eslint\",\n \"lint:eslint\": \"eslint --ext .js --ext .ts --report-unused-disable-directives .\",\n \"format\": \"npm run lint:eslint -- --fix\",\n \"clean\": \"rm -rf ./node_modules ./dist ./tsconfig.tsbuildinfo ./models\"\n },\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"node-llama-cpp\": \"^{{currentNodeLlamaCppModuleVersion|escape}}\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.5.5\",\n \"@typescript-eslint/eslint-plugin\": \"^7.12.0\",\n \"@typescript-eslint/parser\": \"^7.12.0\",\n \"eslint\": \"^8.46.0\",\n \"eslint-plugin-import\": \"^2.29.1\",\n \"eslint-plugin-jsdoc\": \"^46.9.0\",\n \"eslint-plugin-n\": \"^17.8.1\",\n \"rimraf\": \"^6.0.1\",\n \"tslib\": \"^2.7.0\",\n \"typescript\": \"^5.6.2\",\n \"vite-node\": \"^2.1.1\"\n }\n}"},{"path":["src","index.ts"],"content":"import {fileURLToPath} from \"url\";\nimport path from \"path\";\nimport chalk from \"chalk\";\nimport {getLlama, LlamaChatSession} from \"node-llama-cpp\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst modelsFolderDirectory = path.join(__dirname, \"..\", \"models\");\n\n\nconst llama = await getLlama();\n\nconsole.log(chalk.yellow(\"Loading model...\"));\nconst model = await llama.loadModel({\n modelPath: path.join(modelsFolderDirectory, \"{{modelFilename|escape}}\")\n});\n\nconsole.log(chalk.yellow(\"Creating context...\"));\nconst context = await model.createContext();\n\nconst session = new LlamaChatSession({\n contextSequence: context.getSequence()\n});\nconsole.log();\n\n\nconst q1 = \"Hi there, how are you?\";\nconsole.log(chalk.yellow(\"User: \") + q1);\n\nprocess.stdout.write(chalk.yellow(\"AI: \"));\nconst a1 = await session.prompt(q1, {\n onTextChunk(chunk) {\n // stream the response to the console as it's being generated\n process.stdout.write(chunk);\n }\n});\nprocess.stdout.write(\"\\n\");\nconsole.log(chalk.yellow(\"Consolidated AI answer: \") + a1);\nconsole.log();\n\n\nconst q2 = \"Summarize what you said\";\nconsole.log(chalk.yellow(\"User: \") + q2);\n\nconst a2 = await session.prompt(q2);\nconsole.log(chalk.yellow(\"AI: \") + a2);\nconsole.log();\n\n\nconst q3 = \"What are the verbs in this sentence: 'The cat sat on the mat'\";\nconsole.log(chalk.yellow(\"User: \") + q3);\n\n// force the model to respond in accordance to the specified JSON schema format,\n// so we can parse it and use it programmatically\nconst responseGrammar = await llama.createGrammarForJsonSchema({\n type: \"object\",\n properties: {\n verbs: {\n type: \"array\",\n items: {\n type: \"string\"\n }\n }\n }\n});\nconst a3 = await session.prompt(q3, {grammar: responseGrammar});\nconst parsedResponse = responseGrammar.parse(a3);\nconsole.log(chalk.yellow(\"AI:\"), parsedResponse.verbs);\nconsole.log();\n\nif (parsedResponse.verbs.length > 0) {\n const q4 = `Define the verb \"${parsedResponse.verbs[0]}\"`;\n console.log(chalk.yellow(\"User: \") + q4);\n\n const a4 = await session.prompt(q4);\n console.log(chalk.yellow(\"AI: \") + a4);\n console.log();\n} else {\n const q4 = \"Are you sure there are no verbs in the sentence?\";\n console.log(chalk.yellow(\"User: \") + q4);\n\n const a4 = await session.prompt(q4);\n console.log(chalk.yellow(\"AI: \") + a4);\n console.log();\n}\n"},{"path":["tsconfig.json"],"content":"{\n \"compilerOptions\": {\n \"lib\": [\"es2022\"],\n \"module\": \"es2022\",\n \"target\": \"es2022\",\n \"esModuleInterop\": true,\n \"noImplicitAny\": true,\n \"noImplicitReturns\": true,\n \"noImplicitThis\": true,\n \"noImplicitOverride\": true,\n \"removeComments\": false,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedIndexedAccess\": true,\n \"moduleDetection\": \"force\",\n \"skipLibCheck\": true,\n \"moduleResolution\": \"node\",\n \"resolveJsonModule\": false,\n \"strictNullChecks\": true,\n \"isolatedModules\": true,\n \"noEmit\": false,\n \"outDir\": \"./dist\",\n \"strict\": true,\n \"sourceMap\": true,\n \"composite\": false,\n \"declaration\": true\n },\n \"files\": [\n \"./src/index.ts\"\n ],\n \"include\": [\n \"./src\"\n ]\n}\n"}]}
|