llama.cpp vs Ollama: Which Local LLM Engine?
Home › Guides · Last checked 2026-11-30 · Facts verified from each project's docs unless marked tested
Both are free, MIT-licensed and run open models on your own computer, and the difference starts with the fact that Ollama is built on llama.cpp. llama.cpp is the engine itself: a C/C++ library plus llama cli and llama serve, which reads GGUF files you pick from Hugging Face and exposes every setting. Ollama wraps that engine in a curated model library, short commands like ollama run gemma4, a desktop app on macOS and Windows and an optional paid cloud. Pick Ollama if you want the shortest path from install to a running model and broad app integrations. Pick llama.cpp if you want direct control over quantization, GPU backends and server flags, or the newest engine features first. The catch with Ollama is an extra layer: its own model store, a Modelfile to import your own GGUF and cloud features you may want to switch off. The catch with llama.cpp is more decisions: you choose the model file, the quantization and the context size yourself unless you use the new Llama app, which sets them for you.
| llama.cpp | Ollama | |
|---|---|---|
| Cost | Free. No paid plan in the project's docs | Free to run models locally. Optional cloud: pay-as-you-go, Pro $20/mo, Max $100/mo, team plans |
| License | MIT (llama.cpp, and the Llama Mac and Windows apps) | MIT |
| What it is | The inference engine: libllama C/C++ library plus llama cli, llama serve (llama-server) and conversion/quantize tools | A model runner built on llama.cpp: CLI, background server, model library and desktop app |
| Install | One-line script from llama.app (curl or PowerShell), Winget, Homebrew, MacPorts, Nix, conda-forge, Docker images, prebuilt release binaries or build from source | Install script (macOS/Linux) or PowerShell (Windows), .dmg / OllamaSetup.exe, manual Linux package, official ollama/ollama Docker image |
| macOS | Yes, with Metal. Llama menu bar app (brew install --cask llama-app) | macOS 14+. Apple Silicon uses CPU and GPU; Intel Macs CPU only |
| Windows | Yes (Winget, binaries). Llama tray app for Windows 11, x64 and ARM64 | Windows 10 22H2+. NVIDIA and AMD Radeon GPU support; no admin rights needed |
| Linux | Yes (Homebrew, Nix, conda-forge, Docker, binaries, source) | Yes (script, manual package, Docker). Desktop chat app not offered on Linux |
| GPU backends | CPU, Metal, CUDA, HIP (AMD), Vulkan, SYCL (Intel), MUSA, CANN, OpenCL, WebGPU, OpenVINO and more. Several can be built into one binary | NVIDIA (compute capability 5.0+), AMD via ROCm v7, Apple Metal, Vulkan on Windows and Linux |
| GUI or CLI | CLI and server first. Built-in browser chat (Llama Chat, on by default in llama serve) and the Llama desktop app on Mac and Windows 11 | CLI and API first. Desktop chat app on macOS and Windows since July 30 2025 |
| Models | GGUF only. -hf user/model[:quant] downloads from Hugging Face; convert_*.py scripts and llama-quantize make your own | Ollama library (ollama run gemma4). Import GGUF or Safetensors with a Modelfile and ollama create; Ollama does not quantize GGUF on import |
| Local API | localhost:9931 by default (binds 127.0.0.1). OpenAI-compatible chat completions, responses and embeddings, Anthropic Messages API, router mode for several models | Native API on localhost:11434 (binds 127.0.0.1). OpenAI-compatible /v1 and Anthropic-compatible, each "a subset" per the docs |
| Cloud | None from the project | Optional cloud models (:cloud names) with an account; can be disabled (OLLAMA_NO_CLOUD=1) |
| Best for | Tinkerers, developers embedding a model, unusual GPUs and anyone who wants each setting exposed | Beginners, coding-agent users (ollama launch claude) and apps that expect Ollama's API |
Both run the model on your own hardware, so your GPU memory or your Mac's unified memory decides which models and quantizations fit. Check yours at Will It Run? before downloading a GGUF.
Which should you pick?
Pick Ollama if you want it to just work. One install gives you a background server, a model library with short names and a chat app on Mac and Windows, coding agents like Claude Code, Codex and OpenCode start from it with ollama launch, and Open WebUI tries to connect to a local Ollama on its own. That costs you some control. Ollama decides how models are packaged, bringing your own GGUF means writing a Modelfile, and new llama.cpp features reach you only when Ollama ships them. Cloud models sit one sign-in away; switch cloud features off if you want strictly local use.
Pick llama.cpp if you want the engine with nothing in between. You load any GGUF from Hugging Face by name, choose the exact quantization, and set context, GPU layers and backends on the command line. Its server speaks OpenAI and Anthropic formats and can route between several models. It also builds for more GPU backends than Ollama documents (Intel SYCL, Moore Threads MUSA, Ascend CANN, OpenCL, WebGPU). That costs you convenience. You manage model files and flags yourself, and Linux has no desktop app, only the browser chat.
Think of llama.cpp as the engine on a test stand and Ollama as the same engine bolted into a car with the dashboard wired. If you'd rather not choose between them, the new Llama app sits in the middle: it's llama.cpp underneath, but it picks quantization and context for your Mac or PC like Ollama does.
You don't have to pick one forever. Both serve an OpenAI-compatible endpoint, so a tool that accepts a custom base URL works with either. Only the port changes (9931 vs 11434). Want a desktop chat app on top of the engine instead? Ollama vs LM Studio and LM Studio vs Jan compare the main ones.
Related: Ollama vs LM Studio · Ollama vs Jan · LM Studio vs Jan · Open WebUI vs LibreChat · Free ChatGPT Plus alternatives · All free AI chat tools
Check if a model runs on your machine. Enter your GPU or Mac at Will It Run?, or browse best LLMs by VRAM and Mac memory and Mac picks.
FAQ
Is Ollama built on llama.cpp?
Yes. Ollama's GitHub README lists llama.cpp as its supported backend and credits the project Georgi Gerganov founded. Ollama adds its own model library, a Modelfile format, a native API, an optional cloud and a desktop app on macOS and Windows. Its docs also mention an MLX backend, so llama.cpp is not the only engine inside current releases.
Is llama.cpp faster than Ollama?
Neither project publishes a head-to-head benchmark, so this page makes no speed claim. Ollama runs models on llama.cpp, and on the same machine the main factors are your GPU or Mac memory, the model size, the quantization and each tool's engine version and settings. For a fair test, run the same GGUF file in both and compare tokens per second on your own hardware.
Does llama.cpp have a GUI?
Yes, two kinds. llama serve (llama-server) ships Llama Chat, a built-in chat app in your browser, turned on by default. The llama.cpp team and Hugging Face also offer Llama, a free MIT-licensed menu bar app for Mac and system tray app for Windows 11 that installs llama.cpp, recommends models and serves an API on localhost:9931. On Linux, llama.cpp is command line plus the browser chat.
Do llama.cpp and Ollama work on Mac, Windows and Linux?
Both do. Ollama needs macOS 14 or newer (Apple Silicon uses CPU and GPU; Intel Macs run on CPU only) and Windows 10 22H2 or newer, and installs on Linux with a script, a manual package or Docker. Its desktop chat app is macOS and Windows only. llama.cpp installs through Winget, Homebrew, MacPorts, Nix, conda-forge, Docker or prebuilt release binaries, or you can build it from source.
Are llama.cpp and Ollama free for commercial use?
Both are MIT licensed, which allows commercial use and modification. Running models locally costs nothing in either. Ollama also sells optional cloud plans (pay-as-you-go, Pro at $20 a month and Max at $100 a month, plus team plans), and you can switch its cloud features off. Each model has its own license, so check the model card before commercial use.