llama.cpp is an open-source C++ library for running large language models on consumer hardware — including CPU-only machines. Created by Georgi Gerganov in 2023, it enabled the first practical local LLM inference without a GPU and remains the most hardware-flexible inference engine available.
Most LLM inference tools require NVIDIA GPUs and CUDA. llama.cpp uses highly optimized CPU inference with optional GPU acceleration — making it the only option for:
llama.cpp introduced GGUF (GPT-Generated Unified Format) — a quantization format that dramatically reduces model size without proportional quality loss. A 70B model that normally requires 140GB at FP16 can run in 40GB at Q4 quantization, or 24GB at Q3.
| Quantization | Size (70B model) | Quality vs FP16 | Speed |
|---|---|---|---|
| FP16 (full) | ~140GB | 100% | Slowest |
| Q8_0 | ~70GB | ~99% | Fast |
| Q5_K_M | ~50GB | ~97% | Faster |
| Q4_K_M | ~40GB | ~95% | Faster |
| Q3_K_M | ~30GB | ~90% | Fastest |
git clone https://github.com/ggerganov/llama.cpp cd llama.cpp make -j4 # Download a GGUF model from Hugging Face # Then run inference ./llama-cli -m models/llama-3.2-8b-q4_k_m.gguf -p "Hello, world" -n 128 # Run as an OpenAI-compatible server ./llama-server -m models/llama-3.2-8b-q4_k_m.gguf --port 8080
The server mode exposes an OpenAI-compatible API, so you can point Tokoscope or any other tool at it directly.
| llama.cpp | Ollama | vLLM | |
|---|---|---|---|
| Setup difficulty | Hard (compile from source) | Easy (one command) | Medium |
| GPU required | No (CPU works) | No (CPU works) | Yes (NVIDIA) |
| Throughput | Low-medium | Medium | Highest |
| Hardware support | Widest (CPU, CUDA, Metal, Vulkan) | Good | NVIDIA only |
| Best for | CPU inference, maximum compatibility | Local dev, ease of use | Production serving |
For most local development use cases, Ollama (which uses llama.cpp under the hood) is easier. For production serving on NVIDIA hardware, vLLM is faster. llama.cpp shines when neither of those apply.
Tokoscope works with any OpenAI-compatible endpoint including llama.cpp server mode. Free to start.
Get started free →