@huggingface/tasks 0.19.74 → 0.19.75
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/dist/commonjs/hardware.d.ts +4 -0
- package/dist/commonjs/hardware.d.ts.map +1 -1
- package/dist/commonjs/hardware.js +4 -0
- package/dist/commonjs/local-apps.d.ts.map +1 -1
- package/dist/commonjs/local-apps.js +14 -7
- package/dist/commonjs/local-apps.spec.js +12 -4
- package/dist/esm/hardware.d.ts +4 -0
- package/dist/esm/hardware.d.ts.map +1 -1
- package/dist/esm/hardware.js +4 -0
- package/dist/esm/local-apps.d.ts.map +1 -1
- package/dist/esm/local-apps.js +14 -7
- package/dist/esm/local-apps.spec.js +12 -4
- package/package.json +1 -1
- package/src/hardware.ts +4 -0
- package/src/local-apps.spec.ts +12 -4
- package/src/local-apps.ts +14 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,yDAAyD,QAAW,CAAC;AAClF,eAAO,MAAM,oCAAoC,QAAU,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,+CAA+C,QAAW,CAAC;AAExE,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,UAElC,CAAC;AAEF,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,yDAAyD,QAAW,CAAC;AAClF,eAAO,MAAM,oCAAoC,QAAU,CAAC;AAE5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|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;CACtD,GACD;IACA;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC;CACzG,CACH,CAAC;AAqBF,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,SAAS,WAE5C;
|
|
1
|
+
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MA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AG,eAAe,EAAE;;;;;;;yBA7B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBAtFzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBA0J1B,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAI9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CA2N5C,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -40,20 +40,27 @@ function getQuantTag(filepath) {
|
|
|
40
40
|
return quantLabel ? `:${quantLabel}` : defaultTag;
|
|
41
41
|
}
|
|
42
42
|
const snippetLlamacpp = (model, filepath) => {
|
|
43
|
-
const
|
|
44
|
-
const snippet = [
|
|
43
|
+
const serverCommand = (binary) => {
|
|
44
|
+
const snippet = [
|
|
45
|
+
"# Start a local OpenAI-compatible server with a web UI:",
|
|
46
|
+
`${binary} -hf ${model.id}${getQuantTag(filepath)}`,
|
|
47
|
+
];
|
|
48
|
+
return snippet.join("\n");
|
|
49
|
+
};
|
|
50
|
+
const cliCommand = (binary) => {
|
|
51
|
+
const snippet = ["# Run inference directly in the terminal:", `${binary} -hf ${model.id}${getQuantTag(filepath)}`];
|
|
45
52
|
return snippet.join("\n");
|
|
46
53
|
};
|
|
47
54
|
return [
|
|
48
55
|
{
|
|
49
56
|
title: "Install from brew",
|
|
50
57
|
setup: "brew install llama.cpp",
|
|
51
|
-
content:
|
|
58
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
52
59
|
},
|
|
53
60
|
{
|
|
54
61
|
title: "Install from WinGet (Windows)",
|
|
55
62
|
setup: "winget install llama.cpp",
|
|
56
|
-
content:
|
|
63
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
57
64
|
},
|
|
58
65
|
{
|
|
59
66
|
title: "Use pre-built binary",
|
|
@@ -62,7 +69,7 @@ const snippetLlamacpp = (model, filepath) => {
|
|
|
62
69
|
"# Download pre-built binary from:",
|
|
63
70
|
"# https://github.com/ggerganov/llama.cpp/releases",
|
|
64
71
|
].join("\n"),
|
|
65
|
-
content:
|
|
72
|
+
content: [serverCommand("./llama-server"), cliCommand("./llama-cli")],
|
|
66
73
|
},
|
|
67
74
|
{
|
|
68
75
|
title: "Build from source code",
|
|
@@ -70,9 +77,9 @@ const snippetLlamacpp = (model, filepath) => {
|
|
|
70
77
|
"git clone https://github.com/ggerganov/llama.cpp.git",
|
|
71
78
|
"cd llama.cpp",
|
|
72
79
|
"cmake -B build",
|
|
73
|
-
"cmake --build build -j --target llama-server",
|
|
80
|
+
"cmake --build build -j --target llama-server llama-cli",
|
|
74
81
|
].join("\n"),
|
|
75
|
-
content:
|
|
82
|
+
content: [serverCommand("./build/bin/llama-server"), cliCommand("./build/bin/llama-cli")],
|
|
76
83
|
},
|
|
77
84
|
];
|
|
78
85
|
};
|
|
@@ -11,8 +11,12 @@ const local_apps_js_1 = require("./local-apps.js");
|
|
|
11
11
|
inference: "",
|
|
12
12
|
};
|
|
13
13
|
const snippet = snippetFunc(model);
|
|
14
|
-
(0, vitest_1.expect)(snippet[0].content).toEqual(
|
|
15
|
-
|
|
14
|
+
(0, vitest_1.expect)(snippet[0].content).toEqual([
|
|
15
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
16
|
+
llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
17
|
+
`# Run inference directly in the terminal:
|
|
18
|
+
llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
19
|
+
]);
|
|
16
20
|
});
|
|
17
21
|
(0, vitest_1.it)("llama.cpp non-conversational", async () => {
|
|
18
22
|
const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["llama.cpp"];
|
|
@@ -22,8 +26,12 @@ llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
|
22
26
|
inference: "",
|
|
23
27
|
};
|
|
24
28
|
const snippet = snippetFunc(model);
|
|
25
|
-
(0, vitest_1.expect)(snippet[0].content).toEqual(
|
|
26
|
-
|
|
29
|
+
(0, vitest_1.expect)(snippet[0].content).toEqual([
|
|
30
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
31
|
+
llama-server -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
32
|
+
`# Run inference directly in the terminal:
|
|
33
|
+
llama-cli -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
34
|
+
]);
|
|
27
35
|
});
|
|
28
36
|
(0, vitest_1.it)("vLLM conversational llm", async () => {
|
|
29
37
|
const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["vllm"];
|
package/dist/esm/hardware.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,yDAAyD,QAAW,CAAC;AAClF,eAAO,MAAM,oCAAoC,QAAU,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,+CAA+C,QAAW,CAAC;AAExE,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,UAElC,CAAC;AAEF,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,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O,GAAG,MAAM,OAAO,IAAI,CAAC"}
|
package/dist/esm/hardware.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;CACtD,GACD;IACA;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC;CACzG,CACH,CAAC;AAqBF,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,SAAS,WAE5C;
|
|
1
|
+
{"version":3,"file":"local-apps.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e,EAAE;;;;;;oCAoPzD,SAAS;yBA3MX,SAAS,KAAG,eAAe,EAAE;;;;;;;yBA4F5B,SAAS,KAAG,eAAe,EAAE;;;;;;;yBA7B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBAtFzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBA0J1B,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAI9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CA2N5C,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/esm/local-apps.js
CHANGED
|
@@ -37,20 +37,27 @@ function getQuantTag(filepath) {
|
|
|
37
37
|
return quantLabel ? `:${quantLabel}` : defaultTag;
|
|
38
38
|
}
|
|
39
39
|
const snippetLlamacpp = (model, filepath) => {
|
|
40
|
-
const
|
|
41
|
-
const snippet = [
|
|
40
|
+
const serverCommand = (binary) => {
|
|
41
|
+
const snippet = [
|
|
42
|
+
"# Start a local OpenAI-compatible server with a web UI:",
|
|
43
|
+
`${binary} -hf ${model.id}${getQuantTag(filepath)}`,
|
|
44
|
+
];
|
|
45
|
+
return snippet.join("\n");
|
|
46
|
+
};
|
|
47
|
+
const cliCommand = (binary) => {
|
|
48
|
+
const snippet = ["# Run inference directly in the terminal:", `${binary} -hf ${model.id}${getQuantTag(filepath)}`];
|
|
42
49
|
return snippet.join("\n");
|
|
43
50
|
};
|
|
44
51
|
return [
|
|
45
52
|
{
|
|
46
53
|
title: "Install from brew",
|
|
47
54
|
setup: "brew install llama.cpp",
|
|
48
|
-
content:
|
|
55
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
49
56
|
},
|
|
50
57
|
{
|
|
51
58
|
title: "Install from WinGet (Windows)",
|
|
52
59
|
setup: "winget install llama.cpp",
|
|
53
|
-
content:
|
|
60
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
54
61
|
},
|
|
55
62
|
{
|
|
56
63
|
title: "Use pre-built binary",
|
|
@@ -59,7 +66,7 @@ const snippetLlamacpp = (model, filepath) => {
|
|
|
59
66
|
"# Download pre-built binary from:",
|
|
60
67
|
"# https://github.com/ggerganov/llama.cpp/releases",
|
|
61
68
|
].join("\n"),
|
|
62
|
-
content:
|
|
69
|
+
content: [serverCommand("./llama-server"), cliCommand("./llama-cli")],
|
|
63
70
|
},
|
|
64
71
|
{
|
|
65
72
|
title: "Build from source code",
|
|
@@ -67,9 +74,9 @@ const snippetLlamacpp = (model, filepath) => {
|
|
|
67
74
|
"git clone https://github.com/ggerganov/llama.cpp.git",
|
|
68
75
|
"cd llama.cpp",
|
|
69
76
|
"cmake -B build",
|
|
70
|
-
"cmake --build build -j --target llama-server",
|
|
77
|
+
"cmake --build build -j --target llama-server llama-cli",
|
|
71
78
|
].join("\n"),
|
|
72
|
-
content:
|
|
79
|
+
content: [serverCommand("./build/bin/llama-server"), cliCommand("./build/bin/llama-cli")],
|
|
73
80
|
},
|
|
74
81
|
];
|
|
75
82
|
};
|
|
@@ -9,8 +9,12 @@ describe("local-apps", () => {
|
|
|
9
9
|
inference: "",
|
|
10
10
|
};
|
|
11
11
|
const snippet = snippetFunc(model);
|
|
12
|
-
expect(snippet[0].content).toEqual(
|
|
13
|
-
|
|
12
|
+
expect(snippet[0].content).toEqual([
|
|
13
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
14
|
+
llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
15
|
+
`# Run inference directly in the terminal:
|
|
16
|
+
llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
17
|
+
]);
|
|
14
18
|
});
|
|
15
19
|
it("llama.cpp non-conversational", async () => {
|
|
16
20
|
const { snippet: snippetFunc } = LOCAL_APPS["llama.cpp"];
|
|
@@ -20,8 +24,12 @@ llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
|
20
24
|
inference: "",
|
|
21
25
|
};
|
|
22
26
|
const snippet = snippetFunc(model);
|
|
23
|
-
expect(snippet[0].content).toEqual(
|
|
24
|
-
|
|
27
|
+
expect(snippet[0].content).toEqual([
|
|
28
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
29
|
+
llama-server -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
30
|
+
`# Run inference directly in the terminal:
|
|
31
|
+
llama-cli -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
32
|
+
]);
|
|
25
33
|
});
|
|
26
34
|
it("vLLM conversational llm", async () => {
|
|
27
35
|
const { snippet: snippetFunc } = LOCAL_APPS["vllm"];
|
package/package.json
CHANGED
package/src/hardware.ts
CHANGED
package/src/local-apps.spec.ts
CHANGED
|
@@ -12,8 +12,12 @@ describe("local-apps", () => {
|
|
|
12
12
|
};
|
|
13
13
|
const snippet = snippetFunc(model);
|
|
14
14
|
|
|
15
|
-
expect(snippet[0].content).toEqual(
|
|
16
|
-
|
|
15
|
+
expect(snippet[0].content).toEqual([
|
|
16
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
17
|
+
llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
18
|
+
`# Run inference directly in the terminal:
|
|
19
|
+
llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`,
|
|
20
|
+
]);
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
it("llama.cpp non-conversational", async () => {
|
|
@@ -25,8 +29,12 @@ llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
|
25
29
|
};
|
|
26
30
|
const snippet = snippetFunc(model);
|
|
27
31
|
|
|
28
|
-
expect(snippet[0].content).toEqual(
|
|
29
|
-
|
|
32
|
+
expect(snippet[0].content).toEqual([
|
|
33
|
+
`# Start a local OpenAI-compatible server with a web UI:
|
|
34
|
+
llama-server -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
35
|
+
`# Run inference directly in the terminal:
|
|
36
|
+
llama-cli -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`,
|
|
37
|
+
]);
|
|
30
38
|
});
|
|
31
39
|
|
|
32
40
|
it("vLLM conversational llm", async () => {
|
package/src/local-apps.ts
CHANGED
|
@@ -110,20 +110,27 @@ function getQuantTag(filepath?: string): string {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
|
|
113
|
-
const
|
|
114
|
-
const snippet = [
|
|
113
|
+
const serverCommand = (binary: string) => {
|
|
114
|
+
const snippet = [
|
|
115
|
+
"# Start a local OpenAI-compatible server with a web UI:",
|
|
116
|
+
`${binary} -hf ${model.id}${getQuantTag(filepath)}`,
|
|
117
|
+
];
|
|
118
|
+
return snippet.join("\n");
|
|
119
|
+
};
|
|
120
|
+
const cliCommand = (binary: string) => {
|
|
121
|
+
const snippet = ["# Run inference directly in the terminal:", `${binary} -hf ${model.id}${getQuantTag(filepath)}`];
|
|
115
122
|
return snippet.join("\n");
|
|
116
123
|
};
|
|
117
124
|
return [
|
|
118
125
|
{
|
|
119
126
|
title: "Install from brew",
|
|
120
127
|
setup: "brew install llama.cpp",
|
|
121
|
-
content:
|
|
128
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
122
129
|
},
|
|
123
130
|
{
|
|
124
131
|
title: "Install from WinGet (Windows)",
|
|
125
132
|
setup: "winget install llama.cpp",
|
|
126
|
-
content:
|
|
133
|
+
content: [serverCommand("llama-server"), cliCommand("llama-cli")],
|
|
127
134
|
},
|
|
128
135
|
{
|
|
129
136
|
title: "Use pre-built binary",
|
|
@@ -132,7 +139,7 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[]
|
|
|
132
139
|
"# Download pre-built binary from:",
|
|
133
140
|
"# https://github.com/ggerganov/llama.cpp/releases",
|
|
134
141
|
].join("\n"),
|
|
135
|
-
content:
|
|
142
|
+
content: [serverCommand("./llama-server"), cliCommand("./llama-cli")],
|
|
136
143
|
},
|
|
137
144
|
{
|
|
138
145
|
title: "Build from source code",
|
|
@@ -140,9 +147,9 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[]
|
|
|
140
147
|
"git clone https://github.com/ggerganov/llama.cpp.git",
|
|
141
148
|
"cd llama.cpp",
|
|
142
149
|
"cmake -B build",
|
|
143
|
-
"cmake --build build -j --target llama-server",
|
|
150
|
+
"cmake --build build -j --target llama-server llama-cli",
|
|
144
151
|
].join("\n"),
|
|
145
|
-
content:
|
|
152
|
+
content: [serverCommand("./build/bin/llama-server"), cliCommand("./build/bin/llama-cli")],
|
|
146
153
|
},
|
|
147
154
|
];
|
|
148
155
|
};
|