Glossary

llama.cpp

llama.cpp is the engine that made running a language model on a laptop normal. Written in C and C++, it loads quantised GGUF models on almost any hardware and sits underneath Ollama, LM Studio and most other local AI tools.

General definition

llama.cpp is an open-source inference engine written in C and C++, started by Georgi Gerganov in March 2023 to run Meta’s first Llama model on a MacBook. It has since become the most widely deployed engine for running language models outside the data centre. It is built on the ggml tensor library, needs no Python or CUDA for the basic CPU build, and is released under the MIT licence.

  • Model format: GGUF, a single-file container holding weights, tokenizer and metadata, designed for fast memory-mapped loading
  • Quantisation: converts 16-bit weights to 2 to 8 bit integer formats (the Q4_K_M, Q5_K_M and Q8_0 family) so a 7B model fits in roughly 4 to 8 GB of RAM
  • Backends: optimised CPU kernels (AVX, NEON), Apple Metal, NVIDIA CUDA, AMD ROCm, Vulkan and SYCL, with partial offload of layers to the GPU when its memory is short
  • Tools: llama-cli for interactive use, llama-server for an HTTP API, llama-quantize to convert weights, and a Python script that converts Hugging Face checkpoints to GGUF

llama-server is the part most applications use. It exposes OpenAI-compatible endpoints (/v1/chat/completions, /v1/embeddings) with streaming, grammar-constrained and JSON-schema output, and parallel request slots with continuous batching, so a single binary can serve a small team. Bindings exist for Python (llama-cpp-python), Node.js, Rust, Go and other languages.

Most people meet llama.cpp indirectly. Ollama wraps it with model management and a friendlier API, LM Studio wraps it in a desktop interface, and projects such as GPT4All, Jan and KoboldCpp build on it too. Using llama.cpp directly makes sense when you need a specific build flag, support for a new model architecture before the wrappers catch up, an embedded or edge deployment, or the smallest possible footprint. For many concurrent users on data-centre GPUs, vLLM and similar servers deliver more throughput; llama.cpp optimises for running anywhere rather than for peak load.

In the Ethora ecosystem

Ethora does not bundle llama.cpp, but its AI service works with any OpenAI-compatible endpoint, and llama-server provides one. Four environment variables (AI_API_URL, AI_API_KEY, AI_CHAT_MODEL, AI_EMBEDDING_MODEL) point the self-hosted AI agent stack at it, with Postgres and pgvector holding the 256-dimension embeddings for RAG. In practice most teams reach llama.cpp through Ollama, which is the setup documented in the official ethora-ollama-example repository.

The reason this engine matters to Ethora users is cost of entry. A self-hosted Ethora server plus a llama.cpp-based model on a CPU box is the cheapest complete chat-and-AI stack with no data leaving the network: in the Ollama example, a 3B model on a 4 vCPU, 8 GB virtual machine answered short replies in 6 to 8 seconds. That is enough for an internal assistant or a pilot in a healthcare or finance setting; add a GPU, or move to vLLM, when a customer-facing load arrives.

Get started

Build AI agents on your own stack

Ethora’s AI SDK brings agents, RAG and self-hosted LLMs into your product. Talk to our team.

Start Free
Free tier available Enterprise SLA No vendor lock-in