GuidesHosting choices

Ollama vs LM Studio: which to run behind your coding agent

Ollama vs LM Studio as of December 2026: licence, running headless on a Linux server, APIs for Claude Code, Codex, OpenCode and OpenClaw, context defaults, API tokens.

December 2, 2026The Everpod team
The short answer

Both run open models on your own machine with llama.cpp (and MLX on Apple silicon) and serve them to agents over OpenAI- and Anthropic-compatible APIs, so Claude Code, Codex, OpenCode and OpenClaw work with either. Ollama is MIT-licensed open source and installs on Linux as a systemd service with no login on its API. LM Studio is a free but closed-source desktop app with a model browser and per-model settings; on a server you run its headless daemon, llmster, and it can require an API token, which Ollama’s docs offer no setting for. As of December 2, 2026 the versions are Ollama v0.40.19 and LM Studio 0.4.29.

One thing has changed on LM Studio’s side that confuses a first visit: its home page now leads with Bionic, launched on July 16, 2026 as “a new, separate app from LM Studio” that is itself an agent. The model server this page compares is LM Studio proper and its headless llmster, both on the download page.

Side by side

OllamaLM Studio
Licence
MIT, whole projectApp proprietary, free at home and at work; CLI and MLX engine MIT
Headless on Linux
Install script sets up the ollama systemd servicellmster daemon; you write the systemd unit from its docs
Mac
macOS 14+, Apple silicon (Intel runs on CPU only)macOS 14+, Apple silicon only
Default address
127.0.0.1:11434127.0.0.1, port 1234 (or the last one used)
Login on the API
NoneOptional token, off by default
Engines
llama.cpp; MLX on Apple silicon (preview since March 2026)llama.cpp runtimes; MLX on Apple silicon
Models
Ollama’s library, Hugging Face GGUFs, your own GGUF or SafetensorsGGUF and MLX models from Hugging Face
APIs
Native, OpenAI-compatible (with Responses), Anthropic-compatibleNative, OpenAI-compatible (with Responses), Anthropic-compatible
Default context
4k, 32k or 256k by GPU memoryNo number in its docs; set per model
Hosted models
Ollama cloud models, with an accountThrough the separate Bionic app

Licence and what you may do with each

Ollama’s repository is MIT-licensed, so you can read it, patch it, package it and run it as part of a service you sell.

LM Studio has been free for work use since July 8, 2025, with no form or commercial licence. It is not open source: its terms (version of August 23, 2026) license it “solely for Your personal and / or internal business purposes” and rule out using it “for service bureau use”, which matters if you meant to resell inference from it to others. Two pieces are open under MIT: the lms command line and the MLX engine it uses on Macs.

Running it on a server with no screen

This is where the two differ most for an agent box. Ollama’s Linux installer creates an ollama user and a systemd service, so the server is running when the script finishes and starts again at boot; there is an ARM64 package and a separate ROCm package for AMD cards. Its settings, the bind address and context included, are environment variables on that service, covered in running Ollama as a server.

LM Studio’s desktop app runs on Linux as an AppImage and needs a desktop session. For a machine without one, LM Studio recommends llmster, “LM Studio’s headless daemon”, driven entirely by lms. It installs for your own user, not as a system service:

curl -fsSL https://lmstudio.ai/install.sh | bash
Copied

Then start the daemon, pick a model from the staff picks (or name one after lms get), load it with the context your agent needs, and start the server:

lms daemon up
lms get
lms load openai/gpt-oss-20b --context-length 32768
lms server start --port 1234
Copied

Nothing of that survives a reboot on its own. LM Studio’s headless guide gives a unit for /etc/systemd/system/lmstudio.service that runs as your user, brings the daemon up, can preload a model, and starts the server; if the preload fails, the server does not start. Without a preload, a request naming a model loads it on demand and unloads it after 60 idle minutes by default. Either way, curl http://localhost:1234/v1/models is the check that it is serving.

Engines, hardware and where models come from

Both build on llama.cpp for GGUF models. Ollama documents NVIDIA cards of compute capability 5.0 or later on driver 550 or newer, AMD through ROCm v7, Vulkan (on by default once installed), and Metal on Macs; its MLX engine for Apple silicon arrived in preview on March 30, 2026 for Macs with more than 32GB of memory, and the November releases still carry MLX fixes. LM Studio downloads its llama.cpp engines separately from the app and lets you list, switch and update them with lms runtime; MLX models run on Apple silicon only, and LM Studio does not run on Intel Macs at all.

The catalogues differ in kind. Ollama pulls by short names from its own library, and also straight from Hugging Face with ollama run hf.co/<user>/<repo>, picking Q4_K_M when the repository has it; a local GGUF or Safetensors folder goes in through a Modelfile. LM Studio searches Hugging Face itself, in the app or with lms get, where --gguf and --mlx filter by format and @q4_k_m picks a quantisation. On a Mac, that choice of MLX builds is the main practical difference in what you can run.

The APIs, and what each agent needs

Each serves three APIs on one port: its own, an OpenAI-compatible one at /v1 that includes /v1/responses, and Anthropic’s Messages at /v1/messages. That covers every agent below with either server; what differs is the address and, for LM Studio with a token, the key.

AgentWith OllamaWith LM Studio
Claude Code
ANTHROPIC_BASE_URL=http://localhost:11434, any tokenANTHROPIC_BASE_URL=http://localhost:1234, any token, or the real one if required
Codex
codex --oss, or ollama launch codexcodex --oss
OpenCode
Base URL http://localhost:11434/v1, or ollama launch opencodeBuilt-in lmstudio provider at http://127.0.0.1:1234/v1
OpenClaw
Native API, base URL with no /v1lmstudio provider, base URL with /v1

With --oss, Codex asks which local server to use unless oss_provider is set to lmstudio or ollama in its config (more in choosing Codex’s model). OpenClaw is the one where the URL shape matters: its docs warn that Ollama’s /v1 address breaks tool calling, while its LM Studio provider expects /v1. Ollama’s Anthropic side lists what it does not support, token counting, tool_choice and prompt caching among them. Per-agent setups are in Claude Code with Ollama and OpenClaw with Ollama.

LM Studio’s Claude Code page gives this setup, with an extra variable Ollama’s does not use:

export ANTHROPIC_BASE_URL=http://localhost:1234
export ANTHROPIC_AUTH_TOKEN=lmstudio
export CLAUDE_CODE_ATTRIBUTION_HEADER=0
claude --model openai/gpt-oss-20b
Copied

Context, the default that trips agents

A coding agent’s instructions and tool definitions alone run to many thousands of tokens, so a model loaded with a small window quietly loses part of what it was told. Ollama sets the default by GPU memory: 4k under 24 GiB, 32k from 24 to 48 GiB, 256k above that (its FAQ still says 4096 flat). It asks for at least 64000 tokens for agents and coding tools, set with OLLAMA_CONTEXT_LENGTH on the server, since the OpenAI-compatible API cannot ask for more per request.

LM Studio’s docs give no default number. The window is a load setting: the --context-length flag on lms load, context_length on its native load endpoint, or a model’s saved default in the app, which is what an on-demand load uses. Its own agent pages ask for more than about 25k for Claude Code and Codex, and OpenClaw’s asks for at least 32,768. Whichever you run, more context costs memory; if a model no longer fits on the GPU, it slows sharply.

Who can reach the server

Both listen on 127.0.0.1 by default, reachable only from the machine itself. Ollama’s local API “does not require authentication”, and its docs describe no setting to require it, so anything that can reach the port can use it. LM Studio can require a token: it is off by default, turned on under Server Settings in the app’s Developer page, where tokens are also made, and clients then send it as a bearer token. Its documentation shows that switch only in the app, and the lms command reference has no command for it, so on a llmster-only machine plan as if there were no token.

Binding either to 0.0.0.0 (OLLAMA_HOST, or --bind on lms server start) opens it on every interface, a public one included, and LM Studio’s own docs recommend authentication for any bind other than 127.0.0.1. On a machine with a public address, leave the server on loopback and reach it through an SSH tunnel from the agent’s machine:

ssh -N -L 1234:127.0.0.1:1234 you@gpu-box
Copied

For Ollama, use 11434 on both sides. More on tunnels in opening a localhost app on a remote server. LM Studio also has LM Link, an end-to-end encrypted link between your own devices built with Tailscale, which lets one machine use models loaded on another.

If you do turn on LM Studio’s token, keep it out of your shell history: run the line below, paste the token, and press Enter (nothing is shown).

read -rs LM_API_TOKEN
Copied

Then hand it to the agent, here Claude Code:

export ANTHROPIC_AUTH_TOKEN="$LM_API_TOKEN"
Copied

Hosted models in both

Both now also offer models run on their makers’ servers. Ollama has cloud models that need an Ollama account; to keep everything on your own hardware, set OLLAMA_NO_CLOUD=1 on the server (or "disable_ollama_cloud": true in ~/.ollama/server.json) and restart it. On LM Studio’s side, hosted models belong to the separate Bionic app; LM Studio and llmster themselves run local models.

Versions, December 2026

Ollama’s latest release is v0.40.19, published November 26, 2026, with v0.40.20 in pre-release since November 28; rerunning the install script updates it. LM Studio’s download page offers 0.4.29, and lms daemon update exists for llmster. The separate Bionic app is at 1.2.3 (November 25).

Which one fits which reader

A Linux server or GPU box serving agents, unattended. Ollama takes fewer steps: a system service from the installer, settings in one override file, and ollama launch for Codex and OpenCode. The trade is no login on the API, which loopback and a tunnel or a private network cover.

Someone who needs a token on the endpoint because other people or machines share it: LM Studio has one and Ollama does not, provided a desktop session is available to switch it on.

A Mac user choosing and tuning models by hand. LM Studio’s app, with its Hugging Face search, MLX builds and saved settings per model, is built for that; Ollama’s MLX engine is newer and in preview, and Ollama is the one of the two that still runs, on CPU, on an Intel Mac.

Anyone who needs the source or plans to resell. Ollama’s MIT licence allows it; LM Studio’s terms allow internal business use only.

Whichever you pick, the model and its context set what an agent can do far more than the server does, and a local GPU’s memory is what caps both; what that hardware costs against renting is in a local AI box against the cloud.

Run Claude Code, Codex, OpenCode, Pi, Hermes or OpenClaw on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.