gpt4all/gpt4all-bindings/typescript
Jacob Nguyen 394d9b4076 nodejs bindings (#602)
* chore: boilerplate, refactor in future

* chore: boilerplate

* feat: can compile succesfully

* document .gyp file

* add src, test and fix gyp

* progress on prompting and some helper methods

* add destructor and basic prompting work, prepare download function

* download function done

* download function edits and adding documentation

* fix bindings memory issue and add tests and specs

* add more documentation and readme

* add npmignore

* Update README.md

Signed-off-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>

* Update package.json - redundant scripts

Signed-off-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>

---------

Signed-off-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
2023-05-22 12:55:22 -07:00
..
spec nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
src nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
test nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
.gitignore nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
.npmignore nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
binding.gyp nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
index.cc nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
package.json nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
README.md nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
stdcapture.cc nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
stdcapture.h nodejs bindings (#602) 2023-05-22 12:55:22 -07:00
yarn.lock nodejs bindings (#602) 2023-05-22 12:55:22 -07:00

Javascript Bindings

The original GPT4All typescript bindings are now out of date.

  • created by jacoobes and nomic ai :D, for all to use.
  • will maintain this repository when possible, new feature requests will be handled through nomic

Build Instructions

  • As of 05/21/2023, Tested on windows (MSVC) only. (somehow got it to work on MSVC 🤯)
    • binding.gyp is compile config

Requirements

Build

git clone https://github.com/nomic-ai/gpt4all.git
cd gpt4all-bindings/typescript
  • The below shell commands assume the current working directory is typescript.

  • To Build and Rebuild:

yarn
  • llama.cpp git submodule for gpt4all can be possibly absent. If this is the case, make sure to run in llama.cpp parent directory
git submodule update --init --depth 1 --recursive`

Test

yarn test

Source Overview

src/

  • Extra functions to help aid devex
  • Typings for the native node addon
  • the javascript interface

test/

  • simple unit testings for some functions exported.
  • more advanced ai testing is not handled

spec/

  • Average look and feel of the api
  • Should work assuming a model is installed locally in working directory

index.cc

  • The bridge between nodejs and c. Where the bindings are.