node-llama-cpp 3.1.0 → 3.2.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 +6 -0
- package/dist/bindings/Llama.d.ts +33 -0
- package/dist/bindings/Llama.js +85 -8
- package/dist/bindings/Llama.js.map +1 -1
- package/dist/bindings/getLlama.d.ts +22 -1
- package/dist/bindings/getLlama.js +18 -3
- 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.js +15 -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/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/utils/ChatModelFunctionsDocumentationGenerator.js +1 -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/isJinjaTemplateEquivalentToSpecializedChatWrapper.js.map +1 -1
- package/dist/chatWrappers/utils/resolveChatWrapper.js +1 -1
- package/dist/chatWrappers/utils/resolveChatWrapper.js.map +1 -1
- package/dist/cli/commands/ChatCommand.js +1 -2
- 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/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/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 +12 -12
- 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 +16 -6
- package/dist/evaluator/LlamaChatSession/LlamaChatSession.js.map +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/LlamaModel/LlamaModel.js +8 -4
- package/dist/evaluator/LlamaModel/LlamaModel.js.map +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 +2 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- 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/terminals/GbnfNumber.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfObjectMap.js.map +1 -1
- package/dist/utils/gbnfJson/terminals/GbnfOr.js +4 -4
- package/dist/utils/gbnfJson/terminals/GbnfOr.js.map +1 -1
- package/dist/utils/getLlamaClasses.d.ts +9 -0
- package/dist/utils/getLlamaClasses.js +14 -0
- package/dist/utils/getLlamaClasses.js.map +1 -0
- package/dist/utils/hashString.js +1 -1
- package/dist/utils/hashString.js.map +1 -1
- 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/llama/CMakeLists.txt +6 -0
- package/llama/addon/AddonContext.cpp +1 -1
- 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 +2 -0
- package/llama/addon/globals/getGpuInfo.cpp +8 -2
- 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/metal-gpu-info.h +1 -1
- package/llama/gpuInfo/metal-gpu-info.mm +8 -1
- package/llama/gpuInfo/vulkan-gpu-info.cpp +17 -10
- package/llama/gpuInfo/vulkan-gpu-info.h +1 -1
- package/llama/llama.cpp.info.json +1 -1
- package/package.json +45 -43
- package/templates/packed/electron-typescript-react.json +1 -1
- package/templates/packed/node-typescript.json +1 -1
|
@@ -26,6 +26,7 @@ void logVulkanWarning(const char* message) {
|
|
|
26
26
|
Napi::Value getGpuVramInfo(const Napi::CallbackInfo& info) {
|
|
27
27
|
uint64_t total = 0;
|
|
28
28
|
uint64_t used = 0;
|
|
29
|
+
uint64_t unifiedVramSize = 0;
|
|
29
30
|
|
|
30
31
|
#ifdef GPU_INFO_USE_CUDA
|
|
31
32
|
size_t cudaDeviceTotal = 0;
|
|
@@ -41,26 +42,31 @@ Napi::Value getGpuVramInfo(const Napi::CallbackInfo& info) {
|
|
|
41
42
|
#ifdef GPU_INFO_USE_VULKAN
|
|
42
43
|
uint64_t vulkanDeviceTotal = 0;
|
|
43
44
|
uint64_t vulkanDeviceUsed = 0;
|
|
44
|
-
|
|
45
|
+
uint64_t vulkanDeviceUnifiedVramSize = 0;
|
|
46
|
+
const bool vulkanDeviceSupportsMemoryBudgetExtension = gpuInfoGetTotalVulkanDevicesInfo(&vulkanDeviceTotal, &vulkanDeviceUsed, &vulkanDeviceUnifiedVramSize, logVulkanWarning);
|
|
45
47
|
|
|
46
48
|
if (vulkanDeviceSupportsMemoryBudgetExtension) {
|
|
47
49
|
total += vulkanDeviceTotal;
|
|
48
50
|
used += vulkanDeviceUsed;
|
|
51
|
+
unifiedVramSize += vulkanDeviceUnifiedVramSize;
|
|
49
52
|
}
|
|
50
53
|
#endif
|
|
51
54
|
|
|
52
55
|
#ifdef GPU_INFO_USE_METAL
|
|
53
56
|
uint64_t metalDeviceTotal = 0;
|
|
54
57
|
uint64_t metalDeviceUsed = 0;
|
|
55
|
-
|
|
58
|
+
uint64_t metalDeviceUnifiedVramSize = 0;
|
|
59
|
+
getMetalGpuInfo(&metalDeviceTotal, &metalDeviceUsed, &metalDeviceUnifiedVramSize);
|
|
56
60
|
|
|
57
61
|
total += metalDeviceTotal;
|
|
58
62
|
used += metalDeviceUsed;
|
|
63
|
+
unifiedVramSize += metalDeviceUnifiedVramSize;
|
|
59
64
|
#endif
|
|
60
65
|
|
|
61
66
|
Napi::Object result = Napi::Object::New(info.Env());
|
|
62
67
|
result.Set("total", Napi::Number::From(info.Env(), total));
|
|
63
68
|
result.Set("used", Napi::Number::From(info.Env(), used));
|
|
69
|
+
result.Set("unifiedSize", Napi::Number::From(info.Env(), unifiedVramSize));
|
|
64
70
|
|
|
65
71
|
return result;
|
|
66
72
|
}
|
|
@@ -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
|
|
@@ -3,15 +3,22 @@
|
|
|
3
3
|
#include <string>
|
|
4
4
|
#import <Metal/Metal.h>
|
|
5
5
|
|
|
6
|
-
void getMetalGpuInfo(uint64_t * total, uint64_t * used) {
|
|
6
|
+
void getMetalGpuInfo(uint64_t * total, uint64_t * used, uint64_t * unifiedMemorySize) {
|
|
7
7
|
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
|
|
8
8
|
|
|
9
9
|
if (device) {
|
|
10
10
|
*total = device.recommendedMaxWorkingSetSize;
|
|
11
11
|
*used = device.currentAllocatedSize;
|
|
12
|
+
|
|
13
|
+
if (device.hasUnifiedMemory) {
|
|
14
|
+
*unifiedMemorySize = device.recommendedMaxWorkingSetSize;
|
|
15
|
+
} else {
|
|
16
|
+
*unifiedMemorySize = 0;
|
|
17
|
+
}
|
|
12
18
|
} else {
|
|
13
19
|
*total = 0;
|
|
14
20
|
*used = 0;
|
|
21
|
+
*unifiedMemorySize = 0;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
[device release];
|
|
@@ -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,19 @@ static bool enumerateVulkanDevices(size_t* total, size_t* used, bool addDeviceNa
|
|
|
68
72
|
|
|
69
73
|
*total = totalMem;
|
|
70
74
|
*used = usedMem;
|
|
75
|
+
*unifiedMemorySize = totalUnifiedMemorySize;
|
|
76
|
+
|
|
71
77
|
return true;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
bool gpuInfoGetTotalVulkanDevicesInfo(size_t* total, size_t* used, gpuInfoVulkanWarningLogCallback_t warningLogCallback) {
|
|
75
|
-
return enumerateVulkanDevices(total, used, false, nullptr, 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);
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
bool gpuInfoGetVulkanDeviceNames(std::vector<std::string> * deviceNames, gpuInfoVulkanWarningLogCallback_t warningLogCallback) {
|
|
79
85
|
size_t vulkanDeviceTotal = 0;
|
|
80
86
|
size_t vulkanDeviceUsed = 0;
|
|
87
|
+
size_t unifiedMemorySize = 0;
|
|
81
88
|
|
|
82
|
-
return enumerateVulkanDevices(&vulkanDeviceTotal, &vulkanDeviceUsed, true, deviceNames, warningLogCallback);
|
|
89
|
+
return enumerateVulkanDevices(&vulkanDeviceTotal, &vulkanDeviceUsed, &unifiedMemorySize, true, deviceNames, warningLogCallback);
|
|
83
90
|
}
|
|
@@ -5,5 +5,5 @@
|
|
|
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);
|
|
8
|
+
bool gpuInfoGetTotalVulkanDevicesInfo(size_t* total, size_t* used, size_t* unifiedMemorySize, gpuInfoVulkanWarningLogCallback_t warningLogCallback);
|
|
9
9
|
bool gpuInfoGetVulkanDeviceNames(std::vector<std::string> * deviceNames, gpuInfoVulkanWarningLogCallback_t warningLogCallback);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-llama-cpp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.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",
|
|
@@ -126,51 +126,53 @@
|
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@commitlint/cli": "^19.5.0",
|
|
128
128
|
"@commitlint/config-conventional": "^19.5.0",
|
|
129
|
+
"@eslint/compat": "^1.2.2",
|
|
129
130
|
"@fontsource/inter": "^5.1.0",
|
|
130
|
-
"@nolebase/vitepress-plugin-git-changelog": "^2.
|
|
131
|
-
"@nolebase/vitepress-plugin-og-image": "^2.
|
|
131
|
+
"@nolebase/vitepress-plugin-git-changelog": "^2.6.1",
|
|
132
|
+
"@nolebase/vitepress-plugin-og-image": "^2.6.1",
|
|
132
133
|
"@resvg/resvg-js": "^2.6.2",
|
|
133
134
|
"@semantic-release/exec": "^6.0.3",
|
|
134
135
|
"@semantic-release/github": "11.0.0",
|
|
135
136
|
"@semantic-release/npm": "12.0.1",
|
|
136
|
-
"@shikijs/vitepress-twoslash": "^1.
|
|
137
|
-
"@
|
|
137
|
+
"@shikijs/vitepress-twoslash": "^1.22.2",
|
|
138
|
+
"@stylistic/eslint-plugin": "^2.9.0",
|
|
139
|
+
"@types/async-retry": "^1.4.9",
|
|
138
140
|
"@types/bytes": "^3.1.4",
|
|
139
141
|
"@types/cross-spawn": "^6.0.2",
|
|
140
142
|
"@types/fs-extra": "^11.0.4",
|
|
141
|
-
"@types/node": "^22.
|
|
143
|
+
"@types/node": "^22.8.4",
|
|
142
144
|
"@types/proper-lockfile": "^4.1.4",
|
|
143
145
|
"@types/semver": "^7.5.8",
|
|
144
146
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
145
147
|
"@types/which": "^3.0.4",
|
|
146
148
|
"@types/yargs": "^17.0.33",
|
|
147
|
-
"@
|
|
148
|
-
"@
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"eslint": "^
|
|
152
|
-
"eslint-plugin-
|
|
153
|
-
"eslint-plugin-
|
|
154
|
-
"eslint-plugin-n": "^17.10.2",
|
|
149
|
+
"@vitest/coverage-v8": "^2.1.4",
|
|
150
|
+
"@vitest/ui": "^2.1.4",
|
|
151
|
+
"eslint": "^9.13.0",
|
|
152
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
153
|
+
"eslint-plugin-import": "^2.31.0",
|
|
154
|
+
"eslint-plugin-jsdoc": "^50.4.3",
|
|
155
|
+
"eslint-plugin-n": "^17.12.0",
|
|
155
156
|
"feed": "^4.2.2",
|
|
156
157
|
"husky": "^9.1.6",
|
|
157
158
|
"rehype": "^13.0.1",
|
|
158
159
|
"rimraf": "^6.0.1",
|
|
159
|
-
"semantic-release": "24.
|
|
160
|
+
"semantic-release": "^24.2.0",
|
|
160
161
|
"sharp": "^0.33.5",
|
|
161
|
-
"tslib": "^2.
|
|
162
|
-
"typedoc": "^0.26.
|
|
163
|
-
"typedoc-plugin-markdown": "^4.2.
|
|
164
|
-
"typedoc-plugin-mdn-links": "^3.3.
|
|
165
|
-
"typedoc-vitepress-theme": "^1.0.
|
|
166
|
-
"typescript": "^5.6.
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
162
|
+
"tslib": "^2.8.0",
|
|
163
|
+
"typedoc": "^0.26.10",
|
|
164
|
+
"typedoc-plugin-markdown": "^4.2.9",
|
|
165
|
+
"typedoc-plugin-mdn-links": "^3.3.5",
|
|
166
|
+
"typedoc-vitepress-theme": "^1.0.2",
|
|
167
|
+
"typescript": "^5.6.3",
|
|
168
|
+
"typescript-eslint": "^8.12.2",
|
|
169
|
+
"vite-node": "^2.1.4",
|
|
170
|
+
"vitepress": "^1.4.2",
|
|
171
|
+
"vitest": "^2.1.4",
|
|
172
|
+
"zx": "^8.1.9"
|
|
171
173
|
},
|
|
172
174
|
"dependencies": {
|
|
173
|
-
"@huggingface/jinja": "^0.3.
|
|
175
|
+
"@huggingface/jinja": "^0.3.2",
|
|
174
176
|
"async-retry": "^1.3.3",
|
|
175
177
|
"bytes": "^3.1.2",
|
|
176
178
|
"chalk": "^5.3.0",
|
|
@@ -182,12 +184,12 @@
|
|
|
182
184
|
"filenamify": "^6.0.0",
|
|
183
185
|
"fs-extra": "^11.2.0",
|
|
184
186
|
"ignore": "^5.3.2",
|
|
185
|
-
"ipull": "^3.
|
|
187
|
+
"ipull": "^3.9.0",
|
|
186
188
|
"is-unicode-supported": "^2.1.0",
|
|
187
189
|
"lifecycle-utils": "^1.7.0",
|
|
188
190
|
"log-symbols": "^7.0.0",
|
|
189
|
-
"nanoid": "^5.0.
|
|
190
|
-
"node-addon-api": "^8.1
|
|
191
|
+
"nanoid": "^5.0.8",
|
|
192
|
+
"node-addon-api": "^8.2.1",
|
|
191
193
|
"octokit": "^4.0.2",
|
|
192
194
|
"ora": "^8.1.0",
|
|
193
195
|
"pretty-ms": "^9.1.0",
|
|
@@ -197,8 +199,8 @@
|
|
|
197
199
|
"slice-ansi": "^7.1.0",
|
|
198
200
|
"stdout-update": "^4.0.1",
|
|
199
201
|
"strip-ansi": "^7.1.0",
|
|
200
|
-
"validate-npm-package-name": "^
|
|
201
|
-
"which": "^
|
|
202
|
+
"validate-npm-package-name": "^6.0.0",
|
|
203
|
+
"which": "^5.0.0",
|
|
202
204
|
"yargs": "^17.7.2"
|
|
203
205
|
},
|
|
204
206
|
"peerDependencies": {
|
|
@@ -210,16 +212,16 @@
|
|
|
210
212
|
}
|
|
211
213
|
},
|
|
212
214
|
"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.
|
|
215
|
+
"@node-llama-cpp/linux-arm64": "3.2.0",
|
|
216
|
+
"@node-llama-cpp/linux-armv7l": "3.2.0",
|
|
217
|
+
"@node-llama-cpp/linux-x64": "3.2.0",
|
|
218
|
+
"@node-llama-cpp/linux-x64-cuda": "3.2.0",
|
|
219
|
+
"@node-llama-cpp/linux-x64-vulkan": "3.2.0",
|
|
220
|
+
"@node-llama-cpp/mac-arm64-metal": "3.2.0",
|
|
221
|
+
"@node-llama-cpp/mac-x64": "3.2.0",
|
|
222
|
+
"@node-llama-cpp/win-arm64": "3.2.0",
|
|
223
|
+
"@node-llama-cpp/win-x64": "3.2.0",
|
|
224
|
+
"@node-llama-cpp/win-x64-cuda": "3.2.0",
|
|
225
|
+
"@node-llama-cpp/win-x64-vulkan": "3.2.0"
|
|
224
226
|
}
|
|
225
227
|
}
|