Skip to content

Conversation

@giladgd
Copy link
Member

@giladgd giladgd commented Sep 9, 2023

Description of change

Use cmake via cmake-js to build llama.cpp from source instead of node-gyp.

cmake-js has multiple advantages over node-gyp for node-llama-cpp:

  • llama.cpp itself uses cmake, so using cmake here will be better align with llama.cpp and will be able to support all of its features
  • cmake doesn't use python, so there won't be any need to mess with python installations anymore just to compile llama.cpp from source
  • cmake has less dependencies, thus making it more practical to use
  • If cmake is not installed on the local machine, the cmake binary will be downloaded to an internal directory so node-llama-cpp can use it without even having it installed.

Since the dependencies of node-gyp cover the dependencies of cmake, and this PR fallbacks to downloading cmake in case it's not installed on the user's machine, this is not a breaking change, the version of node-llama-cpp can be bumped by only a minor version.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier 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 CONTRIBUTING.md (PRs that do not follow this convention will not be merged)

@giladgd giladgd requested a review from ido-pluto September 9, 2023 20:32
@giladgd giladgd self-assigned this Sep 9, 2023
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 01b89ce into master Sep 9, 2023
@giladgd giladgd deleted the gilad/moveToCmakeJs branch September 9, 2023 21:30
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

🎉 This PR is included in version 2.4.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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants