Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

221.3. llama.cpp-0.5.0

Local language models on the CPU or a Vulkan GPU: llama-cli, llama-server and the GGUF tools, with nothing sent anywhere

0.5.0-1 · MIT · 4.7 SBU · 21.1 MiB, 42 files · 42_graphics, 49 of 189 · ports/core/ai/llama.cpp

Homepage: https://github.com/ggml-org/llama.cpp

Depends on: cmake, ninja, libggml.

Required by: no port names it.

Sources: llama.cpp-0.5.0.tar.gz (35.8 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install llama.cpp'

build.sh:

cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DLLAMA_BUILD_IS_DEV=OFF \
	-DLLAMA_USE_SYSTEM_GGML=ON \
	-DLLAMA_ALL_WARNINGS=OFF \
	-DLLAMA_BUILD_COMMON=ON \
	-DLLAMA_BUILD_TOOLS=ON \
	-DLLAMA_BUILD_SERVER=ON \
	-DLLAMA_BUILD_APP=ON \
	-DLLAMA_BUILD_TESTS=OFF \
	-DLLAMA_TESTS_INSTALL=OFF \
	-DLLAMA_BUILD_EXAMPLES=OFF \
	-DLLAMA_BUILD_UI=OFF \
	-DLLAMA_USE_PREBUILT_UI=OFF \
	-DLLAMA_OPENSSL=OFF \
	-DLLAMA_LLGUIDANCE=OFF \
	-DLLAMA_SUBPROCESS=ON \
	-DLLAMA_TOOLS_INSTALL=ON
cmake --build build
DESTDIR=$PKG cmake --install build
for bin in llama-cli llama-server llama-quantize; do
	[ -x "$PKG/usr/bin/$bin" ] || { echo "llama.cpp: $bin was not built" >&2; exit 1; }
done
[ ! -e "$PKG/usr/lib/libggml.so" ] ||
	{ echo "llama.cpp: installed its own libggml over the libggml port" >&2; exit 1; }

Programs: llama, llama-batched-bench, llama-bench, llama-cli, llama-completion, llama-fit-params, llama-gguf-split, llama-imatrix, llama-mtmd-cli, llama-perplexity, llama-quantize, llama-results, llama-server, llama-tokenize, llama-tts.

Libraries: libllama-batched-bench-impl.so, libllama-bench-impl.so, libllama-cli-impl.so, libllama-common.so, libllama-completion-impl.so, libllama-fit-params-impl.so, libllama-perplexity-impl.so, libllama-quantize-impl.so, libllama-server-impl.so, libllama.so, libmtmd.so.

Directories: /usr/lib/cmake/llama, /usr/share/licenses/llama.cpp.