Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get VRAM state #161

Merged
merged 22 commits into from
Feb 10, 2024
Merged

feat: get VRAM state #161

merged 22 commits into from
Feb 10, 2024

Conversation

giladgd
Copy link
Contributor

@giladgd giladgd commented Feb 10, 2024

Description of change

  • feat: get VRAM state
  • feat: chatWrapper getter on a LlamaChatSession
  • fix(resolveChatWrapperBasedOnModel): use llamaChat wrapper for llama models only if there's a chat sub-variant
  • fix: update latest build on postinstall compilation

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

  • Code is up-to-date with the master branch
  • npm run format to apply eslint formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits and pull request title follow conventions explained in pull request guidelines (PRs that do not follow this convention will not be merged)

@giladgd giladgd requested a review from ido-pluto February 10, 2024 15:08
@giladgd giladgd self-assigned this Feb 10, 2024
Copy link
Contributor

@ido-pluto ido-pluto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giladgd giladgd merged commit 46235a2 into beta Feb 10, 2024
11 checks passed
@giladgd giladgd deleted the gilad/vramUsage branch February 10, 2024 20:31
Copy link

🎉 This PR is included in version 3.0.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Sep 24, 2024

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants