Audio version — Estimated duration: 4 min 4 sec
CPU Installation
This guide covers the standard installation of llama.cpp utilizing your processor (CPU) for all computations. This is the most compatible method and works on virtually any modern 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.cpp2. 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 build3. 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 ReleaseNote: 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 --helpIf 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.exewithout navigating to this specific folder every time, you can add thebuild/bin/Releasefolder to your 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
📦 Alternative: Pre-Built Binaries (No Compilation Required)
Don’t want to compile? You can download pre-built llama.cpp binaries directly from GitHub. This is the fastest way to get started.
Option 1: GitHub Releases
- Go to the llama.cpp Releases page.
- Download the latest
llama-bin-*orllama-bins-*zip for your platform. - Extract the zip to a folder (e.g.,
C:\AI\llama.cpp). - Open a terminal in that folder and run:
./llama-cli.exe -m "C:\AI\models\your-model.gguf" -p "Hello!"
Option 2: Scoop (Package Manager)
If you use Scoop, you can install llama.cpp with one command:
scoop bucket add main
scoop install llama.cppThen run llama-cli from anywhere.
Option 3: Chocolatey
choco install llama.cppNote: Pre-built binaries from package managers may lag behind the latest GitHub release by a few weeks. For the newest features, build from source or use GitHub Releases.
Last Updated: 2026-07-19