Skip to main content
kRouter
All posts
Comparisons

Ollama vs LM Studio: the local AI showdown for 2026

Ollama, LM Studio, llama.cpp and vLLM all run open-weight models locally. What each does well in 2026, what changed, and when to add cloud fallback.

Kodelyth · The team behind kRouter
· Updated
7 min read

If you have a Mac with plenty of unified memory or a desktop GPU, you can run capable open-weight models on your own hardware. The two most common ways to do it are Ollama and LM Studio. llama.cpp and vLLM are the alternatives worth knowing, for different reasons.

This post was rewritten in October 2026. The first version had a benchmark table for a "Llama 4 70B" model that does not exist -- Llama 4 shipped as Scout (109B total parameters) and Maverick (400B), both mixture-of-experts -- so the table is gone. It also said Ollama handles one request at a time, that it only runs models from its own library, and that LM Studio cannot run headless. None of that is true any more.

What changed this year

  • Both speak Anthropic's Messages API. Ollama from v0.14.0 and LM Studio from 0.4.1, both in January 2026. Claude Code can talk to either one directly.
  • LM Studio runs headless. Version 0.4.0 added llmster, a daemon for Linux servers without a GUI, and parallel requests with continuous batching.
  • Ollama has a desktop app. Since v0.10.0 (July 2025) it ships a chat window on macOS and Windows, not just the CLI.
  • Ollama is adding MLX. v0.19 (March 2026) introduced an MLX engine on Apple Silicon as a preview, for a small set of models and Macs with more than 32 GB of memory.

Ollama: a model server you run from the terminal

Ollama is an MIT-licensed local model server with a CLI, plus the desktop app on macOS and Windows.

What it does well:

  • ollama run <model> downloads and starts a model in one step. Models come from Ollama's library or straight from Hugging Face (ollama run hf.co/<user>/<repo>), and you can import a local GGUF or Safetensors model with a Modelfile.
  • It serves its own API, an OpenAI-compatible /v1 API and the Anthropic Messages API on port 11434.
  • It runs well headless, which makes it the usual choice for a Linux box that serves a team. It binds to 127.0.0.1 by default; set OLLAMA_HOST=0.0.0.0:11434 to open it to your network.

What to watch:

  • Context length. The default depends on your VRAM: 4k tokens under 24 GiB, 32k from 24 to 48 GiB, 256k above that. Coding agents send long prompts, so on a smaller machine raise it with OLLAMA_CONTEXT_LENGTH or the app's slider.
  • Parallel requests. Each model handles one request at a time by default (OLLAMA_NUM_PARALLEL). Raising it multiplies the context memory by the number of parallel slots.

LM Studio: a desktop app for finding and running models

LM Studio is a desktop app for browsing, downloading and chatting with models. The app is proprietary, but free for home and work use since July 2025; its lms CLI and SDKs are MIT-licensed.

What it does well:

  • A model browser over Hugging Face, where you pick the quantization file by file.
  • Two engines: llama.cpp for GGUF models, and MLX on Apple Silicon.
  • A local server on port 1234, started from the Developer tab or with lms server start, with OpenAI-compatible, Anthropic-compatible and native REST APIs.
  • Since 0.4.0, parallel requests (4 at once by default) on the llama.cpp engine; LM Studio's docs list MLX support for this as coming. Speculative decoding is also available.
  • llmster for servers: curl -fsSL https://lmstudio.ai/install.sh | bash, then lms daemon up and lms server start.

What to watch:

  • The server does not ask for a key unless you turn on Require Authentication. Turn it on before you expose it beyond your machine.

llama.cpp: the engine underneath

llama.cpp is the MIT-licensed C/C++ inference engine. LM Studio's GGUF engine is llama.cpp, and Ollama was built on it.

What it does well:

  • llama-server gives you OpenAI-compatible chat, Responses and embeddings routes, an Anthropic Messages-compatible route, and a built-in web UI (port 8080 by default).
  • -hf <user>/<model>[:quant] downloads a model from Hugging Face, and a router mode can serve several models from one directory.
  • Parallel slots (-np) with continuous batching, and direct control over context size, KV cache and GPU offload.
  • It runs on almost anything: macOS, Linux, Windows, ARM boards.

What to watch:

  • You manage models and flags yourself. That is the point of it, and also the cost.

vLLM: serving a team from GPUs

vLLM is an Apache-licensed serving engine built for throughput: PagedAttention for memory, continuous batching, and an OpenAI-compatible server.

What it does well:

  • Many concurrent users on one or more GPUs.
  • It loads models in their original Hugging Face (Safetensors) format.

What to watch:

  • It targets GPUs: NVIDIA CUDA, AMD ROCm and Intel XPU. Apple Silicon is supported through a separate vLLM-Metal plugin, or on CPU.
  • GGUF support is described by vLLM itself as "highly experimental" and has moved to a separate plugin.
  • For one person on a laptop, it is more machinery than you need.

Which model files each one runs

FormatOllamaLM Studiollama.cppvLLM
GGUFYes: library, hf.co, or local importYesYesExperimental plugin
MLX (Apple Silicon)Preview since v0.19, selected modelsYesNoNo
Original Hugging Face weights (Safetensors)Import with a ModelfileNo, needs a GGUF or MLX buildConvert to GGUF firstYes, its native format

The format often matters more than the app. On a Mac, try an MLX build where one exists; for an NVIDIA box serving several people, vLLM; everywhere else, a GGUF in whichever tool you prefer.

Where kRouter fits, and where you do not need it

If one tool talks to one local server, you do not need a router. Ollama, LM Studio and llama-server all speak OpenAI's API and Anthropic's Messages API, so Claude Code, Cline or Continue can point at them directly. The first version of this post said kRouter was needed to fix Ollama's "non-standard" responses. That is not a reason any more.

kRouter is useful when you want:

  • Cloud fallback. Local first, and a cloud model when the local server is down or a request fails.
  • One endpoint for local and cloud. Your tools keep a single base URL and choose models by name.
  • Protocol translation. A client that speaks OpenAI Chat, Anthropic Messages or the Responses API can reach any backend.

Ollama in kRouter

kRouter has a dedicated Ollama Local provider. Add a connection on its page in the dashboard; the only field is the Ollama host URL (default http://localhost:11434), and there is no key. kRouter reads the models you have pulled and sends requests to Ollama's native chat API. Use them as ollama-local/<tag>, for example ollama-local/gpt-oss:20b.

Two things to know. Ollama Cloud (ollama/...) is a different provider: Ollama's hosted service, with its own key. And kRouter does not set Ollama's context size -- it passes temperature, max tokens and top-p -- so set OLLAMA_CONTEXT_LENGTH on the Ollama side.

LM Studio in kRouter

There is no dedicated LM Studio provider; add it as your own endpoint. On the Providers page choose Add OpenAI Compatible, give it a prefix such as lms, choose Chat Completions, and set the base URL to http://localhost:1234/v1. Then add a connection: kRouter asks for a key and a default model, and LM Studio ignores the key unless Require Authentication is on, so a placeholder works. Models become lms/<model id>.

Local first, cloud second

A combo puts the local model first:

Combo "local-first"
  1. ollama-local/gpt-oss:20b   your machine, no per-token cost
  2. glm/glm-5.3                paid API key
  3. mmf/mimo-auto              free, while that service still offers it

kRouter moves to the next entry when a request fails, not when it is slow. If Ollama is not running, kRouter retries for several seconds, moves on to GLM, and leaves the local connection out for 30 seconds before trying it again. A local model that is merely generating slowly keeps the request. kRouter does give an upstream 60 seconds to start responding, which a large model loading cold from disk can exceed. The local-first fallback guide goes further into building this chain.

The verdict

Use Ollama if you live in the terminal or want a headless server with the least setup.

Use LM Studio if you want to browse and try models in a GUI, or you are on a Mac and want MLX builds today.

Use llama.cpp if you want every knob and do not mind managing models yourself.

Use vLLM if you are serving a team from GPUs.

Add kRouter when you want a cloud fallback behind the local model, or one endpoint for local and cloud models together.

Common questions

Is Ollama or LM Studio faster?

It depends on the model format and your hardware more than on the app. Both use llama.cpp for GGUF models. On Apple Silicon, MLX builds are often faster: Ollama's own MLX announcement reported roughly double the decode speed of its previous engine on the model it tested. Compare on your own machine, with the same model and quantization.

Can LM Studio run on a server without a screen?

Yes, since 0.4.0. Install llmster with curl -fsSL https://lmstudio.ai/install.sh | bash, then run lms daemon up and lms server start. Ollama has always run headless.

Can Claude Code use a local model without kRouter?

Yes. Ollama (v0.14.0 and later) and LM Studio (0.4.1 and later) both accept Anthropic's Messages API, so you can set ANTHROPIC_BASE_URL to the local server. Check the model's context length first; see Claude Code's context window with other models.

Does kRouter fail over to the cloud when my local model is slow?

No. It fails over when the request fails -- the server is down, the model will not load, or it returns an error -- not because tokens arrive slowly.

Kodelyth · The team behind kRouter

Published by Kodelyth, the team that builds kRouter. Posts are drafted with AI assistance and reviewed by a person before they go out. kRouter is free and MIT licensed.

Install kRouter