GitHub - Deins/llama.cpp.zig: llama.cpp bindings and utilities for zig (original) (raw)

llama.cpp bindings and utilities for zig. Currently targeting zig 0.14.x.

Example usage

Clone: git clone --recursive https://github.com/Deins/llama.cpp.zig.git

  1. Download llama.cpp supported model (usually *.gguf format). For example this one.
  2. build and run with:

zig build run-simple -Doptimize=ReleaseFast -- --model_path path_to/model.gguf --prompt "Hello! I am LLM, and here are the 5 things I like to think about:"

See examples/simple.zig

CPP samples

Subset of llama cpp samples have been included in build scripts. Use -Dcpp_samples option to install them.
Or run them directly, for example: zig build run-cpp-main -Doptimize=ReleaseFast -- -m path/to/model.gguf -p "hello my name is"

Tested platforms

Backend support

Backend Support Comment
cpu ☑️
cuda
metal
sycl
vulkan
opencl
cann
blas
rpc
kompute
CLBlast deprecated, was supported in older: 8798dea