whxaxes / go-llama.cpp

LLama.cpp golang bindings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Reference go-llama.cpp

LLama.cpp golang bindings.

The go-llama.cpp bindings are high level, as such most of the work is kept into the C/C++ code to avoid any extra computational cost, be more performant and lastly ease out maintenance, while keeping the usage as simple as possible.

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 LLama.cpp.

Clone the repository locally:

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

To build the bindings locally, run:

cd go-llama.cpp
make libbinding.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

About

LLama.cpp golang bindings

License:MIT License


Languages

Language:C++ 46.6%Language:Go 38.2%Language:Makefile 15.2%