CPU Installation

This guide covers the standard installation of llama.cpp on Windows, utilizing your processor (CPU) for all computations. This is the most compatible method and works on virtually any modern Windows machine.

🧠 Key Concepts for Beginners

What is a “Build”?

When programmers write code, it’s just a collection of text files. To actually use it, those text files need to be transformed into a program that your computer can run (like an .exe file). This entire process—gathering the code, translating it with a compiler, and packaging it—is called “Building” or “Compiling”.


🚀 Step-by-Step Installation

Follow these steps in a terminal (PowerShell is recommended).

1. Clone the Repository

First, download the llama.cpp source code from GitHub.

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp

2. Create a Build Directory

It is best practice to perform “out-of-source” builds. This keeps your source code clean by putting all compiled files in a separate folder.

mkdir build
cd build

3. Configure the Build with CMake

Now, use CMake to prepare the build files. This step checks your system and determines how the code should be compiled.

cmake ..

4. Compile the Project

Finally, run the build command. This will use the Visual Studio compiler to transform the source code into executable files.

cmake --build . --config Release

Note: The compilation process may take several minutes depending on your computer’s speed.

✅ Verification

Once the build is complete, you should find several .exe files in the bin/Release folder (inside your build directory).

To verify the installation, try running the help command for the main CLI tool:

./bin/Release/llama-cli.exe --help

If you see a list of available options and arguments, congratulations! You have successfully installed llama.cpp for CPU usage.

💡 Pro-Tips

  • Running from anywhere: To run llama-cli.exe without navigating to this specific folder every time, you can add the build/bin/Release folder to your Windows PATH (see the Prerequisites guide for details).
  • Build Speed: If you have a powerful machine, you can speed up the compilation by telling CMake to use all your CPU cores:
    cmake --build . --config Release -- -j

Last Updated: 2026-05-03