How to Set Up LM Studio and Ollama for Local AI in 2026
How to Set Up LM Studio and Ollama for Local AI in 2026
Running large language models on your own hardware has gone from a niche experiment to a legitimate production strategy. Whether you want to eliminate per-token API costs, keep sensitive data off third-party servers, or just experiment with open-weight models, two tools dominate the local AI runner space: Ollama and LM Studio.
This guide walks you through setting up both, compares their strengths, and helps you decide which fits your workflow.
Why Run AI Models Locally?
Before diving into setup, here is why local inference matters:
- Zero marginal cost -- once your hardware is provisioned, every query is free
- Complete data privacy -- prompts and outputs never leave your network
- No rate limits -- run as many requests as your hardware can handle
- Offline capability -- works without internet after the initial model download
The tradeoff is hardware investment. Most capable models need at least 8GB of RAM, and larger models benefit from a dedicated GPU.
Setting Up Ollama
Ollama is the most popular open-source AI runner with over 60,000 GitHub stars. It takes a CLI-first approach: one command to install, one command to run any model.
Installation
macOS / Linux:
curl -fsSL https://ollama.com/install.sh | shDocker (recommended for servers):
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamaWindows: Download the installer from ollama.com.
Running Your First Model
ollama run llama3.2That is it. Ollama downloads the model, quantizes it for your hardware, and starts an interactive chat. Want a different model? Just swap the name:
ollama run deepseek-r1:8b
ollama run mistral
ollama run gemma2:9bUsing the API
Ollama exposes an OpenAI-compatible API on port 11434:
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.2",
"messages": [{"role": "user", "content": "Explain Docker in one paragraph"}]
}'This means any application built for the OpenAI API can switch to Ollama by changing the base URL. No code rewrite needed.
Setting Up LM Studio
LM Studio takes a different approach -- it provides a polished desktop GUI for downloading, managing, and chatting with models. It is free for personal use but is not open source.
Installation
Download the installer from lmstudio.ai for macOS, Windows, or Linux. The app handles everything through a visual interface.
Key Features
- Model discovery -- browse and download models from Hugging Face directly in the app
- Chat interface -- a ChatGPT-like UI for interacting with models
- Local server mode -- exposes an OpenAI-compatible API (same as Ollama)
- Hardware profiling -- automatically selects the best quantization for your system
Ollama vs LM Studio: Which Should You Choose?
| Feature | Ollama | LM Studio |
|---|---|---|
| Interface | CLI + API | Desktop GUI + API |
| Open Source | Yes (MIT) | No (free for personal use) |
| Model Library | 100+ models | Hugging Face catalog |
| Docker Support | Official image | No |
| Server Deployment | Excellent | Desktop only |
| GPU Support | NVIDIA, AMD, Apple Silicon | NVIDIA, Apple Silicon |
| Resource Usage | Lightweight | Heavier (Electron app) |
Choose Ollama if you want a lightweight, scriptable tool for servers or development. It is the better choice for production deployments, CI/CD pipelines, and headless servers.
Choose LM Studio if you prefer a visual interface for exploring models and want a plug-and-play experience on your desktop.
Adding a Chat UI with Open WebUI
Ollama's CLI is powerful, but for a browser-based chat experience, pair it with Open WebUI:
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
--name open-webui \
ghcr.io/open-webui/open-webui:mainOpen WebUI gives you a ChatGPT-like interface with multi-model chat, conversation history, RAG document upload, and user management -- all running on your infrastructure.
Hardware Recommendations
| Model Size | RAM Required | GPU VRAM | Example Models |
|---|---|---|---|
| 3B-7B | 8GB+ | 4-6GB | Llama 3.2 3B, Gemma 2 9B |
| 13B-14B | 16GB+ | 8-10GB | Llama 3.2, DeepSeek-R1 14B |
| 30B-70B | 32GB+ | 24-48GB | Llama 3.1 70B, Qwen 72B |
| 100B+ | 64GB+ | 80GB+ | DeepSeek-V3 671B (MoE) |
For most use cases, a 7B-14B model running on a machine with 16GB RAM delivers excellent results for coding assistance, writing, and general Q&A.
Next Steps
- Start with Ollama and a small model like
llama3.2to verify your setup - Try Open WebUI or Jan for a graphical interface
- Experiment with specialized models: DeepSeek-R1 for reasoning, CodeLlama for coding
- Consider self-hosting on a VPS for always-on access from any device
The local AI ecosystem is mature enough that there is no reason to send every prompt to a cloud API. Start local, and scale from there.