llama.cpp Builder

Pick your platform, the GPU backends you want and a few build options, and this tool writes the exact cmake commands for you — then explains every flag in plain English and warns you before an option combination is going to fail. Nothing is sent to a server; the whole builder runs in your browser.

GPU backends — pick any combination (CPU is always included)
Options

Your build

Prerequisites

    Build command

    What each flag does

    FlagWhat it does in your build

    Interactions & warnings

      Paste the cmake -B build … line (or a whole command block) you found in a tutorial or on your machine. The validator explains every flag, flags deprecated ones with their modern replacement, and rewrites a cleaned-up command.

      Flag report

      FlagVerdictWhat it means

      Cleaned-up command

      How the llama.cpp Builder works

      The builder is a form that compiles down to two lines of shell: a cmake -B build … configure step and a cmake --build build compile step. Everything between your choices and those lines is deterministic mapping, so the command you copy is the exact command CMake will run — no wrapper scripts, no assumptions left implicit. As you tick options, the page re-renders three things at once: the prerequisites checklist for your platform and backends, the command itself, and a table that explains every flag in it, including the ones you did not set but that matter (like GGML_NATIVE, which is on by default).

      The second mode, Check my flags, works in reverse. Paste a configure line from a tutorial, a forum answer or your own machine, and the validator classifies every -D flag: explained if it is current, flagged with its replacement if it was renamed, or marked as unknown if nothing in llama.cpp reads it. This matters because a large share of llama.cpp build advice online was written for 2023–2024 releases and uses flags that no longer exist.

      Which version of llama.cpp does this target?

      The flag reference in this tool is verified against v1.1.0, the current stable release (November 2026), cross-checked with the latest pre-release b12811 and the master branch. The version selector changes the generated git checkout line so your build is pinned to whichever of those you want: v1.1.0 for reproducible builds, b12811 if you need the newest bug fixes, or master if you are chasing a specific commit.

      Two version notes save a lot of confusion. First, llama.cpp publishes both stable tags (v1.1.0) and continuous pre-releases (b12811, b12812, …); the b-number is not a minor version — it is a build counter, and it moves daily. Second, most backend flags were renamed from LLAMA_* to GGML_* as the GPU code moved into the ggml sub-project. The old names still configure but print warnings, and -DLLAMA_CUBLAS now aborts the build outright with a fatal error pointing you at -DGGML_CUDA=ON. If a tutorial tells you to pass -DLLAMA_CUDA, it predates that rename.

      Worked example: RTX 4090 on Ubuntu (CUDA)

      Say you have an RTX 4090 (compute capability 8.9) and want the fastest local inference on Ubuntu. In the builder you pick Linux, CUDA, Release, and arch 89; it produces:

      git clone https://github.com/ggml-org/llama.cpp.git
      cd llama.cpp
      git checkout v1.1.0
      cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="89" -DCMAKE_BUILD_TYPE=Release
      cmake --build build -j 8

      What each piece does: -DGGML_CUDA=ON compiles the NVIDIA backend (cuBLAS/mmq kernels plus FlashAttention) and requires the CUDA Toolkit at build time. -DCMAKE_CUDA_ARCHITECTURES="89" tells nvcc to emit code only for Ada GPUs — without it, nvcc targets whatever GPU it can detect on the machine doing the compiling (-arch=native), which silently breaks when you build on a laptop and run on the 4090. -DCMAKE_BUILD_TYPE=Release enables full optimisation (a Debug build runs several times slower). -j 8 compiles with eight parallel jobs. Afterwards, offload all layers to the GPU with ./build/bin/llama-server -m model.gguf -ngl 99.

      How the options interact

      Multiple GPU backends are allowed. Unlike many projects, llama.cpp lets you combine backends — for example -DGGML_CUDA=ON -DGGML_VULKAN=ON produces one set of binaries that can run on either, and you choose at runtime with --device (list what was built with --list-devices). The builder therefore uses checkboxes, not a radio group. The one hard platform rule: Metal only builds on macOS.

      GGML_NATIVE vs portability. By default the CPU backend is tuned for the machine that compiles it (AVX2, AVX-512, …). Great for your own box; a binary built with AVX-512 on a Ryzen will crash on an older Intel CPU. Tick Portable CPU build to set GGML_NATIVE=OFF. For CUDA builds, portability has a second dimension: pin the architecture list (or pass the multi-target value) or the GPU code is only good for one card.

      Static vs shared vs dynamic backends. BUILD_SHARED_LIBS=OFF links everything into the executables — simplest to ship, larger binaries. GGML_BACKEND_DL=ON goes the other way: GPU backends become plugins loaded at runtime, so a single binary works across machines with different GPUs; it requires shared libraries, and the builder warns if you tick both.

      Common llama.cpp build mistakes

      • Using flags from old tutorials. -DLLAMA_CUDA, -DLLAMA_METAL, -DLLAMA_NATIVE and friends are renamed to the GGML_* family; -DLLAMA_CUBLAS is a fatal error now. The Check-my-flags mode catches all of these.
      • Passing -DGGML_K_QUANTS. That option no longer exists — K-quants (Q4_K_M, Q5_K_S and the rest) have been compiled in unconditionally since it was removed. Quantised models work out of the box; drop the flag.
      • Building on Windows without the Developer Command Prompt. Plain PowerShell has no compiler. Open “Developer Command Prompt for VS 2022” first, and note that MSVC uses a multi-config generator — the build type goes on cmake --build … --config Release, not in -DCMAKE_BUILD_TYPE. The builder handles this split automatically.
      • Forgetting the CUDA Toolkit. -DGGML_CUDA=ON only tells CMake to look for it; nvcc must already be installed and on PATH, or configure fails with a cryptic message.
      • Assuming one GPU backend per build. You can combine backends and pick at runtime with --device; single-backend builds are a habit from older versions.
      • Expecting Metal on Linux, or OpenCL on recent macOS. Metal is Apple-only. On new macOS releases the OpenCL runtime is deprecated — use Metal there.

      Privacy: this tool runs entirely in your browser. Your platform, backends and pasted commands never leave your machine — there is no server-side processing, no analytics on inputs, and nothing to delete afterwards.

      Related tools

      • GGUF Inspector — once your build works, inspect the model file you will feed it: parameter count, quantisation mix and tensor layout, parsed in-browser.
      • LLM VRAM Calculator — size up whether your GPU can hold the model at a given quant before you spend an hour compiling.
      • Browser Terminal — run the generated build command in a disposable in-browser Linux terminal if you just want to see the configure step work.

      Luke Keam
      Spot a bug or want a custom utility built? I'd love to hear from you. Get in touch
      Luke Keam | techgeek.biz