Build & Update

Check whether your local llama.cpp checkout is behind upstream, and rebuild it with CMake flags auto-detected for your machine's GPU and CPU — without hand-typing cmake commands.

What it does

The Build tab reports two independent things: how your local llama_src checkout compares to upstream github.com/ggml-org/llama.cpp, and what CMake flags this machine should build with.

Current vs. upstream. backend/builder.py's BuildManager.current_commit() reads the local checkout's HEAD (git log -1) and branch. check_updates() runs git fetch --quiet origin against origin/master, then git rev-list --count HEAD..origin/master to report how many commits you're behind, plus the latest upstream commit's hash and subject. This check is cached for 15 minutes (UPDATE_TTL = 900 seconds) so opening the Build tab doesn't git fetch GitHub on every visit; a failed fetch is retried sooner (UPDATE_TTL_FAIL = 60 seconds). The Check GitHub now button bypasses the cache with force=1, and a finished build clears the cache outright so the next check is fresh.

Auto-detected build flags. backend/hardware.py's recommend() inspects your GPU(s) (via nvidia-smi, or Apple's unified memory on macOS) and CPU, then returns a dict of {cmake_flags, notes, runtime, gpus, cpu}:

These flags are shown as pills on the Build tab and used as the default for a rebuild; if you've previously saved custom flags (cmake_flags in config.json), those are shown instead until you clear them.

A rebuild (BuildManager.run_build()) runs in a background thread: optionally git pull --ff-only origin first, backs up the current binaries directory (bin/Release on Windows/MSVC, bin elsewhere) to a timestamped copy before touching anything, runs cmake -B <build_dir> -S <llama_src> -DCMAKE_BUILD_TYPE=Release with your flags, then cmake --build <build_dir> --config Release --parallel <jobs>. Output streams to a log file the dashboard polls live.

How to use it

  1. Open the Build tab. Current Build shows your checkout's commit, branch, and date; Upstream shows whether you're behind origin/master and by how many commits.
  2. Click Check GitHub now to force a fresh upstream check instead of waiting for the 15-minute cache.
  3. Review the Build Flags pills — these are auto-detected for your GPU/CPU (or your previously saved custom flags, if any).
  4. Leave git pull first checked (it's checked by default when you're behind) to pull the latest commits before building, or uncheck it to rebuild the current checkout as-is.
  5. Click Pull latest & Rebuild (or Rebuild current if already up to date). The build runs in the background; watch progress and any errors in the Build Log panel below, which polls live until the build finishes or fails.
  6. If vLLM is installed, the same tab shows its installed vs. latest PyPI version, with an Update vLLM button when a newer release is available.

Screenshot

Build tab

Reference

ConceptSourceBehavior
Current commitBuildManager.current_commit()git log -1 (hash, subject, date) + current branch on llama_src.
Upstream checkBuildManager.check_updates()git fetch + git rev-list --count HEAD..origin/master; cached 15 min (60s on failure), bypassed with force=1.
Recommended flagshardware.recommend()Returns cmake_flags, human-readable notes, a runtime suggestion, and the detected gpus/cpu.
macOS flagshardware.recommend()GGML_METAL=ON, GGML_NATIVE=ON.
NVIDIA GPU flagshardware.recommend()GGML_CUDA=ON, CMAKE_CUDA_ARCHITECTURES=<archs> (if readable), GGML_CUDA_FA_ALL_QUANTS=ON.
CPU-only flagshardware.recommend()No CUDA flags; GGML_NATIVE=ON still set.
AVX-512 flagshardware.recommend()GGML_AVX512, GGML_AVX512_VNNI, GGML_AVX512_VBMI, GGML_AVX512_BF16 — all ON when avx512_hint is true.
Runtime suggestionhardware.recommend()["runtime"]n-gpu-layers=99, flash-attn=on with a GPU/Metal; n-gpu-layers=0, flash-attn=off CPU-only.
RebuildBuildManager.run_build()Optional git pull --ff-only, backs up prior binaries, cmake configure + build (Release, parallel jobs = CPU count by default).

Troubleshooting

If the upstream status shows "check failed," git fetch couldn't reach GitHub (network issue, or llama_src isn't a valid checkout) — check llama_src in config.json points at a real git clone. If a build fails, the Build Log panel shows the failing cmake step's output; prior binaries are always backed up first (to a bin-backup-<timestamp> folder next to the build output) so a bad build doesn't leave you without a working server. If flag detection looks wrong (e.g. no GPU found on a machine that has one), verify nvidia-smi is on PATH and reports the GPU — hardware.detect_gpus() shells out to it directly.

See also Models & Tuning for the flags the resulting llama-server binary exposes, and config.json Reference for llama_src, build_dir, server_bin, and cmake_flags.