withcatai / node-llama-cpp

Run AI models locally on your machine with node.js bindings for llama.cpp. Force a JSON schema on the model output on the generation level
https://withcatai.github.io/node-llama-cpp/
MIT License
760 stars 65 forks source link

feat: get VRAM state #161

Closed giladgd closed 5 months ago

giladgd commented 5 months ago

Description of change

How to get the current VRAM state

import {getLlama} from "node-llama-cpp";

const llama = await getLlama();
const vramState = llama.getVramState();

console.log("Total VRAM:", vramState.total);
console.log("Used VRAM:", vramState.used);
console.log("Free VRAM:", vramState.free);

Pull-Request Checklist

github-actions[bot] commented 5 months ago

:tada: This PR is included in version 3.0.0-beta.10 :tada:

The release is available on:

Your semantic-release bot :package::rocket: