node-llama-cpp 3.1.1 → 3.3.0
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/ChatWrapper.js +1 -1
- package/dist/ChatWrapper.js.map +1 -1
- package/dist/bindings/AddonTypes.d.ts +10 -3
- package/dist/bindings/Llama.d.ts +31 -1
- package/dist/bindings/Llama.js +95 -10
- package/dist/bindings/Llama.js.map +1 -1
- package/dist/bindings/getLlama.d.ts +26 -2
- package/dist/bindings/getLlama.js +60 -5
- package/dist/bindings/getLlama.js.map +1 -1
- package/dist/bindings/utils/MemoryOrchestrator.d.ts +2 -0
- package/dist/bindings/utils/MemoryOrchestrator.js +3 -2
- package/dist/bindings/utils/MemoryOrchestrator.js.map +1 -1
- package/dist/bindings/utils/clearAllLocalBuilds.js +2 -2
- package/dist/bindings/utils/clearAllLocalBuilds.js.map +1 -1
- package/dist/bindings/utils/compileLLamaCpp.d.ts +1 -1
- package/dist/bindings/utils/compileLLamaCpp.js +54 -1
- package/dist/bindings/utils/compileLLamaCpp.js.map +1 -1
- package/dist/bindings/utils/detectAvailableComputeLayers.js.map +1 -1
- package/dist/bindings/utils/getGpuTypesToUseForOption.js +1 -1
- package/dist/bindings/utils/getGpuTypesToUseForOption.js.map +1 -1
- package/dist/bindings/utils/getLinuxDistroInfo.js +1 -1
- package/dist/bindings/utils/getLinuxDistroInfo.js.map +1 -1
- package/dist/bindings/utils/testBindingBinary.d.ts +2 -1
- package/dist/bindings/utils/testBindingBinary.js +122 -37
- package/dist/bindings/utils/testBindingBinary.js.map +1 -1
- package/dist/bindings/utils/testCmakeBinary.js +1 -1
- package/dist/bindings/utils/testCmakeBinary.js.map +1 -1
- package/dist/chatWrappers/FunctionaryChatWrapper.js.map +1 -1
- package/dist/chatWrappers/GemmaChatWrapper.js.map +1 -1
- package/dist/chatWrappers/Llama3_1ChatWrapper.js +3 -2
- package/dist/chatWrappers/Llama3_1ChatWrapper.js.map +1 -1
- package/dist/chatWrappers/Llama3_2LightweightChatWrapper.d.ts +35 -0
- package/dist/chatWrappers/Llama3_2LightweightChatWrapper.js +253 -0
- package/dist/chatWrappers/Llama3_2LightweightChatWrapper.js.map +1 -0
- package/dist/chatWrappers/utils/ChatModelFunctionsDocumentationGenerator.d.ts +13 -0
- package/dist/chatWrappers/utils/ChatModelFunctionsDocumentationGenerator.js +31 -1
- package/dist/chatWrappers/utils/ChatModelFunctionsDocumentationGenerator.js.map +1 -1
- package/dist/chatWrappers/utils/chunkChatItems.js +1 -1
- package/dist/chatWrappers/utils/chunkChatItems.js.map +1 -1
- package/dist/chatWrappers/utils/getModelLinageNames.d.ts +2 -0
- package/dist/chatWrappers/utils/getModelLinageNames.js +18 -0
- package/dist/chatWrappers/utils/getModelLinageNames.js.map +1 -0
- package/dist/chatWrappers/utils/isJinjaTemplateEquivalentToSpecializedChatWrapper.js.map +1 -1
- package/dist/chatWrappers/utils/isLlama3_2LightweightModel.d.ts +2 -0
- package/dist/chatWrappers/utils/isLlama3_2LightweightModel.js +9 -0
- package/dist/chatWrappers/utils/isLlama3_2LightweightModel.js.map +1 -0
- package/dist/chatWrappers/utils/resolveChatWrapper.d.ts +4 -2
- package/dist/chatWrappers/utils/resolveChatWrapper.js +10 -32
- package/dist/chatWrappers/utils/resolveChatWrapper.js.map +1 -1
- package/dist/cli/commands/ChatCommand.js +2 -3
- package/dist/cli/commands/ChatCommand.js.map +1 -1
- package/dist/cli/commands/CompleteCommand.js +1 -2
- package/dist/cli/commands/CompleteCommand.js.map +1 -1
- package/dist/cli/commands/InfillCommand.js +1 -2
- package/dist/cli/commands/InfillCommand.js.map +1 -1
- package/dist/cli/commands/InitCommand.d.ts +2 -1
- package/dist/cli/commands/InitCommand.js +32 -13
- package/dist/cli/commands/InitCommand.js.map +1 -1
- package/dist/cli/commands/inspect/commands/InspectEstimateCommand.js +0 -1
- package/dist/cli/commands/inspect/commands/InspectEstimateCommand.js.map +1 -1
- package/dist/cli/commands/inspect/commands/InspectGgufCommand.d.ts +1 -0
- package/dist/cli/commands/inspect/commands/InspectGgufCommand.js +47 -11
- package/dist/cli/commands/inspect/commands/InspectGgufCommand.js.map +1 -1
- package/dist/cli/commands/inspect/commands/InspectGpuCommand.js +14 -3
- package/dist/cli/commands/inspect/commands/InspectGpuCommand.js.map +1 -1
- package/dist/cli/recommendedModels.js +11 -0
- package/dist/cli/recommendedModels.js.map +1 -1
- package/dist/cli/utils/consolePromptQuestion.js +0 -1
- package/dist/cli/utils/consolePromptQuestion.js.map +1 -1
- package/dist/cli/utils/interactivelyAskForModel.js +3 -1
- package/dist/cli/utils/interactivelyAskForModel.js.map +1 -1
- package/dist/evaluator/LlamaChat/LlamaChat.js +37 -24
- package/dist/evaluator/LlamaChat/LlamaChat.js.map +1 -1
- package/dist/evaluator/LlamaChat/utils/contextShiftStrategies/eraseFirstResponseAndKeepFirstSystemChatContextShiftStrategy.js +63 -8
- package/dist/evaluator/LlamaChat/utils/contextShiftStrategies/eraseFirstResponseAndKeepFirstSystemChatContextShiftStrategy.js.map +1 -1
- package/dist/evaluator/LlamaChatSession/LlamaChatSession.d.ts +8 -1
- package/dist/evaluator/LlamaChatSession/LlamaChatSession.js +156 -138
- package/dist/evaluator/LlamaChatSession/LlamaChatSession.js.map +1 -1
- package/dist/evaluator/LlamaChatSession/utils/defineChatSessionFunction.d.ts +1 -1
- package/dist/evaluator/LlamaCompletion.js +11 -9
- package/dist/evaluator/LlamaCompletion.js.map +1 -1
- package/dist/evaluator/LlamaContext/LlamaContext.d.ts +11 -0
- package/dist/evaluator/LlamaContext/LlamaContext.js +66 -8
- package/dist/evaluator/LlamaContext/LlamaContext.js.map +1 -1
- package/dist/evaluator/LlamaContext/utils/batchItemsPrioritizationStrategies/firstInFirstOutStrategy.js.map +1 -1
- package/dist/evaluator/LlamaContext/utils/batchItemsPrioritizationStrategies/maximumParallelismStrategy.js.map +1 -1
- package/dist/evaluator/LlamaGrammar.js +7 -0
- package/dist/evaluator/LlamaGrammar.js.map +1 -1
- package/dist/evaluator/LlamaJsonSchemaGrammar.d.ts +3 -2
- package/dist/evaluator/LlamaJsonSchemaGrammar.js +3 -0
- package/dist/evaluator/LlamaJsonSchemaGrammar.js.map +1 -1
- package/dist/evaluator/LlamaModel/LlamaModel.js +8 -4
- package/dist/evaluator/LlamaModel/LlamaModel.js.map +1 -1
- package/dist/gguf/fileReaders/GgufFileReader.d.ts +1 -1
- package/dist/gguf/fileReaders/GgufFsFileReader.d.ts +1 -1
- package/dist/gguf/fileReaders/GgufNetworkFetchFileReader.d.ts +1 -1
- package/dist/gguf/insights/GgufInsights.d.ts +1 -0
- package/dist/gguf/insights/GgufInsights.js +8 -0
- package/dist/gguf/insights/GgufInsights.js.map +1 -1
- package/dist/gguf/insights/GgufInsightsConfigurationResolver.d.ts +40 -4
- package/dist/gguf/insights/GgufInsightsConfigurationResolver.js +116 -93
- package/dist/gguf/insights/GgufInsightsConfigurationResolver.js.map +1 -1
- package/dist/gguf/insights/utils/getRamUsageFromUnifiedVram.d.ts +5 -0
- package/dist/gguf/insights/utils/getRamUsageFromUnifiedVram.js +7 -0
- package/dist/gguf/insights/utils/getRamUsageFromUnifiedVram.js.map +1 -0
- package/dist/gguf/insights/utils/resolveContextContextSizeOption.d.ts +11 -1
- package/dist/gguf/insights/utils/resolveContextContextSizeOption.js +47 -17
- package/dist/gguf/insights/utils/resolveContextContextSizeOption.js.map +1 -1
- package/dist/gguf/insights/utils/scoreLevels.js.map +1 -1
- package/dist/gguf/readGgufFileInfo.js +1 -1
- package/dist/gguf/readGgufFileInfo.js.map +1 -1
- package/dist/gguf/utils/getGgufMetadataKeyValue.d.ts +1 -0
- package/dist/gguf/utils/getGgufMetadataKeyValue.js +27 -0
- package/dist/gguf/utils/getGgufMetadataKeyValue.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/StopGenerationDetector.js +1 -1
- package/dist/utils/StopGenerationDetector.js.map +1 -1
- package/dist/utils/ThreadsSplitter.js +2 -2
- package/dist/utils/ThreadsSplitter.js.map +1 -1
- package/dist/utils/createModelDownloader.js.map +1 -1
- package/dist/utils/findCharacterRemovalCountToFitChatHistoryInContext.d.ts +2 -1
- package/dist/utils/findCharacterRemovalCountToFitChatHistoryInContext.js +14 -1
- package/dist/utils/findCharacterRemovalCountToFitChatHistoryInContext.js.map +1 -1
- package/dist/utils/gbnfJson/GbnfGrammarGenerator.d.ts +5 -0
- package/dist/utils/gbnfJson/GbnfGrammarGenerator.js +15 -0
- package/dist/utils/gbnfJson/GbnfGrammarGenerator.js.map +1 -1
- package/dist/utils/gbnfJson/GbnfTerminal.d.ts +3 -0
- package/dist/utils/gbnfJson/GbnfTerminal.js +25 -3
- package/dist/utils/gbnfJson/GbnfTerminal.js.map +1 -1
- package/dist/utils/gbnfJson/getGbnfGrammarForGbnfJsonSchema.d.ts +1 -1
- package/dist/utils/gbnfJson/getGbnfGrammarForGbnfJsonSchema.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfAnyJson.d.ts +9 -0
- package/dist/utils/gbnfJson/terminals/GbnfAnyJson.js +53 -0
- package/dist/utils/gbnfJson/terminals/GbnfAnyJson.js.map +1 -0
- package/dist/utils/gbnfJson/terminals/GbnfArray.d.ts +11 -2
- package/dist/utils/gbnfJson/terminals/GbnfArray.js +64 -15
- package/dist/utils/gbnfJson/terminals/GbnfArray.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfBoolean.d.ts +3 -2
- package/dist/utils/gbnfJson/terminals/GbnfBoolean.js +13 -7
- package/dist/utils/gbnfJson/terminals/GbnfBoolean.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.d.ts +11 -0
- package/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.js +28 -0
- package/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.js.map +1 -0
- package/dist/utils/gbnfJson/terminals/GbnfFormatString.d.ts +11 -0
- package/dist/utils/gbnfJson/terminals/GbnfFormatString.js +90 -0
- package/dist/utils/gbnfJson/terminals/GbnfFormatString.js.map +1 -0
- package/dist/utils/gbnfJson/terminals/GbnfGrammar.d.ts +4 -1
- package/dist/utils/gbnfJson/terminals/GbnfGrammar.js +8 -1
- package/dist/utils/gbnfJson/terminals/GbnfGrammar.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfInsideStringChar.d.ts +5 -0
- package/dist/utils/gbnfJson/terminals/GbnfInsideStringChar.js +24 -0
- package/dist/utils/gbnfJson/terminals/GbnfInsideStringChar.js.map +1 -0
- package/dist/utils/gbnfJson/terminals/GbnfNumber.js +4 -3
- package/dist/utils/gbnfJson/terminals/GbnfNumber.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfNumberValue.d.ts +3 -1
- package/dist/utils/gbnfJson/terminals/GbnfNumberValue.js +8 -2
- package/dist/utils/gbnfJson/terminals/GbnfNumberValue.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfObjectMap.d.ts +14 -5
- package/dist/utils/gbnfJson/terminals/GbnfObjectMap.js +67 -9
- package/dist/utils/gbnfJson/terminals/GbnfObjectMap.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfOr.d.ts +2 -1
- package/dist/utils/gbnfJson/terminals/GbnfOr.js +9 -5
- package/dist/utils/gbnfJson/terminals/GbnfOr.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfRepetition.d.ts +7 -1
- package/dist/utils/gbnfJson/terminals/GbnfRepetition.js +69 -20
- package/dist/utils/gbnfJson/terminals/GbnfRepetition.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfString.d.ts +8 -1
- package/dist/utils/gbnfJson/terminals/GbnfString.js +31 -21
- package/dist/utils/gbnfJson/terminals/GbnfString.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfStringValue.d.ts +2 -0
- package/dist/utils/gbnfJson/terminals/GbnfStringValue.js +7 -4
- package/dist/utils/gbnfJson/terminals/GbnfStringValue.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfWhitespace.d.ts +2 -1
- package/dist/utils/gbnfJson/terminals/GbnfWhitespace.js +24 -5
- package/dist/utils/gbnfJson/terminals/GbnfWhitespace.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/gbnfConsts.d.ts +16 -1
- package/dist/utils/gbnfJson/terminals/gbnfConsts.js +47 -1
- package/dist/utils/gbnfJson/terminals/gbnfConsts.js.map +1 -1
- package/dist/utils/gbnfJson/types.d.ts +164 -17
- package/dist/utils/gbnfJson/types.js +6 -0
- package/dist/utils/gbnfJson/types.js.map +1 -1
- package/dist/utils/gbnfJson/utils/getGbnfJsonTerminalForGbnfJsonSchema.js +61 -9
- package/dist/utils/gbnfJson/utils/getGbnfJsonTerminalForGbnfJsonSchema.js.map +1 -1
- package/dist/utils/gbnfJson/utils/validateObjectAgainstGbnfSchema.js +99 -8
- package/dist/utils/gbnfJson/utils/validateObjectAgainstGbnfSchema.js.map +1 -1
- package/dist/utils/getTypeScriptTypeStringForGbnfJsonSchema.js +125 -16
- package/dist/utils/getTypeScriptTypeStringForGbnfJsonSchema.js.map +1 -1
- package/dist/utils/hashString.js +1 -1
- package/dist/utils/hashString.js.map +1 -1
- package/dist/utils/includesText.d.ts +1 -0
- package/dist/utils/includesText.js +12 -0
- package/dist/utils/includesText.js.map +1 -0
- package/dist/utils/spawnCommand.js +1 -1
- package/dist/utils/spawnCommand.js.map +1 -1
- package/dist/utils/transformPromisable.js +1 -2
- package/dist/utils/transformPromisable.js.map +1 -1
- package/dist/utils/truncateTextAndRoundToWords.d.ts +4 -3
- package/dist/utils/truncateTextAndRoundToWords.js +90 -39
- package/dist/utils/truncateTextAndRoundToWords.js.map +1 -1
- package/dist/utils/waitForLockfileRelease.js +0 -1
- package/dist/utils/waitForLockfileRelease.js.map +1 -1
- package/dist/utils/wrapAbortSignal.d.ts +1 -1
- package/dist/utils/wrapAbortSignal.js +9 -4
- package/dist/utils/wrapAbortSignal.js.map +1 -1
- package/llama/CMakeLists.txt +16 -90
- package/llama/addon/AddonContext.cpp +1 -1
- package/llama/addon/AddonGrammar.cpp +49 -1
- package/llama/addon/AddonGrammar.h +3 -0
- package/llama/addon/AddonModel.cpp +4 -4
- package/llama/addon/AddonSampler.cpp +0 -13
- package/llama/addon/AddonSampler.h +0 -2
- package/llama/addon/addon.cpp +19 -0
- package/llama/addon/globals/getGpuInfo.cpp +61 -53
- package/llama/addon/globals/getSwapInfo.cpp +69 -0
- package/llama/addon/globals/getSwapInfo.h +4 -0
- package/llama/binariesGithubRelease.json +1 -1
- package/llama/gitRelease.bundle +0 -0
- package/llama/gpuInfo/vulkan-gpu-info.cpp +15 -16
- package/llama/gpuInfo/vulkan-gpu-info.h +1 -2
- package/llama/grammars/README.md +1 -1
- package/llama/llama.cpp.info.json +1 -1
- package/package.json +57 -51
- package/templates/README.md +6 -0
- package/templates/packed/electron-typescript-react.json +1 -1
- package/templates/packed/node-typescript.json +1 -1
- package/llama/gpuInfo/cuda-gpu-info.cu +0 -120
- package/llama/gpuInfo/cuda-gpu-info.h +0 -10
- package/llama/gpuInfo/metal-gpu-info.h +0 -8
- package/llama/gpuInfo/metal-gpu-info.mm +0 -30
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
#include "getGpuInfo.h"
|
|
2
2
|
#include "addonLog.h"
|
|
3
3
|
|
|
4
|
-
#ifdef
|
|
5
|
-
#
|
|
4
|
+
#ifdef __APPLE__
|
|
5
|
+
#include <TargetConditionals.h>
|
|
6
6
|
#endif
|
|
7
|
+
|
|
7
8
|
#ifdef GPU_INFO_USE_VULKAN
|
|
8
9
|
# include "../../gpuInfo/vulkan-gpu-info.h"
|
|
9
10
|
#endif
|
|
10
|
-
#ifdef GPU_INFO_USE_METAL
|
|
11
|
-
# include "../../gpuInfo/metal-gpu-info.h"
|
|
12
|
-
#endif
|
|
13
11
|
|
|
14
12
|
|
|
15
|
-
#ifdef GPU_INFO_USE_CUDA
|
|
16
|
-
void logCudaError(const char* message) {
|
|
17
|
-
addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, (std::string("CUDA error: ") + std::string(message)).c_str(), nullptr);
|
|
18
|
-
}
|
|
19
|
-
#endif
|
|
20
13
|
#ifdef GPU_INFO_USE_VULKAN
|
|
21
14
|
void logVulkanWarning(const char* message) {
|
|
22
15
|
addonLlamaCppLogCallback(GGML_LOG_LEVEL_WARN, (std::string("Vulkan warning: ") + std::string(message)).c_str(), nullptr);
|
|
@@ -24,43 +17,52 @@ void logVulkanWarning(const char* message) {
|
|
|
24
17
|
#endif
|
|
25
18
|
|
|
26
19
|
Napi::Value getGpuVramInfo(const Napi::CallbackInfo& info) {
|
|
20
|
+
ggml_backend_dev_t device = NULL;
|
|
21
|
+
size_t deviceTotal = 0;
|
|
22
|
+
size_t deviceFree = 0;
|
|
23
|
+
|
|
27
24
|
uint64_t total = 0;
|
|
28
25
|
uint64_t used = 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
size_t
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
uint64_t unifiedVramSize = 0;
|
|
27
|
+
|
|
28
|
+
for (size_t i = 0; i < ggml_backend_dev_count(); i++) {
|
|
29
|
+
device = ggml_backend_dev_get(i);
|
|
30
|
+
if (ggml_backend_dev_type(device) == GGML_BACKEND_DEVICE_TYPE_GPU) {
|
|
31
|
+
deviceTotal = 0;
|
|
32
|
+
deviceFree = 0;
|
|
33
|
+
ggml_backend_dev_memory(device, &deviceFree, &deviceTotal);
|
|
34
|
+
|
|
35
|
+
total += deviceTotal;
|
|
36
|
+
used += deviceTotal - deviceFree;
|
|
37
|
+
|
|
38
|
+
#if defined(__arm64__) || defined(__aarch64__)
|
|
39
|
+
if (std::string(ggml_backend_dev_name(device)) == "Metal") {
|
|
40
|
+
unifiedVramSize += deviceTotal;
|
|
41
|
+
}
|
|
39
42
|
#endif
|
|
43
|
+
}
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
#ifdef GPU_INFO_USE_VULKAN
|
|
42
47
|
uint64_t vulkanDeviceTotal = 0;
|
|
43
48
|
uint64_t vulkanDeviceUsed = 0;
|
|
44
|
-
|
|
49
|
+
uint64_t vulkanDeviceUnifiedVramSize = 0;
|
|
50
|
+
const bool vulkanDeviceSupportsMemoryBudgetExtension = gpuInfoGetTotalVulkanDevicesInfo(&vulkanDeviceTotal, &vulkanDeviceUsed, &vulkanDeviceUnifiedVramSize, logVulkanWarning);
|
|
45
51
|
|
|
46
52
|
if (vulkanDeviceSupportsMemoryBudgetExtension) {
|
|
47
|
-
total
|
|
48
|
-
|
|
53
|
+
if (vulkanDeviceUnifiedVramSize > total) {
|
|
54
|
+
// this means that we counted memory from devices that aren't used by llama.cpp
|
|
55
|
+
vulkanDeviceUnifiedVramSize = 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
unifiedVramSize += vulkanDeviceUnifiedVramSize;
|
|
49
59
|
}
|
|
50
60
|
#endif
|
|
51
61
|
|
|
52
|
-
#ifdef GPU_INFO_USE_METAL
|
|
53
|
-
uint64_t metalDeviceTotal = 0;
|
|
54
|
-
uint64_t metalDeviceUsed = 0;
|
|
55
|
-
getMetalGpuInfo(&metalDeviceTotal, &metalDeviceUsed);
|
|
56
|
-
|
|
57
|
-
total += metalDeviceTotal;
|
|
58
|
-
used += metalDeviceUsed;
|
|
59
|
-
#endif
|
|
60
|
-
|
|
61
62
|
Napi::Object result = Napi::Object::New(info.Env());
|
|
62
63
|
result.Set("total", Napi::Number::From(info.Env(), total));
|
|
63
64
|
result.Set("used", Napi::Number::From(info.Env(), used));
|
|
65
|
+
result.Set("unifiedSize", Napi::Number::From(info.Env(), unifiedVramSize));
|
|
64
66
|
|
|
65
67
|
return result;
|
|
66
68
|
}
|
|
@@ -68,17 +70,13 @@ Napi::Value getGpuVramInfo(const Napi::CallbackInfo& info) {
|
|
|
68
70
|
Napi::Value getGpuDeviceInfo(const Napi::CallbackInfo& info) {
|
|
69
71
|
std::vector<std::string> deviceNames;
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
#ifdef GPU_INFO_USE_VULKAN
|
|
76
|
-
gpuInfoGetVulkanDeviceNames(&deviceNames, logVulkanWarning);
|
|
77
|
-
#endif
|
|
73
|
+
for (size_t i = 0; i < ggml_backend_dev_count(); i++) {
|
|
74
|
+
ggml_backend_dev_t device = ggml_backend_dev_get(i);
|
|
75
|
+
if (ggml_backend_dev_type(device) == GGML_BACKEND_DEVICE_TYPE_GPU) {
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
deviceNames.push_back(std::string(ggml_backend_dev_description(device)));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
82
80
|
|
|
83
81
|
Napi::Object result = Napi::Object::New(info.Env());
|
|
84
82
|
|
|
@@ -92,17 +90,27 @@ Napi::Value getGpuDeviceInfo(const Napi::CallbackInfo& info) {
|
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
Napi::Value getGpuType(const Napi::CallbackInfo& info) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
for (size_t i = 0; i < ggml_backend_dev_count(); i++) {
|
|
94
|
+
ggml_backend_dev_t device = ggml_backend_dev_get(i);
|
|
95
|
+
const auto deviceName = std::string(ggml_backend_dev_name(device));
|
|
96
|
+
|
|
97
|
+
if (deviceName == "Metal") {
|
|
98
|
+
return Napi::String::New(info.Env(), "metal");
|
|
99
|
+
} else if (std::string(deviceName).find("Vulkan") == 0) {
|
|
100
|
+
return Napi::String::New(info.Env(), "vulkan");
|
|
101
|
+
} else if (std::string(deviceName).find("CUDA") == 0 || std::string(deviceName).find("ROCm") == 0 || std::string(deviceName).find("MUSA") == 0) {
|
|
102
|
+
return Napi::String::New(info.Env(), "cuda");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
for (size_t i = 0; i < ggml_backend_dev_count(); i++) {
|
|
107
|
+
ggml_backend_dev_t device = ggml_backend_dev_get(i);
|
|
108
|
+
const auto deviceName = std::string(ggml_backend_dev_name(device));
|
|
109
|
+
|
|
110
|
+
if (deviceName == "CPU") {
|
|
111
|
+
return Napi::Boolean::New(info.Env(), false);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
106
114
|
|
|
107
115
|
return info.Env().Undefined();
|
|
108
|
-
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#include "getSwapInfo.h"
|
|
2
|
+
#include "addonLog.h"
|
|
3
|
+
|
|
4
|
+
#ifdef __APPLE__
|
|
5
|
+
#include <iostream>
|
|
6
|
+
#include <mach/mach.h>
|
|
7
|
+
#include <sys/sysctl.h>
|
|
8
|
+
#elif __linux__
|
|
9
|
+
#include <iostream>
|
|
10
|
+
#include <sys/sysinfo.h>
|
|
11
|
+
#elif _WIN32
|
|
12
|
+
#include <iostream>
|
|
13
|
+
#include <windows.h>
|
|
14
|
+
#include <psapi.h>
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Napi::Value getSwapInfo(const Napi::CallbackInfo& info) {
|
|
19
|
+
uint64_t totalSwap = 0;
|
|
20
|
+
uint64_t freeSwap = 0;
|
|
21
|
+
uint64_t maxSize = 0;
|
|
22
|
+
bool maxSizeSet = true;
|
|
23
|
+
|
|
24
|
+
#ifdef __APPLE__
|
|
25
|
+
struct xsw_usage swapInfo;
|
|
26
|
+
size_t size = sizeof(swapInfo);
|
|
27
|
+
|
|
28
|
+
if (sysctlbyname("vm.swapusage", &swapInfo, &size, NULL, 0) == 0) {
|
|
29
|
+
totalSwap = swapInfo.xsu_total;
|
|
30
|
+
freeSwap = swapInfo.xsu_avail;
|
|
31
|
+
maxSizeSet = false;
|
|
32
|
+
} else {
|
|
33
|
+
addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, std::string("Failed to get swap info").c_str(), nullptr);
|
|
34
|
+
}
|
|
35
|
+
#elif __linux__
|
|
36
|
+
struct sysinfo sysInfo;
|
|
37
|
+
|
|
38
|
+
if (sysinfo(&sysInfo) == 0) {
|
|
39
|
+
totalSwap = sysInfo.totalswap;
|
|
40
|
+
freeSwap = sysInfo.freeswap;
|
|
41
|
+
maxSize = sysInfo.totalswap;
|
|
42
|
+
} else {
|
|
43
|
+
addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, std::string("Failed to get swap info").c_str(), nullptr);
|
|
44
|
+
}
|
|
45
|
+
#elif _WIN32
|
|
46
|
+
MEMORYSTATUSEX memInfo;
|
|
47
|
+
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
|
48
|
+
|
|
49
|
+
if (GlobalMemoryStatusEx(&memInfo)) {
|
|
50
|
+
PERFORMANCE_INFORMATION perfInfo;
|
|
51
|
+
perfInfo.cb = sizeof(PERFORMANCE_INFORMATION);
|
|
52
|
+
if (GetPerformanceInfo(&perfInfo, sizeof(perfInfo))) {
|
|
53
|
+
totalSwap = memInfo.ullTotalPageFile;
|
|
54
|
+
freeSwap = memInfo.ullAvailPageFile;
|
|
55
|
+
maxSize = perfInfo.CommitLimit * perfInfo.PageSize;
|
|
56
|
+
} else {
|
|
57
|
+
addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, std::string("Failed to get max pagefile size").c_str(), nullptr);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
addonLlamaCppLogCallback(GGML_LOG_LEVEL_ERROR, std::string("Failed to get pagefile info").c_str(), nullptr);
|
|
61
|
+
}
|
|
62
|
+
#endif
|
|
63
|
+
|
|
64
|
+
Napi::Object obj = Napi::Object::New(info.Env());
|
|
65
|
+
obj.Set("total", Napi::Number::New(info.Env(), totalSwap));
|
|
66
|
+
obj.Set("free", Napi::Number::New(info.Env(), freeSwap));
|
|
67
|
+
obj.Set("maxSize", maxSizeSet ? Napi::Number::New(info.Env(), maxSize) : Napi::Number::New(info.Env(), -1));
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
package/llama/gitRelease.bundle
CHANGED
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
typedef void (*gpuInfoVulkanWarningLogCallback_t)(const char* message);
|
|
7
7
|
|
|
8
|
-
static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNames, std::vector<std::string> * deviceNames, gpuInfoVulkanWarningLogCallback_t warningLogCallback) {
|
|
8
|
+
static bool enumerateVulkanDevices(size_t* total, size_t* used, size_t* unifiedMemorySize, bool addDeviceNames, std::vector<std::string> * deviceNames, gpuInfoVulkanWarningLogCallback_t warningLogCallback) {
|
|
9
9
|
vk::ApplicationInfo appInfo("node-llama-cpp GPU info", 1, "llama.cpp", 1, VK_API_VERSION_1_2);
|
|
10
10
|
vk::InstanceCreateInfo createInfo(vk::InstanceCreateFlags(), &appInfo, {}, {});
|
|
11
11
|
vk::Instance instance = vk::createInstance(createInfo);
|
|
@@ -14,6 +14,7 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNa
|
|
|
14
14
|
|
|
15
15
|
size_t usedMem = 0;
|
|
16
16
|
size_t totalMem = 0;
|
|
17
|
+
size_t totalUnifiedMemorySize = 0;
|
|
17
18
|
|
|
18
19
|
for (size_t i = 0; i < physicalDevices.size(); i++) {
|
|
19
20
|
vk::PhysicalDevice physicalDevice = physicalDevices[i];
|
|
@@ -41,16 +42,20 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNa
|
|
|
41
42
|
physicalDevice.getMemoryProperties2(&memProps2);
|
|
42
43
|
|
|
43
44
|
for (uint32_t i = 0; i < memProps.memoryHeapCount; ++i) {
|
|
44
|
-
|
|
45
|
+
const auto flags = memProps.memoryHeaps[i].flags;
|
|
46
|
+
|
|
47
|
+
if (flags & vk::MemoryHeapFlagBits::eDeviceLocal) {
|
|
45
48
|
const auto size = memProps.memoryHeaps[i].size;
|
|
46
49
|
totalMem += size;
|
|
47
50
|
usedMem += memoryBudgetProperties.heapUsage[i];
|
|
48
51
|
|
|
52
|
+
if (flags & vk::MemoryHeapFlagBits::eMultiInstance) {
|
|
53
|
+
totalUnifiedMemorySize += size;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
if (size > 0 && addDeviceNames) {
|
|
50
57
|
(*deviceNames).push_back(std::string(deviceProps.deviceName.data()));
|
|
51
58
|
}
|
|
52
|
-
|
|
53
|
-
break;
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
} else {
|
|
@@ -58,9 +63,8 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNa
|
|
|
58
63
|
warningLogCallback(
|
|
59
64
|
(
|
|
60
65
|
"Vulkan VK_EXT_memory_budget extension not supported for device \"" +
|
|
61
|
-
std::string(deviceProps.deviceName.data()) + "\", so VRAM info cannot be
|
|
62
|
-
)
|
|
63
|
-
.c_str()
|
|
66
|
+
std::string(deviceProps.deviceName.data()) + "\", so VRAM info cannot be determined for it"
|
|
67
|
+
).c_str()
|
|
64
68
|
);
|
|
65
69
|
return false;
|
|
66
70
|
}
|
|
@@ -68,16 +72,11 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNa
|
|
|
68
72
|
|
|
69
73
|
*total = totalMem;
|
|
70
74
|
*used = usedMem;
|
|
71
|
-
|
|
72
|
-
}
|
|
75
|
+
*unifiedMemorySize = totalUnifiedMemorySize;
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
return enumerateVulkanDevices(total, used, false, nullptr, warningLogCallback);
|
|
77
|
+
return true;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
bool
|
|
79
|
-
|
|
80
|
-
size_t vulkanDeviceUsed = 0;
|
|
81
|
-
|
|
82
|
-
return enumerateVulkanDevices(&vulkanDeviceTotal, &vulkanDeviceUsed, true, deviceNames, warningLogCallback);
|
|
80
|
+
bool gpuInfoGetTotalVulkanDevicesInfo(size_t* total, size_t* used, size_t* unifiedMemorySize, gpuInfoVulkanWarningLogCallback_t warningLogCallback) {
|
|
81
|
+
return enumerateVulkanDevices(total, used, unifiedMemorySize, false, nullptr, warningLogCallback);
|
|
83
82
|
}
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
|
|
6
6
|
typedef void (*gpuInfoVulkanWarningLogCallback_t)(const char* message);
|
|
7
7
|
|
|
8
|
-
bool gpuInfoGetTotalVulkanDevicesInfo(size_t* total, size_t* used, gpuInfoVulkanWarningLogCallback_t warningLogCallback);
|
|
9
|
-
bool gpuInfoGetVulkanDeviceNames(std::vector<std::string> * deviceNames, gpuInfoVulkanWarningLogCallback_t warningLogCallback);
|
|
8
|
+
bool gpuInfoGetTotalVulkanDevicesInfo(size_t* total, size_t* used, size_t* unifiedMemorySize, gpuInfoVulkanWarningLogCallback_t warningLogCallback);
|
package/llama/grammars/README.md
CHANGED
|
@@ -124,7 +124,7 @@ You can use GBNF grammars:
|
|
|
124
124
|
- In [llama-cli](../examples/main), passed as the `--json` / `-j` flag
|
|
125
125
|
- To convert to a grammar ahead of time:
|
|
126
126
|
- in CLI, with [examples/json_schema_to_grammar.py](../examples/json_schema_to_grammar.py)
|
|
127
|
-
- in JavaScript with [json-schema-to-grammar.mjs](../examples/server/
|
|
127
|
+
- in JavaScript with [json-schema-to-grammar.mjs](../examples/server/public_legacy/json-schema-to-grammar.mjs) (this is used by the [server](../examples/server)'s Web UI)
|
|
128
128
|
|
|
129
129
|
Take a look at [tests](../tests/test-json-schema-to-grammar.cpp) to see which features are likely supported (you'll also find usage examples in https://github.com/ggerganov/llama.cpp/pull/5978, https://github.com/ggerganov/llama.cpp/pull/6659 & https://github.com/ggerganov/llama.cpp/pull/6555).
|
|
130
130
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-llama-cpp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"test:modelDependent:interactive": "vitest watch ./test/modelDependent",
|
|
61
61
|
"test:typescript": "tsc --noEmit --project tsconfig.json",
|
|
62
62
|
"lint": "npm run lint:eslint",
|
|
63
|
-
"lint:eslint": "eslint --
|
|
63
|
+
"lint:eslint": "eslint --report-unused-disable-directives .",
|
|
64
64
|
"format": "npm run lint:eslint -- --fix",
|
|
65
65
|
"dev:setup:downloadAllTestModels": "vite-node test/utils/scripts/downloadAllTestModels.ts",
|
|
66
66
|
"dev:setup": "npm run build && node ./dist/cli/cli.js source download --noUsageExample && npm run docs:generateTypedoc && npm run dev:setup:downloadAllTestModels",
|
|
@@ -112,7 +112,10 @@
|
|
|
112
112
|
"batching",
|
|
113
113
|
"gpu"
|
|
114
114
|
],
|
|
115
|
-
"author":
|
|
115
|
+
"author": {
|
|
116
|
+
"name": "Gilad S.",
|
|
117
|
+
"url": "https://github.com/giladgd"
|
|
118
|
+
},
|
|
116
119
|
"license": "MIT",
|
|
117
120
|
"preferUnplugged": true,
|
|
118
121
|
"bugs": {
|
|
@@ -124,81 +127,84 @@
|
|
|
124
127
|
},
|
|
125
128
|
"homepage": "https://node-llama-cpp.withcat.ai",
|
|
126
129
|
"devDependencies": {
|
|
127
|
-
"@commitlint/cli": "^19.
|
|
128
|
-
"@commitlint/config-conventional": "^19.
|
|
130
|
+
"@commitlint/cli": "^19.6.0",
|
|
131
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
132
|
+
"@eslint/compat": "^1.2.3",
|
|
129
133
|
"@fontsource/inter": "^5.1.0",
|
|
130
|
-
"@nolebase/vitepress-plugin-git-changelog": "^2.
|
|
131
|
-
"@nolebase/vitepress-plugin-og-image": "^2.
|
|
134
|
+
"@nolebase/vitepress-plugin-git-changelog": "^2.11.1",
|
|
135
|
+
"@nolebase/vitepress-plugin-og-image": "^2.11.1",
|
|
132
136
|
"@resvg/resvg-js": "^2.6.2",
|
|
133
137
|
"@semantic-release/exec": "^6.0.3",
|
|
134
|
-
"@semantic-release/github": "11.0.
|
|
138
|
+
"@semantic-release/github": "11.0.1",
|
|
135
139
|
"@semantic-release/npm": "12.0.1",
|
|
136
|
-
"@shikijs/vitepress-twoslash": "^1.
|
|
137
|
-
"@
|
|
140
|
+
"@shikijs/vitepress-twoslash": "^1.24.0",
|
|
141
|
+
"@stylistic/eslint-plugin": "^2.11.0",
|
|
142
|
+
"@types/async-retry": "^1.4.9",
|
|
138
143
|
"@types/bytes": "^3.1.4",
|
|
139
144
|
"@types/cross-spawn": "^6.0.2",
|
|
140
145
|
"@types/fs-extra": "^11.0.4",
|
|
141
|
-
"@types/node": "^22.
|
|
146
|
+
"@types/node": "^22.10.1",
|
|
142
147
|
"@types/proper-lockfile": "^4.1.4",
|
|
143
148
|
"@types/semver": "^7.5.8",
|
|
144
149
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
145
150
|
"@types/which": "^3.0.4",
|
|
146
151
|
"@types/yargs": "^17.0.33",
|
|
147
|
-
"@
|
|
148
|
-
"@
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"eslint": "^
|
|
152
|
-
"eslint-plugin-import": "^2.
|
|
153
|
-
"eslint-plugin-jsdoc": "^50.
|
|
154
|
-
"eslint-plugin-n": "^17.
|
|
152
|
+
"@vitest/coverage-v8": "^2.1.6",
|
|
153
|
+
"@vitest/ui": "^2.1.6",
|
|
154
|
+
"electron": "^33.2.1",
|
|
155
|
+
"eslint": "^9.16.0",
|
|
156
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
157
|
+
"eslint-plugin-import": "^2.31.0",
|
|
158
|
+
"eslint-plugin-jsdoc": "^50.6.0",
|
|
159
|
+
"eslint-plugin-n": "^17.14.0",
|
|
155
160
|
"feed": "^4.2.2",
|
|
156
|
-
"husky": "^9.1.
|
|
161
|
+
"husky": "^9.1.7",
|
|
157
162
|
"rehype": "^13.0.1",
|
|
158
163
|
"rimraf": "^6.0.1",
|
|
159
|
-
"semantic-release": "24.
|
|
164
|
+
"semantic-release": "^24.2.0",
|
|
160
165
|
"sharp": "^0.33.5",
|
|
161
|
-
"tslib": "^2.
|
|
162
|
-
"typedoc": "^0.
|
|
163
|
-
"typedoc-plugin-markdown": "^4.
|
|
164
|
-
"typedoc-plugin-mdn-links": "^
|
|
165
|
-
"typedoc-vitepress-theme": "^1.0
|
|
166
|
-
"typescript": "^5.
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
166
|
+
"tslib": "^2.8.1",
|
|
167
|
+
"typedoc": "^0.27.2",
|
|
168
|
+
"typedoc-plugin-markdown": "^4.3.1",
|
|
169
|
+
"typedoc-plugin-mdn-links": "^4.0.3",
|
|
170
|
+
"typedoc-vitepress-theme": "^1.1.0",
|
|
171
|
+
"typescript": "^5.7.2",
|
|
172
|
+
"typescript-eslint": "^8.16.0",
|
|
173
|
+
"vite-node": "^2.1.6",
|
|
174
|
+
"vitepress": "^1.5.0",
|
|
175
|
+
"vitest": "^2.1.6",
|
|
176
|
+
"zx": "^8.2.4"
|
|
171
177
|
},
|
|
172
178
|
"dependencies": {
|
|
173
|
-
"@huggingface/jinja": "^0.3.
|
|
179
|
+
"@huggingface/jinja": "^0.3.2",
|
|
174
180
|
"async-retry": "^1.3.3",
|
|
175
181
|
"bytes": "^3.1.2",
|
|
176
182
|
"chalk": "^5.3.0",
|
|
177
183
|
"chmodrp": "^1.0.2",
|
|
178
184
|
"cmake-js": "^7.3.0",
|
|
179
185
|
"cross-env": "^7.0.3",
|
|
180
|
-
"cross-spawn": "^7.0.
|
|
186
|
+
"cross-spawn": "^7.0.6",
|
|
181
187
|
"env-var": "^7.5.0",
|
|
182
188
|
"filenamify": "^6.0.0",
|
|
183
189
|
"fs-extra": "^11.2.0",
|
|
184
190
|
"ignore": "^5.3.2",
|
|
185
|
-
"ipull": "^3.
|
|
191
|
+
"ipull": "^3.9.2",
|
|
186
192
|
"is-unicode-supported": "^2.1.0",
|
|
187
193
|
"lifecycle-utils": "^1.7.0",
|
|
188
194
|
"log-symbols": "^7.0.0",
|
|
189
|
-
"nanoid": "^5.0.
|
|
190
|
-
"node-addon-api": "^8.
|
|
195
|
+
"nanoid": "^5.0.9",
|
|
196
|
+
"node-addon-api": "^8.3.0",
|
|
191
197
|
"octokit": "^4.0.2",
|
|
192
|
-
"ora": "^8.1.
|
|
193
|
-
"pretty-ms": "^9.
|
|
198
|
+
"ora": "^8.1.1",
|
|
199
|
+
"pretty-ms": "^9.2.0",
|
|
194
200
|
"proper-lockfile": "^4.1.2",
|
|
195
201
|
"semver": "^7.6.3",
|
|
196
202
|
"simple-git": "^3.27.0",
|
|
197
203
|
"slice-ansi": "^7.1.0",
|
|
198
204
|
"stdout-update": "^4.0.1",
|
|
199
205
|
"strip-ansi": "^7.1.0",
|
|
200
|
-
"validate-npm-package-name": "^
|
|
201
|
-
"which": "^
|
|
206
|
+
"validate-npm-package-name": "^6.0.0",
|
|
207
|
+
"which": "^5.0.0",
|
|
202
208
|
"yargs": "^17.7.2"
|
|
203
209
|
},
|
|
204
210
|
"peerDependencies": {
|
|
@@ -210,16 +216,16 @@
|
|
|
210
216
|
}
|
|
211
217
|
},
|
|
212
218
|
"optionalDependencies": {
|
|
213
|
-
"@node-llama-cpp/linux-arm64": "3.
|
|
214
|
-
"@node-llama-cpp/linux-armv7l": "3.
|
|
215
|
-
"@node-llama-cpp/linux-x64": "3.
|
|
216
|
-
"@node-llama-cpp/linux-x64-cuda": "3.
|
|
217
|
-
"@node-llama-cpp/linux-x64-vulkan": "3.
|
|
218
|
-
"@node-llama-cpp/mac-arm64-metal": "3.
|
|
219
|
-
"@node-llama-cpp/mac-x64": "3.
|
|
220
|
-
"@node-llama-cpp/win-arm64": "3.
|
|
221
|
-
"@node-llama-cpp/win-x64": "3.
|
|
222
|
-
"@node-llama-cpp/win-x64-cuda": "3.
|
|
223
|
-
"@node-llama-cpp/win-x64-vulkan": "3.
|
|
219
|
+
"@node-llama-cpp/linux-arm64": "3.3.0",
|
|
220
|
+
"@node-llama-cpp/linux-armv7l": "3.3.0",
|
|
221
|
+
"@node-llama-cpp/linux-x64": "3.3.0",
|
|
222
|
+
"@node-llama-cpp/linux-x64-cuda": "3.3.0",
|
|
223
|
+
"@node-llama-cpp/linux-x64-vulkan": "3.3.0",
|
|
224
|
+
"@node-llama-cpp/mac-arm64-metal": "3.3.0",
|
|
225
|
+
"@node-llama-cpp/mac-x64": "3.3.0",
|
|
226
|
+
"@node-llama-cpp/win-arm64": "3.3.0",
|
|
227
|
+
"@node-llama-cpp/win-x64": "3.3.0",
|
|
228
|
+
"@node-llama-cpp/win-x64-cuda": "3.3.0",
|
|
229
|
+
"@node-llama-cpp/win-x64-vulkan": "3.3.0"
|
|
224
230
|
}
|
|
225
231
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Use the following command to scaffold a project from a template:
|
|
2
|
+
```bash
|
|
3
|
+
npm create node-llama-cpp@latest
|
|
4
|
+
```
|
|
5
|
+
|
|
6
|
+
> Don't use the templates in this repository directly. They are built to be used with `npm create` command ([learn more](https://node-llama-cpp.withcat.ai/guide/))
|