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

typescript bindings maintenance #2363

Merged
merged 23 commits into from
Jun 3, 2024
Merged

typescript bindings maintenance #2363

merged 23 commits into from
Jun 3, 2024

Conversation

iimez
Copy link
Collaborator

@iimez iimez commented May 18, 2024

Describe your changes

  • Changed the build scripts and docs a bit so its easier to build the bindings from source.
  • Deleted some outdated comments from the gyp config, and removed the deprecated nCtx on completions.
  • Update the build_unix script to produce so files with the correct build type.
  • Changed CI to call cmake with Release build type.
  • Added support for streamed token decoding, following the python bindings implementation
  • Updated the bindings to expose additional LLModel:load and LLModel:initGpu methods so its easier to copy the loading and backend-picking logic of the CUDA Backend PR. I also renamed a few things for consistency.
  • Include nThreads in the LoadModelOptions, previously it had to be configured via setThreadCount.
  • Added nGpuLayers as alias for ngl to the LoadModelOptions.
  • Updated types and examples accordingly.
  • I added a test suite that does actual inference and loads a real model on both cpu and gpu with minimal resource usage. And moved the existing tests into a separate test:ci script. Can switch CI config back to yarn test if inference in CI is possible.
  • Updated deps and verified that the fallback node-addon build via node-gyp-build is still working. Changed the build setup a bit to include a assert-backend-sources.js script that facilitates easier testing of the fallback during development. This also allows us to get rid of the second bindings.gyp config.
  • Added support for linux-arm64 runtimes+bindings builds. Tested with ubuntu 22 x86_64 (build-time) and debian bullseye arm64 docker image (runtime). Currently defaults to cpu (and no gpu support).

Breaking changes

  • The CompletionOptions onReponseToken(tokenId, text) callback has been changed to onResponseTokens({ tokenIds, text }) (Note the plural.). This is related to the streamed emoji decoding / multi token character issue.

Issue ticket number and link

#2326

@jacoobes jacoobes self-requested a review May 20, 2024 22:26
@iimez iimez changed the title simpler typescript bindings build typescript bindings maintenance May 21, 2024
@iimez iimez marked this pull request as ready for review May 22, 2024 01:29
jacoobes and others added 2 commits May 23, 2024 16:43
Signed-off-by: jacob <[email protected]>

update typings

Signed-off-by: jacob <[email protected]>
Signed-off-by: jacob <[email protected]>
@iimez iimez marked this pull request as ready for review May 26, 2024 05:37
@jacoobes jacoobes self-requested a review May 29, 2024 15:54
@jacoobes jacoobes merged commit a602f7f into nomic-ai:main Jun 3, 2024
2 checks passed
@cebtenzzre
Copy link
Member

@jacoobes Please use shorter merge commit messages in the future - even a blank merge description is better than adding two pages of text to the top of the git log. Refined GitHub even clears the description by default. Thanks.

@jacoobes
Copy link
Collaborator

jacoobes commented Jun 3, 2024 via email

cebtenzzre added a commit that referenced this pull request Jun 3, 2024
As discussed on Discord, this PR was not ready to be merged. CI fails on
it.

This reverts commit a602f7f.

Signed-off-by: Jared Van Bortel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants