llama.cpp is the gold standard for running LLMs efficiently on local hardware. With its optimized C++ implementation and support for quantized models, you can run powerful language models on CPUs and GPUs with minimal memory.
llama.cpp: Maximum Performance Local Inference#
llama.cpp by Georgi Gerganov is a highly optimized C++ implementation for running LLMs. It supports quantized models that dramatically reduce memory requirements while maintaining quality.
When combined with Pixeltable's declarative infrastructure, you get the performance benefits of llama.cpp with automatic orchestration.
Why llama.cpp?#
- Optimized C++: Hand-tuned for maximum throughput
- Metal Acceleration: Native Apple Silicon support
- CUDA Support: NVIDIA GPU acceleration
- Quantization: Run 70B models in 32GB RAM
Getting Started#
Basic Chat Completions#
Quantization Guide#
| Quantization | Bits | Quality | Speed |
|---|---|---|---|
| Q4_K_M | 4-bit | Good | Fast |
| Q5_K_M | 5-bit | Very Good | Good |
| Q6_K | 6-bit | Excellent | Moderate |
| Q8_0 | 8-bit | Near-FP16 | Slower |
Recommendation: Start with Q5_K_M for the best balance.
Model Recommendations#
| Use Case | Model | Minimum RAM |
|---|---|---|
| Development | Qwen2.5-0.5B | 1GB |
| General Tasks | Llama-3.2-1B | 2GB |
| Quality Focus | Llama-3.2-3B | 4GB |
| Best Quality | Mistral-7B | 8GB |
llama.cpp vs Ollama#
| Feature | llama.cpp | Ollama |
|---|---|---|
| Performance | Maximum | Good (wrapper overhead) |
| Ease of Use | More setup | Very easy |
| Model Access | Any GGUF model | Ollama library only |

