Ollama vs LM Studio: Choosing the Right Tool to Run Local LLMs on Ubuntu

Written by: Bagus Facsi Aginsa
Published at: 17 May 2026


The shift toward running AI models locally has gone from a niche experiment to a genuine production strategy in the span of a couple of years. Open-weight models like Llama 3, Mistral, and Qwen have closed most of the quality gap with proprietary APIs for many everyday tasks. The tooling to run them has matured just as fast. Two tools dominate the conversation: Ollama and LM Studio.

They solve the same problem, which is get an LLM running on your machine without fighting with Python environments or compiling CUDA libraries. But they make very different design choices. Ollama is built for developers and server workflows. LM Studio is built for anyone who wants a polished GUI experience without touching the terminal.

If you are a developer or sysadmin deciding which one to invest time in, this article gives you a direct, practical comparison. You will install both on Ubuntu, run the same model in each, test the API, understand the tradeoffs, and finish knowing which one fits your situation.


What They Have in Common

Before diving into differences, it helps to be clear on what both tools actually do.

Both Ollama and LM Studio:

  • Download and manage open-source model files in GGUF format, a compact quantized format designed for efficient CPU and GPU inference
  • Use llama.cpp as the inference engine under the hood (though both add their own layers on top)
  • Expose a local HTTP API so your applications can send prompts and receive completions
  • Expose an OpenAI-compatible endpoint (/v1/chat/completions) so existing tools work with minimal reconfiguration
  • Support GPU acceleration on NVIDIA (CUDA), AMD (ROCm), and Apple Silicon (Metal)
  • Run models entirely offline after the initial download

The differences are in philosophy, usability, and fit for specific workflows.


Prerequisites

  • Ubuntu 20.04, 22.04, or 24.04
  • At least 8 GB of RAM (16 GB recommended)
  • At least 15 GB of free disk space
  • A user with sudo privileges
  • Basic Linux command-line familiarity

GPU acceleration is optional but strongly recommended for models larger than 7B parameters.


Installing Ollama

Ollama was designed for Linux from the start. Installation is a single command:

curl -fsSL https://ollama.com/install.sh | sh

The install script downloads the Ollama binary, detects your GPU (NVIDIA CUDA or AMD ROCm), creates a dedicated ollama system user, and registers a systemd service that starts automatically on boot.

Verify it worked:

ollama --version
systemctl status ollama

You should see the version number and active (running).

Ollama is now running as a daemon, listening on http://127.0.0.1:11434. It will start automatically every time your machine boots. No further configuration is needed to pull and run models.


Installing LM Studio

LM Studio is primarily a desktop application. On Ubuntu, it ships as an AppImage, a self-contained executable that does not touch your system packages.

Download the latest Linux AppImage from the LM Studio releases page. At the time of writing, the URL pattern is:

wget "https://releases.lmstudio.ai/linux/x86/0.3.5/LM_Studio-0.3.5.AppImage" -O LMStudio.AppImage

Make it executable and run it:

chmod +x LMStudio.AppImage
./LMStudio.AppImage

If you are on a headless server or an SSH session without a display, LM Studio will fail to start, it requires a graphical environment. This is the first major practical difference: LM Studio is a GUI application and cannot run headlessly.

On a desktop Ubuntu machine with a display, the LM Studio window opens immediately. No installation step, no system service, no configuration file.

LM Studio’s CLI mode: LM Studio 0.3.x introduced a CLI (lms) that can be used from the terminal. To enable it, open LM Studio’s settings and install the CLI tools. The lms binary is then added to your PATH and lets you load models and start the server without the GUI:

lms server start
lms load --model llama-3.2-3b-instruct

However, the CLI is a companion to the GUI, not a replacement. The initial model download still happens through the GUI, and the server process exits when the GUI closes unless you explicitly background it.


Pulling and Running a Model

Ollama

Pull a model with one command. The model name follows a name:tag convention where the tag specifies the parameter count and quantization level:

ollama pull llama3.2:3b

Run it interactively:

ollama run llama3.2:3b

Or pass a one-shot prompt:

echo "Summarize what a reverse proxy does in two sentences." | ollama run llama3.2:3b

The model stays resident in memory for a configurable idle timeout (default five minutes), so the next request does not pay the model-load cost.

LM Studio

Open LM Studio and navigate to the Discover tab. Search for the model by name. LM Studio indexes the Hugging Face Hub, so you will see many variants. Select the quantization you want (Q4_K_M is a safe default for a balance of quality and memory), click Download, and wait.

Once downloaded, switch to the Chat tab, select your model from the dropdown, and start chatting. The interface is close to what you would expect from a web-based chatbot.

To run the same model from the command line, load it first in LM Studio, then use curl against the server (covered in the next section).


Using the API

Both tools expose an OpenAI-compatible HTTP server. This is where you will spend most of your time if you are building applications.

Ollama API

Ollama’s server starts automatically with the daemon. Test it immediately:

curl http://localhost:11434/api/generate \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.2:3b", "prompt": "What is a container?", "stream": false}'

OpenAI-compatible chat completions endpoint:

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.2:3b",
    "messages": [{"role": "user", "content": "What is a container?"}]
  }'

List available models:

curl http://localhost:11434/api/tags

The Ollama API does not require an API key. On localhost, requests are accepted without authentication.

LM Studio API

In LM Studio, navigate to the Developer tab and click Start Server. By default, the server runs on port 1234.

The API is intentionally OpenAI-compatible:

curl http://localhost:1234/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.2-3b-instruct",
    "messages": [{"role": "user", "content": "What is a container?"}]
  }'

The model name in the request must match the filename LM Studio has loaded. There is no short alias system like Ollama’s name:tag format, you pass the full model identifier as it appears in the LM Studio UI.

LM Studio also lets you set an API key in the settings for the server, which is useful if you are exposing the port to your local network and want basic protection.


Comparing Both Tools Side by Side

Model Library and Discovery

Ollama maintains its own curated model library at ollama.com/library. Models are identified by clean, consistent names (llama3.2:3b, mistral, qwen2.5:7b). Ollama handles quantization selection automatically or lets you pin a specific tag. The library is smaller but every model is known to work correctly with Ollama.

LM Studio indexes the full Hugging Face Hub. It surfaces far more models and variants, including ones that have not been tested with Ollama. This is a double-edged sword: more choice, but also more chance of pulling a model that does not behave as expected.

Headless and Server Use

Ollama wins outright here. It runs as a systemd service, starts on boot, and requires no graphical environment. It is purpose-built for server deployment. You can manage it entirely over SSH and integrate it into your infrastructure the same way you would any other microservice.

LM Studio requires a display to start the GUI. The CLI mode (lms) helps, but the server lifecycle is still tied to the LM Studio application process. On a headless server, Ollama is the only realistic choice.

Resource Usage

Both tools use llama.cpp under the hood, so inference performance on the same hardware with the same model and quantization is very similar. The difference is in overhead.

The Ollama daemon at idle uses about 50–100 MB of RAM with no models loaded. LM Studio at idle uses roughly 300–500 MB because it runs an Electron-based GUI.

For a dedicated inference server, Ollama’s lower baseline overhead matters. On a developer laptop where you already have tens of applications open, the difference is insignificant.

API Compatibility

Both expose POST /v1/chat/completions, POST /v1/completions, and GET /v1/models in OpenAI-compatible format. Tools like Open WebUI, Continue (VS Code extension), and LangChain work with both by changing the base URL.

The behavioral difference is that Ollama can be told which model to use per-request by name, whereas LM Studio requires you to pre-load a model in the GUI before requests to it will succeed. For multi-model applications that switch between models dynamically, Ollama is more ergonomic.

Security and Network Exposure

By default:

  • Ollama binds to 127.0.0.1:11434, localhost only, no authentication
  • LM Studio binds to 0.0.0.0:1234, all interfaces, with optional API key

Ollama’s default is more conservative. If you want to expose Ollama to your local network or put it behind an Nginx reverse proxy, you control that explicitly by changing OLLAMA_HOST in the systemd service and adding your own auth layer in Nginx. See the Nginx rate limiting tutorial for tips on protecting an API endpoint.

LM Studio’s default of binding to all interfaces is more convenient for quick sharing on a local network but requires more care to avoid unintended exposure.

Ease of Getting Started

LM Studio wins for new users. The GUI makes model discovery, download, chat, and server management approachable without reading any documentation. If someone has never interacted with a local LLM before, LM Studio gets them to a working chat session fastest.

Ollama has a steeper learning curve for non-developers but a much gentler one for anyone comfortable in a terminal. The model management CLI is clean and scriptable, and the documentation is excellent.


Practical Decision Guide

Use Ollama when:

  • You are deploying on a headless server or VPS
  • You want the service to start automatically on boot and run in the background
  • You are building an application that needs a reliable, scriptable API
  • You want to manage everything over SSH
  • You need fine-grained control over which model serves which request

Use LM Studio when:

  • You are on a desktop machine and want a polished chat UI
  • You want to experiment with many models quickly without writing any code
  • You want to explore models from the full Hugging Face Hub, not just the Ollama library
  • You are sharing a local inference endpoint with a teammate and want a quick GUI to manage it

Use both when:

  • You use LM Studio on your laptop for experimentation and model evaluation
  • You deploy Ollama on your server for your team’s shared internal API

This is a common pattern in practice. LM Studio for exploration, Ollama for production. They do not conflict.


Common Mistakes and Troubleshooting

Ollama shows GPU layers = 0 even though you have a GPU

Ollama detects the GPU at install time. If you installed the NVIDIA driver after installing Ollama, re-run the install script:

curl -fsSL https://ollama.com/install.sh | sh

Verify GPU detection with:

nvidia-smi
ollama ps

LM Studio server stops when I close the window

The server is tied to the LM Studio process. Use the lms CLI to start the server in a way that survives GUI close, or keep LM Studio minimized. For persistent server use, switch to Ollama.

Both tools are slow on CPU

CPU-only inference is slow. A 7B model on a modern CPU generates about 5–10 tokens per second. This is usable for non-interactive tasks but poor for interactive chat. Adding a GPU dramatically changes this. Even a consumer NVIDIA RTX GPU with 8 GB of VRAM pushes 40–80 tokens per second on a 7B model.

Port conflict between Ollama and LM Studio

Ollama uses port 11434 and LM Studio uses 1234 by default, so they do not conflict. If you have changed either default, check with:

ss -tlnp | grep -E '11434|1234'

Model name mismatch when using LM Studio API

LM Studio uses the full Hugging Face model filename as the model identifier. If your request sends "model": "llama3" but LM Studio loaded meta-llama/Llama-3.2-3B-Instruct, the request will return an error. Check the exact model name shown in the LM Studio UI and use that string in your API calls.


Best Practices

Do not expose either API directly to the internet without authentication. Both tools are designed for local or internal network use. If you need to make the API reachable externally, put it behind an Nginx reverse proxy with TLS and HTTP Basic Auth or an API key header check.

Pin model versions in your application. Both tools support tagged model versions. If you upgrade a model and behavior changes, having the version pinned in your config lets you roll back quickly.

Start with smaller models and scale up. A 3B parameter model runs on nearly any modern machine and is sufficient for many structured tasks like classification, extraction, and template filling. Only move to 7B+ when you have profiled what quality level you actually need.

Use the OpenAI-compatible endpoint (/v1/chat/completions) rather than tool-specific endpoints in your application code. This keeps your code portable between Ollama, LM Studio, and any cloud provider.


Conclusion

Ollama and LM Studio are complementary rather than competing. Ollama is the right choice for server deployments, CI pipelines, internal APIs, and any workflow that requires automation, reliability, and headless operation. LM Studio is the right choice for desktop experimentation, model evaluation, and getting non-technical colleagues into the local AI workflow quickly.

If you are running Ubuntu on a server and you need a persistent local inference endpoint, install Ollama. If you are on a desktop machine and want to explore what open models can do without any configuration overhead, install LM Studio.

From here, the logical next step is exposing your Ollama endpoint to your team behind a reverse proxy, or connecting it to a frontend like Open WebUI to give your colleagues a chat interface backed by your own infrastructure.