#!/bin/bash
# Exit immediately on error, treat unset variables as errors, propagate pipe failures.
set -euo pipefail
# Load shared log/skip/warn/err helpers from the installer library.
source "$(dirname "${BASH_SOURCE[0]}")/../../lib/logging.sh"

# llama-cpp provides the standalone llama-cli, llama-server, and related inference
# tools that can be used without Ollama.  Ollama bundles its own internal copy of
# llama.cpp, so both packages can coexist; they share GPU resources at runtime but
# do not conflict at the package level.
log "Installing llama.cpp (AUR)..."
# llama-cpp is not in the official Arch repos; pull it from the AUR.
# --answerdiff None / --answerclean All suppress interactive PKGBUILD/clean prompts.
yay -S --answerdiff None --answerclean All --noconfirm llama-cpp
log "llama.cpp installed."
