New Tool Radar

Local AI

How to Update llama.cpp with git pull and Rebuild

Update llama.cpp from source, rebuild it, and check the new binaries before using them.

Schematic illustration with three step boxes for How to Update llama.cpp with git pull and Rebuild.

llama.cpp changes almost daily, and in November 2026 it reached v1.0.0, the first release under semantic versioning. If you build from source, updating means pulling the latest code and rebuilding with the same options you used before. This guide does that, and shows how to roll back if the new build breaks.

Before you start

  • llama.cpp checked out from git and already built once.
  • Git, CMake and a compiler installed.
  • A few minutes: a rebuild after a pull is usually incremental and quick.

Note your current commit

Before pulling, record what you are on: this is your rollback point.

cd ~/llama.cpp
git rev-parse HEAD

Write the hash down. Stop any running llama-server first.

Pull and rebuild with the same options

Pull the latest code and rebuild:

git pull
cmake --build build --config Release -j "$(nproc)"

If you use a CUDA build, re-run the configure step with the same options first, for example cmake -B build -DGGML_CUDA=ON, then build. A clean rebuild, removing the build folder first, is only needed when you change a build flag or a pull throws stale-cache errors.

Test the new binaries

Check the new version and start the server with a model you used before:

./build/bin/llama-server --version
./build/bin/llama-server -m models/qwen3-8b-q4_k_m.gguf --port 8080

Ask it one question through the built-in web chat. If it fails, roll back with git checkout to the noted commit and rebuild.

Worked example

Sample check: before updating, note the commit hash and one model you use, such as a Qwen3 8B GGUF. After rebuilding, llama-server --version should report the new build, and the same model should serve a short question at http://127.0.0.1:8080.

Expected result

UNTESTED in this guide: no update was run while writing it. The expected result is that the rebuilt llama-server reports a new version, serves the same model, and answers a short question.

Limitations

Flags are renamed or removed between builds: v1.0.0 removed 35 deprecated functions and some options, so check that each CMake option and server flag in your usual command still exists before building. Do not upgrade a working production setup on release day. If you run prebuilt binaries or Docker instead, pull a versioned tag, not latest, so rollback is a re-pin.

Sources

See all