You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package comes with pre-built binaries for macOS, Linux and Windows.
24
24
25
-
If binaries are not available for your platform, it'll fallback to download the latest version of `llama.cpp` and build it from source with `node-gyp`.
25
+
If binaries are not available for your platform, it'll fallback to download the latest version of `llama.cpp` and build it from source with `cmake`.
26
26
To disable this behavior set the environment variable `NODE_LLAMA_CPP_SKIP_DOWNLOAD` to `true`.
27
27
28
28
## Documentation
@@ -81,11 +81,13 @@ export class MyCustomChatPromptWrapper extends ChatPromptWrapper {
To load a version of `llama.cpp` that was compiled to use Metal or CUDA,
183
-
you have to build it from source with the `--metal` or `--cuda` flag before running your code that imports `node-llama-cpp`.
184
+
**Metal:**`llama.cpp` is built with Metal support by default on macOS.
185
+
186
+
**CUDA:** To load a version of `llama.cpp` that was compiled to use CUDA,
187
+
you have to build it from source with the `--cuda` flag before running your code that imports `node-llama-cpp`.
184
188
185
189
To do this, run this command inside of your project directory:
186
190
```bash
187
-
# For Metal support on macOS
188
-
npx node-llama-cpp download --metal
189
-
190
-
# For CUDA support
191
191
npx node-llama-cpp download --cuda
192
192
```
193
193
194
-
> In order for `node-llama-cpp`to be able to build `llama.cpp` from source, make sure you have the required dependencies of `node-gyp` installed.
194
+
> If `cmake` is not installed on your machine, `node-llama-cpp`will automatically download `cmake` to an internal directory and try to use it to build `llama.cpp` from source.
195
195
>
196
-
> More info is available [here](https://github.com/nodejs/node-gyp#on-unix) (you don't have to install `node-gyp` itself, just the dependencies).
196
+
> If the build fails, make sure you have the required dependencies of `cmake` installed on your machine. More info is available [here](https://github.com/cmake-js/cmake-js#installation:~:text=projectRoot/build%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bstring%5D-,Requirements%3A,-CMake) (you don't have to install `cmake` or `cmake-js`, just the dependencies).
0 commit comments