A single bash script to run local LLMs with llama.cpp without building anything: it picks the right prebuilt release for your machine (Vulkan, CUDA, ROCm or CPU), downloads models from Hugging Face and starts a chat, a one-shot prompt or an OpenAI-compatible server.
$ ./llamactl.sh
System: ubuntu-x64, AMD Ryzen 7 PRO 3700U w/ Radeon Vega Mobile Gfx, 13 GB RAM
GPU: Advanced Micro Devices, Inc. [AMD/ATI] Picasso/Raven 2 [Radeon Vega Series / Radeon Vega Mobile Series]
Vulkan: driver found
Prefers: vulkan > cpu
Newest builds for this machine:
vulkan b11396 2026-10-04 30 MB [installed]
cpu b11396 2026-10-04 16 MB
Installed builds (up to date; switch: ./llamactl.sh use <build>):
b11396-vulkan <- current
Models (switch: ./llamactl.sh use <model>):
gemma-3-1b-it-Q4_K_M.gguf <- current
Ministral-3-3B-Instruct-2512-Q4_K_M.gguf
Next steps:
./llamactl.sh chat conversation in the terminal, remembers context (/exit to quit)
./llamactl.sh ask "who am i" single answer, no memory, then exit (good for scripts)
./llamactl.sh server browser chat at http://localhost:8080 + OpenAI-compatible API at /v1/chat/completions, runs until Ctrl+C
./llamactl.sh models your 2 local models + how to get more (Hugging Face)
./llamactl.sh --help all commands
Linux (x64 or arm64) or macOS with bash, curl, jq, tar and sha256sum. On Linux, lspci is used to detect the GPU.
sudo apt install curl jq pciutils # Debian/Ubuntugit clone https://github.com/leventarican/llamactl.git
cd llamactl
./llamactl.sh download # newest llama.cpp build for this machine
./llamactl.sh pull mistralai/Ministral-3-3B-Instruct-2512-GGUF # a model from Hugging Face (~2 GB)
./llamactl.sh chat # chat in the terminalsh llamactl.sh … works too.
| Command | What it does |
|---|---|
list [--all] [-n 10] |
newest builds for this machine, installed builds and models (default command) |
download [tag] [--variant V] |
install the newest (or given) build; V = vulkan, cpu, cuda-…, rocm-… |
installed |
installed builds |
use <build or model> |
switch the current build (use b11396-cpu) or model (use ministral) |
remove <tag-variant> |
delete an installed build |
prune |
keep only the newest build per variant (and the current one) |
models |
local models and where to get more |
pull <user>/<repo>[:QUANT] |
download a GGUF model into ./models (default quant Q4_K_M) |
chat [model] |
conversation in the terminal, remembers context (/exit to quit) |
ask [model] "question" |
single answer, no memory, then exit; prints only the answer, good for scripts |
server [model] [--port 8080] |
browser chat at http://localhost:8080 and an OpenAI-compatible API, runs until Ctrl+C |
<command> -- <args> |
pass extra options to llama.cpp, e.g. chat -- -c 8192 |
A model can be given as a file name, any unique part of it (chat ministral) or a Hugging Face repo
(chat ggml-org/gemma-3-4b-it-GGUF, downloaded on first use). Without a model, the current one is used.
Models are GGUF files. Find them on Hugging Face: trending GGUF models.
- Automatic:
./llamactl.sh pull <user>/<repo>picks theQ4_K_Mquantization (a good size/quality trade-off), or the one given after:, and checks free disk space first. - Manual: download a
.gguffrom a repo's Files tab into./models.
Rough guide: models up to ~4B parameters (2–3 GB) run fluently on a laptop CPU or integrated GPU; 7–9B (4–6 GB) need more RAM and patience.
./llamactl.sh server
curl http://localhost:8080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"messages": [{"role": "user", "content": "Hello!"}]}'In OpenAI clients and SDKs use the base URL http://localhost:8080/v1 and any API key.
- Builds come from the llama.cpp releases (
bNNNNtags only). For each variant the newest release that actually contains the asset is used, the sha256 digest is verified, and the build is extracted to./versions/<tag>-<variant>/../currentis a symlink to the active build. - Variant choice: NVIDIA driver → CUDA, AMD GPU with ROCm installed → ROCm, any GPU with a Vulkan driver → Vulkan, otherwise CPU.
- Models live in
./models; the current one is stored in./models/.current.
| Variable | Purpose |
|---|---|
GITHUB_TOKEN / GH_TOKEN |
avoids the GitHub API limit of 60 requests/hour (picked up from gh auth token too) |
HF_TOKEN |
needed for gated or private Hugging Face repos |
MIT. llama.cpp and the models have their own licenses.