| name | llama-cpp |
| description | Runs LLM inference on CPU, Apple Silicon, and consumer GPUs without NVIDIA hardware. Use for edge deployment, M1/M2/M3 Macs, AMD/Intel GPUs, or when CUDA is unavailable. Supports GGUF quantization (1.5-8 bit) for reduced memory and 4-10× speedup vs PyTorch on CPU. |
| category | ml-inference |
| version | 1.0.0 |
| author | Synthetic Sciences |
| license | MIT |
| tags | ["Inference Serving","Llama.cpp","CPU Inference","Apple Silicon","Edge Deployment","GGUF","Quantization","Non-NVIDIA","AMD GPUs","Intel GPUs","Embedded"] |
| dependencies | ["llama-cpp-python"] |
llama.cpp
Pure C/C++ LLM inference with minimal dependencies, optimized for CPUs and non-NVIDIA hardware.
When to use llama.cpp
Use llama.cpp when:
- Running on CPU-only machines
- Deploying on Apple Silicon (M1/M2/M3/M4)
- Using AMD or Intel GPUs (no CUDA)
- Edge deployment (Raspberry Pi, embedded systems)
- Need simple deployment without Docker/Python
Use TensorRT-LLM instead when:
- Have NVIDIA GPUs (A100/H100)
- Need maximum throughput (100K+ tok/s)
- Running in datacenter with CUDA
Use vLLM instead when:
- Have NVIDIA GPUs
- Need Python-first API
- Want PagedAttention
Quick start
Installation
brew install llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make
make LLAMA_METAL=1
make LLAMA_CUDA=1
make LLAMA_HIP=1
Download model
huggingface-cli download \
TheBloke/Llama-2-7B-Chat-GGUF \
llama-2-7b-chat.Q4_K_M.gguf \
--local-dir models/
python convert_hf_to_gguf.py models/llama-2-7b-chat/
Run inference
./llama-cli \
-m models/llama-2-7b-chat.Q4_K_M.gguf \
-p "Explain quantum computing" \
-n 256
./llama-cli \
-m models/llama-2-7b-chat.Q4_K_M.gguf \
--interactive
Server mode
./llama-server \
-m models/llama-2-7b-chat.Q4_K_M.gguf \
--host 0.0.0.0 \
--port 8080 \
-ngl 32
curl http://localhost:8080/v1/chat/completions \
-H \
-d