llama.cpp
Zero-dependency C/C++ LLM inference engine for local hardware
WHAT IS IT?
llama.cpp is the foundational C/C++ inference engine built on the ggml tensor library. It runs quantized Large Language Models in the GGUF format directly on local CPUs, integrated APUs, and discrete GPUs without heavyweight Python framework bloat.
WHY USE IT? // PRACTICAL USE CASES
Pasting proprietary source code, internal architecture diagrams, or active incident response logs into third-party cloud LLM APIs creates severe data-leakage risk. llama.cpp enables full local inference with deterministic control over context windows, memory mapping (`mmap`), and network bindings.
- [1] Running air-gapped local LLMs for sensitive code review and incident log analysis
- [2] Hosting an OpenAI-compatible local HTTP server (`llama-server`) with grammar-constrained JSON output
- [3] Quantizing models into GGUF formats to fit consumer and workstation VRAM/UMA
- [4] Speculative decoding and flash-attention acceleration on AMD ROCm / Vulkan / NVIDIA GPUs
HOW DO I GET IT? // SAFE INSTALLATION GUIDANCE
Clone from `github.com/ggml-org/llama.cpp` and compile with CMake (`cmake -B build -DGGML_VULKAN=ON && cmake --build build --config Release -j`), or download official prebuilt release binaries. Bind `llama-server` strictly to `127.0.0.1` unless protected by reverse-proxy authentication.
HOW DOES IT WORK? // INTERNAL ARCHITECTURE OVERVIEW
llama.cpp loads weights from single-file GGUF archives using `mmap()` and executes transformer forward passes using hand-tuned SIMD/GPU kernels across quantized weight blocks (Q4_K_M, Q8_0, IQ4_XS), drastically reducing memory bandwidth bottlenecks.