@@ -13,7 +13,7 @@ export class LlamaModel {
13
13
* @param {number | null } [options.seed] - If null, a random seed will be used
14
14
* @param {number } [options.contextSize] - text context size
15
15
* @param {number } [options.batchSize] - prompt processing batch size
16
- * @param {number } [options.gpuCores ] - number of layers to store in VRAM
16
+ * @param {number } [options.gpuLayers ] - number of layers to store in VRAM
17
17
* @param {boolean } [options.lowVram] - if true, reduce VRAM usage at the cost of performance
18
18
* @param {boolean } [options.f16Kv] - use fp16 for KV cache
19
19
* @param {boolean } [options.logitsAll] - the llama_eval() call computes all logits, not just the last one
@@ -23,18 +23,50 @@ export class LlamaModel {
23
23
* @param {boolean } [options.embedding] - embedding mode only
24
24
*/
25
25
public constructor ( {
26
- modelPath, seed = null , contextSize = 1024 * 4 , batchSize, gpuCores ,
26
+ modelPath, seed = null , contextSize = 1024 * 4 , batchSize, gpuLayers ,
27
27
lowVram, f16Kv, logitsAll, vocabOnly, useMmap, useMlock, embedding
28
28
} : {
29
- modelPath : string , seed ?: number | null , contextSize ?: number , batchSize ?: number , gpuCores ?: number ,
30
- lowVram ?: boolean , f16Kv ?: boolean , logitsAll ?: boolean , vocabOnly ?: boolean , useMmap ?: boolean , useMlock ?: boolean ,
29
+ /** path to the model on the filesystem */
30
+ modelPath : string ,
31
+
32
+ /** If null, a random seed will be used */
33
+ seed ?: number | null ,
34
+
35
+ /** text context size */
36
+ contextSize ?: number ,
37
+
38
+ /** prompt processing batch size */
39
+ batchSize ?: number ,
40
+
41
+ /** number of layers to store in VRAM */
42
+ gpuLayers ?: number ,
43
+
44
+ /** if true, reduce VRAM usage at the cost of performance */
45
+ lowVram ?: boolean ,
46
+
47
+ /** use fp16 for KV cache */
48
+ f16Kv ?: boolean ,
49
+
50
+ /** the llama_eval() call computes all logits, not just the last one */
51
+ logitsAll ?: boolean ,
52
+
53
+ /** only load the vocabulary, no weights */
54
+ vocabOnly ?: boolean ,
55
+
56
+ /** use mmap if possible */
57
+ useMmap ?: boolean ,
58
+
59
+ /** force system to keep model in RAM */
60
+ useMlock ?: boolean ,
61
+
62
+ /** embedding mode only */
31
63
embedding ?: boolean
32
64
} ) {
33
65
this . _model = new LLAMAModel ( modelPath , removeNullFields ( {
34
66
seed : seed != null ? Math . max ( - 1 , seed ) : undefined ,
35
67
contextSize,
36
68
batchSize,
37
- gpuCores ,
69
+ gpuLayers ,
38
70
lowVram,
39
71
f16Kv,
40
72
logitsAll,
0 commit comments