OpenSourcePicks

Open source alternatives to popular software, with live GitHub data

GitHub stats refreshed every day

Ollama vs llama.cpp

Ollama is the easier path: install it, pull a model by name and point your apps at its local API. llama.cpp is the engine Ollama names as its backend, and running it directly gives you every tuning flag, more hardware backends and a built-in web chat, at the cost of more setup.

GitHub figures as of 6 December 2026. Updated .

  • Run open models on your own computer and serve them to chat apps and tools through a local API

    Choose Ollama if you want one command to download and run models, a desktop chat app on macOS or Windows, and a local server that many chat apps and coding tools already support.

  • C/C++ engine for running GGUF models on almost any CPU or GPU, with a built-in web chat and API server

    Choose llama.cpp if you want full control over quantization, context and GPU offload, run hardware such as Intel Arc, Ascend or Snapdragon, or want a single binary with a web chat, API keys and router mode.

Side by side

FactOllamallama.cpp
GitHub stars189,284137,696
Stars gained in 30 days+3,240+4,195
Last commityesterdaytoday
Repository age3 years3 years
LicenseMITMIT
PlatformsLinux, Windows, macOSLinux, Windows, macOS
Self-hosting needsNothing beyond the appNothing beyond the app
Hosted version by the developersYesNo
Built withGo, C++, TypeScript, ReactC, C++, CUDA, TypeScript, SvelteKit
Alternative toLM Studio, DeepSeekLM Studio, DeepSeek

From each project's repository and documentation; GitHub figures refresh daily.

Main features

Ollama

  • Download and run a model with a single command
  • Desktop chat app for macOS and Windows with file and image input
  • Local REST API with OpenAI- and Anthropic-compatible endpoints
  • GPU acceleration through CUDA, ROCm, Metal and Vulkan, plus an MLX engine on Apple silicon
  • Model import and customization with Modelfiles
  • Tool calling, structured outputs, vision and embeddings
  • One-command setup of coding agents such as Claude Code and Codex
  • Optional cloud models and web search with an Ollama account
  • Official Docker image and Python and JavaScript libraries

llama.cpp

  • Runs GGUF models on CPU, GPU or both, with 1.5-bit to 8-bit quantization
  • Backends for CUDA, HIP/ROCm, Metal, Vulkan, SYCL, OpenVINO, MUSA, CANN, WebGPU and more
  • One-line installer and a single `llama` command to download, chat and serve
  • llama-server with OpenAI- and Anthropic-compatible endpoints
  • Built-in Llama Chat web UI with branching, search and import/export
  • Image, PDF, audio and text attachments for capable models
  • Router mode that loads models on demand and downloads them from Hugging Face
  • Built-in file and shell tools and MCP servers usable from the web chat
  • API keys, HTTPS, Prometheus metrics and parallel requests

The short answer

Ollama and llama.cpp are not really rivals so much as two layers of the same stack. llama.cpp is a C/C++ inference engine for GGUF models, and Ollama’s README names it as the backend Ollama builds on. Ollama adds a convenience layer on top: a model library you pull from by name, loading and unloading of models based on available memory, a desktop app and a long list of integrations. Running llama.cpp directly is worth it when you need control Ollama hides, hardware Ollama does not support, or a small server with authentication and a full web chat built in.

Key differences

Ollama llama.cpp
Getting models ollama run name from the ollama.com library -hf user/model from Hugging Face, or local files
Model formats GGUF and Safetensors import; MLX models on Apple silicon GGUF only; conversion scripts for other formats
GPU support CUDA, ROCm v7, Metal, Vulkan CUDA, HIP (ROCm), Metal, Vulkan, SYCL, MUSA, CANN, OpenCL, OpenVINO, WebGPU and more
Local API Own REST API plus OpenAI and Anthropic compatibility, port 11434 OpenAI and Anthropic compatible, port 9931
Built-in chat Desktop app for macOS and Windows Llama Chat web app in llama-server
Several models Loads on request, unloads after 5 idle minutes Router mode loads and unloads on demand
Authentication None built in API keys
Install Installers, install script, Docker Install script, release binaries, package managers, Docker, source
Hosted option Ollama Cloud None from the project

The model workflow is the biggest day-to-day difference. With Ollama you type a model name and get a packaged model whose Modelfile sets the prompt template and run parameters. With llama.cpp you choose a GGUF file and quantization yourself, either from Hugging Face or by converting a model with the project’s scripts and llama-quantize, and you pass context size and GPU layers as flags. Ollama’s convenience comes from its own model store, so files you already have must be imported, and the docs do not describe using Ollama’s stored models in other tools.

Hardware is the second difference. Ollama documents NVIDIA (compute capability 5.0 and up), AMD through ROCm v7 on Linux and Windows, Apple Metal, and Vulkan for other AMD and Intel GPUs. llama.cpp’s build guide adds SYCL for Intel GPUs, MUSA for Moore Threads, CANN for Ascend NPUs, OpenCL for Adreno, Hexagon for Snapdragon, OpenVINO, WebGPU, IBM Z and several CPU libraries, and you can compile more than one backend into the same binary.

Running Ollama

Ollama installs with a DMG or EXE installer, a one-line script on macOS, Linux and Windows, or the ollama/ollama Docker image. On Linux it runs as a systemd service. It needs macOS 14 or newer, or Windows 10 22H2 or newer. The server listens on localhost, queues requests and keeps several models in memory when they fit. It has no API keys for local use; the OpenAI client needs a key value, but Ollama ignores it, so put a reverse proxy with authentication in front of any network exposure. The ollama launch command configures coding agents such as Claude Code, Codex and OpenCode to use it.

Running llama.cpp

llama.cpp installs with a script from llama.app, prebuilt binaries from GitHub releases, Winget, Homebrew, conda-forge, Nix or MacPorts, or Docker images with CUDA 12, CUDA 13, ROCm, MUSA, SYCL, Vulkan and OpenVINO variants. llama serve starts the API and the Llama Chat web app on localhost. Router mode, started without a model, serves several models, loading and unloading them and keeping memory free per device. The server also supports API keys, parallel requests, an optional Prometheus metrics endpoint, local file tools and MCP servers.

Hosted versions

Ollama Cloud runs larger models on Ollama’s servers. You use it from the app, the CLI, the local API or directly at ollama.com with an API key, and an account is required. Usage is billed per token or through subscription plans, while local use stays free and unlimited. Ollama says it hosts mainly in the United States, may route to Europe for capacity, and does not log or train on cloud prompts. Cloud features can be switched off with OLLAMA_NO_CLOUD=1. The llama.cpp project runs no hosted service; its docs point to Hugging Face Inference Endpoints if you want llama.cpp hosted for you.

Licensing

Both are MIT-licensed. Ollama’s copyright holder is Ollama, and its desktop app code is in the same repository. llama.cpp’s copyright is held by the ggml authors. The separate “Llama” desktop apps promoted on llama.app live in other repositories and are not part of llama.cpp. Neither repository contains proprietary directories or a separate enterprise edition of the software.

Moving between them

From llama.cpp to Ollama, the import path is documented: point a Modelfile’s FROM line at your GGUF file, or at a wildcard for split files, then run ollama create. Going the other way, there is no documented export. Download the GGUF again from Hugging Face with -hf instead. Apps don’t need much change, because both servers speak the OpenAI API. Change the base URL from port 11434 to llama-server’s address and set the model name.

Who should choose which

  • Beginners and anyone who wants a local model running in minutes: Ollama.
  • People who want a backend for chat apps such as Jan or LibreChat, or for coding agents: Ollama, whose README lists a long set of community integrations, though llama-server works anywhere an OpenAI endpoint is accepted.
  • Tinkerers tuning quantization, context and GPU offload: llama.cpp.
  • Owners of Intel, Ascend, Moore Threads or Snapdragon hardware: llama.cpp.
  • Small shared servers that need API keys and a browser chat without extra software: llama.cpp.

Both are open source replacements for LM Studio, and either can feed a self-hosted alternative to ChatGPT. More options are in the AI chat guide.

Frequently asked questions

Does Ollama use llama.cpp?

Yes. Ollama's README lists llama.cpp as its supported backend, and its June 2026 blog post on GGUF support says that support comes through llama.cpp. On Apple silicon, Ollama also has its own MLX-based engine for models published in MLX format.

Can I use a GGUF file from Hugging Face in Ollama?

Yes. Write a Modelfile with a FROM line pointing to the .gguf file (or a wildcard for split files) and run ollama create. Ollama does not quantize GGUF files during import, so pick or prepare the quantization first, for example with llama.cpp's llama-quantize.

Do both have an OpenAI-compatible API?

Yes. Ollama serves a subset of the OpenAI API under /v1 on port 11434, next to its own REST API. llama.cpp's llama-server offers OpenAI-compatible chat completions, responses and embeddings. Both also accept Anthropic Messages requests.

Is Ollama or llama.cpp free?

Both are MIT-licensed and free to run locally. Ollama additionally sells optional cloud models billed per use or through subscription plans; llama.cpp has no hosted service of its own.

Both apps are in AI Chat & Local LLMs, where you can compare all 16. Read the full reviews of Ollama and llama.cpp.