ComparisonModels & inference
llama.cpp vs Ollama vs LM Studio: which local model runner fits your setup
Compare llama.cpp vs Ollama vs LM Studio on APIs, GPU and OS support, model formats and licences, then pick a local model runner with a decision table.
In the llama.cpp vs Ollama vs LM Studio choice, llama.cpp is the open-source inference engine. Ollama is an MIT-licensed model manager and server that lists llama.cpp as its backend, and LM Studio is a proprietary desktop app that runs llama.cpp (plus MLX on Apple silicon) behind a GUI. Pick llama.cpp for the widest hardware support, Ollama for a simple background service, and LM Studio for a point-and-click model browser. All three expose an OpenAI-compatible API, so switching later costs little.
What each project is and who maintains it
llama.cpp
llama.cpp (opens in a new tab) is LLM and VLM inference in plain C/C++, built on the ggml tensor library. It lives under the ggml-org GitHub organization, and the Ollama README credits Georgi Gerganov as its founder. The repository ships a library (llama.h) plus tools: an interactive CLI, a completion tool, a quantizer and llama-server.
The current README promotes a single llama command:
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
The docs list an install script (curl -LsSf https://llama.app/install.sh | sh, or irm https://llama.app/install.ps1 | iex on Windows). Package managers include Homebrew, winget, conda-forge, Nix and MacPorts. Docker images, pre-built release binaries and CMake builds from source are also documented.
Ollama
Ollama (opens in a new tab) is developed in the ollama GitHub organization. It installs as a background service, downloads models from its own library with ollama pull, and serves them over HTTP on port 11434. Its README lists llama.cpp under "Supported backends". Ollama also offers optional cloud-hosted models, which you can switch off with OLLAMA_NO_CLOUD=1.
LM Studio
LM Studio is a desktop app for downloading and running models locally, made by Element Labs, Inc. It has a chat interface, a Discover tab that searches Hugging Face, and a local API server. A headless build called llmster runs the same core as a daemon on servers or in CI, with no GUI.
Model formats: GGUF and where models come from
All three tools center on GGUF, the model file format from the llama.cpp project. They differ in how you find and fetch models.
llama.cpp loads a GGUF file from disk with -m path/to/model.gguf, or pulls one from Hugging Face with -hf user/repo[:quant]. When you leave out the quantization, -hf picks Q4_K_M if the repo has it. The repo also has convert_hf_to_gguf.py for converting Hugging Face weights and llama-quantize for shrinking them. Quantization levels run from 1.5-bit to 8-bit.
Ollama uses short names from its own library, such as gemma4 or qwen3:8b. To run something that is not in the library, write a Modelfile with FROM /path/to/file.gguf (or a Safetensors directory) and run ollama create. Ollama does not quantize GGUF files on import, so quantize first with llama.cpp.
LM Studio downloads from Hugging Face inside the app. Its docs explain that names like Q3_K_S or Q_8 are quantized copies of one model and suggest choosing 4-bit or higher if your machine can handle it. On Apple silicon it also runs MLX models.
Which APIs do llama.cpp, Ollama and LM Studio expose?
Each tool runs a local HTTP server, and each has OpenAI-style and Anthropic-style routes. The defaults differ. Sources: the llama-server README (opens in a new tab), Ollama's API docs and the LM Studio developer docs (opens in a new tab).
llama.cpp (llama-server) | Ollama | LM Studio | |
|---|---|---|---|
| Default address | 127.0.0.1:8080 | 127.0.0.1:11434 | 127.0.0.1, port 1234 in the docs' examples |
| Native API | /completion, /embedding, /reranking, /infill, /slots, /metrics (Prometheus) | /api/generate, /api/chat, /api/pull, /api/tags, /api/embed and more | LM Studio REST API (/api/v1/chat and model management) |
| OpenAI-compatible | /v1/chat/completions, /v1/completions, /v1/responses, /v1/embeddings, /v1/models | /v1/chat/completions, /v1/completions, /v1/responses (stateless), /v1/embeddings, /v1/models | /v1/chat/completions, /v1/completions, /v1/responses, /v1/embeddings, /v1/models |
| Anthropic-compatible | /v1/messages | Yes, a subset of the Messages API | /v1/messages |
| Auth | --api-key or --api-key-file | No key check; the docs say clients may send any key and Ollama ignores it | API tokens (LM Studio 0.4.0+), off by default |
| Built-in UI | Web UI served by llama-server | Desktop app on macOS and Windows | Desktop app |
| Official SDKs | None listed; use any OpenAI client | ollama on PyPI and npm | lmstudio (Python), @lmstudio/sdk (TypeScript) |
A few differences matter in practice. llama-server has a router mode: start it without a model and it loads and unloads models on demand through /models/load and /models/unload. Ollama's Responses API is stateless, so previous_response_id is not supported. LM Studio's docs show its Anthropic route working with Claude Code by setting ANTHROPIC_BASE_URL=http://localhost:1234.
To expose a server on your network, llama.cpp uses --host, Ollama uses the OLLAMA_HOST environment variable, and LM Studio uses lms server start --bind 0.0.0.0. LM Studio's docs recommend turning on authentication before binding beyond localhost.
GPU and platform support from the docs
llama.cpp
The llama.cpp README lists the widest backend set: Metal (Apple silicon), CUDA (NVIDIA), HIP (AMD), Vulkan, SYCL (Intel GPU), MUSA (Moore Threads), CANN (Ascend NPU), OpenCL (Adreno), Hexagon (Snapdragon), ZenDNN, BLAS and WebGPU, with OpenVINO in progress. On the CPU side it supports AVX, AVX2, AVX512 and AMX on x86, and several RISC-V extensions. It can split a model between CPU and GPU when the model is larger than your VRAM, controlled by -ngl (default auto).
Ollama
Ollama's docs list:
- macOS Sonoma (14) or newer: Apple M-series gets CPU and GPU (Metal), Intel Macs run on the CPU only.
- Windows 10 22H2 or newer, with NVIDIA and AMD Radeon GPU support.
- Linux on amd64 and arm64, with a separate ROCm package for AMD.
- NVIDIA GPUs from compute capability 5.0 with driver 550 or newer.
- Vulkan, enabled by default, as an extra path for AMD and other GPUs.
LM Studio
The LM Studio system requirements (opens in a new tab) say:
- macOS 14.0 or newer on Apple silicon (M1 to M4). Intel Macs are not supported. 16 GB of RAM or more is recommended.
- Windows on x64 (AVX2 required) and ARM (Snapdragon X Elite). The docs recommend at least 16 GB of RAM and 4 GB of dedicated VRAM.
- Linux on x64 and ARM64 as an AppImage, Ubuntu 20.04 or newer.
The system requirements page does not list which GPU vendors LM Studio supports on Windows and Linux. GPU offload is set per model or with lms load --gpu=max|auto|0.0-1.0.
Licences
| Project | Licence | Notes |
|---|---|---|
| llama.cpp | MIT | Engine, tools and server are all in the one repository |
| Ollama | MIT | Optional cloud models are a separate hosted service |
| LM Studio app | Proprietary | Element Labs' terms (version dated 23 August 2026) allow personal and internal business use and say some features may cost money |
lms CLI, lmstudio-python, lmstudio-js | MIT | Open-source tooling around the closed app |
If you need to read, patch or redistribute the runner itself, llama.cpp and Ollama allow that under MIT. LM Studio's app code is not open, so check its terms before you build a product around it.
Decision table: llama.cpp vs Ollama vs LM Studio by use case
Copy this table and mark the rows that describe your setup. The tool that appears most often in your marked rows is your starting point.
| Your situation | Best fit | Why, from the docs |
|---|---|---|
| You want a GUI to browse Hugging Face and chat | LM Studio | Discover tab searches Hugging Face; chat UI built in |
| You are on an Intel Mac | llama.cpp or Ollama | LM Studio does not support Intel Macs; Ollama runs CPU-only there |
| You have an AMD, Intel Arc, Ascend or Adreno GPU | llama.cpp | HIP, SYCL, CANN, OpenCL and Vulkan backends are listed |
| You want MLX models on Apple silicon | LM Studio | MLX engine documented for Apple silicon Macs |
| You want a background service that apps call | Ollama | Runs as a service; one-line pull and run; native and OpenAI APIs |
| You need several models served from one endpoint | llama.cpp or Ollama | llama-server router mode; Ollama loads up to 3 models per GPU by default |
| You need Prometheus metrics or slot control | llama.cpp | /metrics and /slots endpoints |
| You need API keys on the local server | llama.cpp or LM Studio | --api-key; LM Studio API tokens |
| You want to modify or redistribute the runner | llama.cpp or Ollama | Both MIT licensed |
| You want a headless server without a GUI | Any of the three | llama-server, ollama serve, LM Studio llmster |
| You run a GGUF that is not in Ollama's library | llama.cpp or LM Studio | Both load GGUF directly; Ollama needs a Modelfile import |
None of the project docs used here publish speed comparisons against the other two, so this table leaves performance out. Measure on your own hardware with the model you plan to use.
Frequently asked questions
Can I use the same GGUF file in all three tools?
Yes, in most cases. llama.cpp loads it with `-m`, LM Studio takes it through `lms import` or its sideloading feature, and Ollama wraps it with a one-line Modelfile (`FROM /path/to/file.gguf`) and `ollama create`. Check free disk space before importing large files into more than one tool.
Do these tools send my prompts to the internet?
Local inference runs on your machine in all three. Ollama's FAQ says it does not see prompts when you run models locally, and its optional cloud models can be disabled with `OLLAMA_NO_CLOUD=1`. LM Studio's offline docs say chats, document chat and the local server work without internet; model search, downloads, runtime downloads and update checks do not.
Can I run two of them on one machine?
Yes. They use different ports (8080 is the `llama-server` default, 11434 is Ollama's, and LM Studio's examples use 1234), so they do not clash. Each one loads models into memory separately, so two loaded at once compete for the same RAM and VRAM.
Which one works with Claude Code?
All three document an Anthropic-style `/v1/messages` route. Ollama adds a shortcut, `ollama launch claude`, that configures and starts Claude Code against a local model. With LM Studio you set `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` yourself, and with `llama-server` you point the same variable at port 8080.
Sources
- 1.GitHub - ollama/ollama: Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models. · GitHubRepositoryPrimarygithub.com
- 2.Welcome to LM Studio Docs! | LM StudioOfficial docsPrimarylmstudio.ai
- 3.lmstudio.ai/docs/developerWeb
- 4.GitHub - ggml-org/llama.cpp: LLM inference in C/C++ · GitHubRepositoryPrimarygithub.com
- 5.github.com/ggml-org/llama.cpp/blob/master/docs/install.mdRepositoryPrimary
- 6.github.com/ollama/ollama/blob/main/docs/import.mdxRepositoryPrimary
- 7.github.com/ollama/ollama/blob/main/docs/api/openai-compatibility.mdxRepositoryPrimary
- 8.github.com/ollama/ollama/blob/main/docs/api/anthropic-compatibility.mdxRepositoryPrimary
- 9.github.com/ollama/ollama/blob/main/docs/faq.mdxRepositoryPrimary
- 10.github.com/ollama/ollama/blob/main/docs/macos.mdxRepositoryPrimary
- 11.github.com/ollama/ollama/blob/main/docs/windows.mdxRepositoryPrimary
- 12.github.com/ollama/ollama/blob/main/docs/linux.mdxRepositoryPrimary
- 13.github.com/ollama/ollama/blob/main/docs/gpu.mdxRepositoryPrimary
- 14.lmstudio.ai/docs/app/system-requirementsWeb
- 15.lmstudio.ai/docs/app/basics/download-modelWeb
- 16.lmstudio.ai/docs/developer/openai-compatWeb
- 17.lmstudio.ai/docs/developer/anthropic-compatWeb
- 18.lmstudio.ai/docs/developer/core/authenticationWeb
- 19.lmstudio.ai/docs/cli/serve/server-startWeb
- 20.lmstudio.ai/docs/cliWeb
- 21.lmstudio.ai/app-termsWeb
- 22.llama.cpp/tools/server/README.md at master · ggml-org/llama.cpp · GitHubRepositoryPrimarygithub.com
Spotted an error? See our corrections policy.
Enjoyed this? Get the weekly brief.
New guides, Project & Tool of the Week and the AI developments that matter. One email, no spam.
Read next
- TutorialModels & inference
Fine tune LLM LoRA adapters: data, training and a first test on one GPU
Fine tune LLM LoRA adapters on one GPU: check that fine-tuning fits, prepare data, train with PEFT and TRL or Unsloth, and compare against the base model.
6 min read
- GuideModels & inference
Prompt caching with the OpenAI, Claude and Gemini APIs: what is cached and what breaks it
Compare prompt caching API rules for OpenAI, Claude and Gemini, order prompts so the cache hits, avoid silent misses and measure savings from usage fields.
8 min read
NewsModels & inferenceIntel details the GPU D270, an air-cooled inference card with up to 480 GB
Intel detailed the GPU D270 inference card: 480 GB LPDDR5X on partner cards, 160 GB on its own, 350 W PCIe. No price or ship date yet for buyers.
4 min read