/go-gpt4all-j.cpp

golang binding for gpt4all-j

Primary LanguageC++MIT LicenseMIT

Go Reference go-gpt4all-j.cpp

This is a go binding/implementation compatible with GPT4ALL-J.

This port is high level, avoiding token-by-token inferencing in order to be faster. Check out this and this write-ups which summarize the impact of a low-level interface which calls C functions from Go.

If you are looking for an high-level OpenAI compatible API, check out here.

Usage

Note: This repository uses git submodules to keep track of GPT4ALL-J.

Clone the repository locally:

git clone --recurse-submodules https://github.com/go-skynet/go-gpt4all-j.cpp

To build the bindings locally, run:

cd go-gpt4all-j.cpp
make libgptj.a

Now you can run the example with:

LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t 14

Enjoy!

The documentation is available here and the full example code is here.

License

MIT