Local model runner
Ollama Review 2026: Run Local LLMs with One Command
Ollama is an open-source tool that makes running open-weight LLMs on local hardware as simple as a single terminal command. It handles GPU backend selection (NVIDIA CUDA, Apple Metal, AMD ROCm), model format conversion, and local API serving automatically — exposing an OpenAI-compatible REST API on localhost:11434 that any tool built for OpenAI's chat completions format can use without code changes. Ollama's model library covers hundreds of models; pulling one works like Docker: one command downloads, checksums, and registers the quantized weights. It is the de-facto standard for local model serving in the open-source AI ecosystem.
Open-source CLI · OpenAI-compatible local API · CUDA · Apple Metal · ROCm · macOS · Windows · Linux
Quick Verdict
Use Ollama when you want local models available as an OpenAI-compatible API with zero configuration overhead. It is the fastest path from zero to a working local model API for any tool that speaks OpenAI's chat completions format.
Skip Ollama if: You need a graphical chat interface (pair with Open WebUI, or use LM Studio instead), production-scale multi-user serving with guaranteed throughput (use vLLM or TGI), or a model format outside GGUF/safetensors.
Start here: ollama run qwen3:8b — Ollama downloads and runs the model in one step. Hit the API at localhost:11434 immediately after.
Why Ollama is the default local model runtime
Ollama solves the three hardest problems in local LLM setup: GPU backend detection, model weight management, and API compatibility. Before Ollama, getting a model running locally required manually choosing a runtime, converting model weights to the right format, configuring GPU layer counts, and wiring up a server. Ollama collapses all of this into a single command that works on NVIDIA, AMD, and Apple Silicon hardware without any manual configuration. Its OpenAI-compatible API means every tool built for GPT-4 works against a locally running Qwen3 or Llama 3.1 without code changes.
OpenSourcesAI verdict
Ollama is the recommended default local model runtime for developers. It has earned that position through consistent execution on the things that matter most: it installs in one command, manages model downloads and storage automatically, selects the right GPU backend without configuration, and exposes a clean OpenAI-compatible API. The ecosystem built around it — Open WebUI, Continue, Aider, and dozens of other tools — all treat Ollama's localhost:11434 as the default local inference endpoint.
Its one real gap is the absence of a built-in chat interface. That is intentional — Ollama is infrastructure, not an application. Pair it with Open WebUI for a browser-based chat frontend, or use it headlessly as a backend for any OpenAI-compatible client. For users who want an all-in-one desktop experience with a built-in model browser and chat interface, LM Studio covers that use case.
How Ollama works
Ollama runs as a local server process (daemon) that manages model weights and handles inference requests. When you run ollama run qwen3:8b, it:
- Pulls the quantized model weights from the Ollama model library (or a custom registry) if not already downloaded.
- Detects your GPU backend — NVIDIA CUDA, Apple Metal (unified memory), or AMD ROCm — and falls back to CPU if no GPU is available.
- Automatically determines how many model layers to load onto GPU vs RAM based on your VRAM and system memory.
- Starts a local inference server exposing an OpenAI-compatible REST API on localhost:11434.
- Keeps the model loaded in memory between requests to minimize re-load latency (configurable via OLLAMA_KEEP_ALIVE).
Model weights are stored locally in a managed directory (default: ~/.ollama/models on Linux/macOS). Ollama uses the GGUF format for quantized models and handles format conversion transparently — you work with model names, not files.
Essential commands
Pull and run a model (downloads if needed)
ollama run qwen3:8bPull a model without running it
ollama pull llama3.1:8bList downloaded models
ollama listShow running models and VRAM usage
ollama psRemove a model
ollama rm qwen3:8bServe the API server (starts automatically with run/pull)
ollama serveQuery the API directly (OpenAI-compatible)
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"qwen3:8b","messages":[{"role":"user","content":"Hello"}]}'Modelfile: custom model configuration and system prompt injection
A Modelfile is a declarative configuration file — analogous to a Dockerfile — that defines a named Ollama model variant. It lets you bake a custom system prompt, temperature preset, context length, and base model into a single reusable model name.
Example Modelfile
FROM qwen3:8b
SYSTEM """
You are a senior Python engineer. Answer only with working code.
Do not add explanations unless explicitly asked.
"""
PARAMETER temperature 0.2
PARAMETER top_p 0.85
PARAMETER num_ctx 16384Create the model from the Modelfile
ollama create python-engineer -f ./ModelfileRun the custom model
ollama run python-engineerSupported Modelfile directives:
- FROM — base model (Ollama library tag, or absolute path to a GGUF file for importing custom weights).
- SYSTEM — static system prompt injected before every conversation. Overrides the base model's default system prompt.
- PARAMETER temperature — inference temperature (0.0–2.0). Lower values produce more deterministic, focused outputs.
- PARAMETER num_ctx — context window in tokens. Must not exceed the model's training maximum. Larger values use more VRAM.
- PARAMETER top_p, top_k — nucleus sampling and top-k filter thresholds.
- PARAMETER repeat_penalty — penalizes token repetition. Values above 1.0 reduce looping in long generations.
- TEMPLATE — override the default prompt template (chat markup format) for models with non-standard tokenizer chat templates.
- LICENSE — embed a license string into the model metadata.
Importing a GGUF file not in the Ollama library: set FROM /absolute/path/to/model.gguf in the Modelfile, then run ollama create my-model -f ./Modelfile. The weight file is not copied — Ollama registers a reference to its path.
OLLAMA_HOST: remote server configuration and cross-network access
By default, Ollama binds to 127.0.0.1:11434 — accessible only from the local machine. Setting OLLAMA_HOST expands or restricts this binding:
Expose on all interfaces (LAN access — no auth by default)
OLLAMA_HOST=0.0.0.0:11434 ollama serveBind to a specific NIC / IP
OLLAMA_HOST=192.168.1.50:11434 ollama serveCustom port on localhost only
OLLAMA_HOST=127.0.0.1:8080 ollama serveOn Linux with systemd, persist environment variables in the service unit file rather than setting them per-session:
Edit the systemd service override
sudo systemctl edit ollamaService override content
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_NUM_PARALLEL=4"
Environment="OLLAMA_KEEP_ALIVE=10m"Reload and restart
sudo systemctl daemon-reload
sudo systemctl restart ollamaSecurity note: Binding to 0.0.0.0 exposes Ollama to all devices on the network with no authentication. Firewall rules or a reverse proxy with auth (nginx, Caddy) are required before exposing Ollama beyond a trusted LAN.
Running Ollama as a system service
The Ollama installer on macOS and Linux registers Ollama as a background service automatically. These are the key commands for managing the service and making it persistent across reboots:
- macOS (launchd): Ollama installs as a launch agent and starts automatically on login. Stop it with: launchctl unload ~/Library/LaunchAgents/com.ollama.ollama.plist
- Linux (systemd): sudo systemctl enable --now ollama — enables and starts the service. sudo systemctl status ollama shows health and recent logs.
- Linux logs: journalctl -u ollama -f streams the live log output including model load events, VRAM allocation, and request logs.
- Custom model storage: set OLLAMA_MODELS in the systemd service override to point to a faster NVMe drive or larger partition.
- Run as a dedicated system user: for production Linux deployments, create a dedicated ollama user with: sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
Multi-user configuration and concurrency
Ollama handles concurrent inference requests but requires explicit configuration for multi-user deployments. Default behavior processes one request at a time — additional requests queue up to OLLAMA_MAX_QUEUE (default: 512).
- OLLAMA_NUM_PARALLEL — number of concurrent inference requests processed simultaneously. Each parallel slot uses additional VRAM proportional to the KV cache size. Start at 2–4 on a 24GB card; test OOM behavior before increasing.
- OLLAMA_MAX_LOADED_MODELS — maximum models kept warm in VRAM simultaneously. Useful when multiple users request different models to avoid constant reload latency.
- OLLAMA_KEEP_ALIVE — how long an idle model stays loaded (default: 5m). Set to 10m–30m in multi-user environments to absorb request gaps without unloading.
- OLLAMA_MAX_QUEUE — maximum pending request queue depth before Ollama returns 503. Default is 512. Tune down in memory-constrained environments.
- KV cache and VRAM math: at num_ctx=8192, Qwen3 8B Q4_K_M uses ~1.2 GB for the KV cache per parallel slot. Four parallel slots at 8K context = ~4.8 GB KV cache on top of model weight VRAM.
Multi-user service override example (24GB GPU)
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_NUM_PARALLEL=4"
Environment="OLLAMA_MAX_LOADED_MODELS=2"
Environment="OLLAMA_KEEP_ALIVE=15m"
Environment="OLLAMA_FLASH_ATTENTION=1"Performance optimization flags
Default Ollama settings are conservative and safe across hardware. These flags unlock hardware-specific performance gains:
- OLLAMA_FLASH_ATTENTION=1 — enables flash attention (FA2) where hardware supports it. Reduces VRAM usage for long contexts by ~30–50% on Ampere and newer NVIDIA GPUs and Apple Silicon M2+. Requires OLLAMA_KV_CACHE_TYPE to be unset or set to f16.
- OLLAMA_KV_CACHE_TYPE=q8_0 — quantizes the KV cache to Q8_0 instead of FP16. Cuts VRAM for the KV cache in half with minor quality impact on long-context tasks. Combine with OLLAMA_FLASH_ATTENTION=1.
- OLLAMA_GPU_OVERHEAD — reserve VRAM bytes to prevent OOM on shared-GPU systems (e.g., a display using the same GPU). Set to 512000000 (512 MB) if Ollama OOMs while the GPU is also driving a display.
- Apple Silicon: Ollama uses Metal automatically. The unified memory advantage means higher num_ctx values are viable — 32K–128K context on an M2 Max 96GB does not fragment VRAM the way discrete GPUs do.
- Linux workstation arrays: for multiple GPUs in the same system (without tensor parallelism), Ollama can be pinned to a specific GPU with CUDA_VISIBLE_DEVICES=0 or CUDA_VISIBLE_DEVICES=1. Each Ollama instance can serve a different model on a different card.
- Bandwidth vs VRAM tradeoff: a quantization one step higher (Q8_0 vs Q4_K_M) doubles token quality but uses ~2× more VRAM. RTX 4090 bandwidth advantage (1008 GB/s vs ~504 GB/s on RTX 3090) makes Q8_0 practical at the same token speed.
Key environment variables
- OLLAMA_HOST — bind address and port (default: 127.0.0.1:11434). Set to 0.0.0.0:11434 to expose on the local network.
- OLLAMA_MODELS — custom path to store downloaded model weights (default: ~/.ollama/models).
- OLLAMA_NUM_PARALLEL — maximum concurrent inference requests (default: 1). Increase for multi-user setups.
- OLLAMA_MAX_LOADED_MODELS — maximum models to keep loaded in memory simultaneously.
- OLLAMA_FLASH_ATTENTION — set to 1 to enable flash attention, reducing VRAM usage on supported hardware.
- OLLAMA_KEEP_ALIVE — how long to keep a model in VRAM after the last request (default: 5m). Set to 0 to unload immediately, -1 to keep indefinitely.
- OLLAMA_GPU_OVERHEAD — reserve VRAM headroom (bytes) to prevent OOM on shared-GPU systems.
Platform and GPU support
- macOS (Apple Silicon): M1 / M2 / M3 / M4 — Metal backend, unified memory. Larger models fit than equivalent discrete VRAM.
- macOS (Intel): CPU inference only — no Metal GPU acceleration on Intel Macs.
- Windows: NVIDIA CUDA (Ampere and newer recommended), CPU fallback. AMD ROCm on Windows is experimental.
- Linux: NVIDIA CUDA (full support), AMD ROCm (GFX9 / RDNA2+), CPU fallback, Docker container available.
- Docker: official image at ollama/ollama — supports NVIDIA GPU passthrough with --gpus all flag.
- Minimum RAM: 8 GB for 3–4B models at Q4_K_M. 16 GB recommended for 7–8B models. 32 GB+ for 13B+ models.
Who Ollama is for
Ollama is a strong fit for:
- Developers who want a local OpenAI-compatible API for tools like Continue, Aider, Open WebUI, or custom scripts.
- Engineers running local inference for development and testing without cloud API costs or latency.
- Teams deploying local AI on Apple Silicon hardware — Ollama's Metal backend handles unified memory automatically.
- Self-hosters who want to run Ollama as a background service on a dedicated local machine.
- Anyone using the OpenSourcesAI compatibility checker — Ollama is the recommended runtime for most local hardware results.
- Docker users — Ollama has an official image for containerized local inference with GPU passthrough.
Ollama is a weaker fit for:
- Users who want a graphical chat interface — Ollama is CLI/API only. Pair with Open WebUI or use LM Studio instead.
- Production-scale inference serving with guaranteed throughput or SLAs — use vLLM or TGI for that use case.
- Teams who need to serve PyTorch or safetensors models without converting to GGUF format.
- Workflows requiring fine-tuning — Ollama only handles inference, not training or fine-tuning.
- Multi-model multi-GPU tensor parallelism — Ollama does not support splitting a single model across multiple GPUs.
Core use cases
- Local development backend: replace OpenAI API calls in dev/test environments with a local Ollama instance — same API format, no API costs, no rate limits.
- AI coding assistant: connect Continue (VS Code/JetBrains), Aider, or Cursor to Ollama as a local model backend for privacy-first coding assistance.
- Browser-based chat (with Open WebUI): run Open WebUI in Docker pointing at localhost:11434 for a self-hosted ChatGPT-style interface.
- RAG pipeline backend: use Ollama's embedding models and chat completions as the inference layer in a local LlamaIndex, LangChain, or Haystack RAG stack.
- Model testing: quickly pull and compare different quantizations of the same model to assess quality vs speed tradeoffs on your hardware.
- Privacy-sensitive inference: run models for document processing, code review, or personal data tasks entirely offline without any data leaving the machine.
- Homelab / edge serving: run Ollama as a system service on a dedicated local machine and access it from other devices on the LAN.
Fit matrix
| Need | Ollama fit |
|---|---|
| OpenAI-compatible local API | Strong |
| One-command model install and run | Strong |
| NVIDIA CUDA support | Strong |
| Apple Silicon (Metal) support | Strong |
| AMD ROCm support | Good (Linux; Windows experimental) |
| Built-in chat UI | Poor (use Open WebUI) |
| Model browser / discovery UI | Poor (CLI only) |
| Production-scale multi-user serving | Weak (use vLLM or TGI) |
| Fine-tuning or training | None |
| Multi-GPU tensor parallelism | None |
Ollama model library
The Ollama model library at ollama.com/library hosts hundreds of quantized models tagged by size and quantization level. Pull syntax follows Docker conventions:
Default quantization (usually Q4_K_M)
ollama pull qwen3:8bSpecific quantization
ollama pull qwen3:8b-q8_0Embedding model
ollama pull nomic-embed-textModels are cached locally after the first pull. Use ollama list to see downloaded models and their disk size. Use the compatibility checker to confirm which quantization level fits your VRAM before pulling a large model.
Connecting Ollama to other tools
- Open WebUI — self-hosted browser chat frontend. Points to localhost:11434 by default. Run with Docker: docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data ghcr.io/open-webui/open-webui:main
- Continue (VS Code / JetBrains) — AI coding assistant. Add Ollama as a provider in continue.dev config with baseUrl: http://localhost:11434.
- Aider — AI coding assistant that runs in the terminal. Use --model ollama/qwen3:8b and set OPENAI_API_BASE=http://localhost:11434.
- LangChain / LlamaIndex — use the Ollama integration class or point the OpenAI provider at localhost:11434 with any model name.
- Anything that accepts an OpenAI base URL — set base URL to http://localhost:11434/v1 and model to any Ollama model name.
Tradeoffs
- No built-in chat UI — Ollama is a CLI and API server. Requires Open WebUI or another frontend for a graphical chat experience.
- Single-GPU inference only — Ollama cannot split a model across multiple GPUs for tensor parallelism.
- Not designed for high-concurrency production serving — OLLAMA_NUM_PARALLEL helps but vLLM or TGI are better for multi-user throughput.
- Windows GPU performance can trail Linux for equivalent CUDA hardware due to driver-layer overhead.
- AMD ROCm support on Windows is experimental — Linux is required for reliable AMD GPU inference.
- No native fine-tuning or training — inference only.
- Model must be available in GGUF format (or converted) — PyTorch checkpoint direct loading is not supported.
Alternatives
- LM Studio may be better if you want a graphical model browser, built-in chat UI, and an all-in-one desktop experience without CLI.
- Jan may be better if you want a fully open-source desktop app equivalent to LM Studio for auditable, privacy-sensitive environments.
- llama.cpp may be better if you need direct control over inference parameters, quantization formats, or want to build a custom serving layer.
- vLLM may be better for production-scale multi-user inference serving with PagedAttention, continuous batching, and throughput optimization.
- Text Generation Inference (TGI) may be better for production-serving transformer models with streaming, batching, and quantization support.
- LM Studio server mode may be better if you want Ollama-equivalent API serving with a GUI model management layer on top.
Deciding between the top two? The Ollama vs LM Studio comparison puts them side by side on measured speed, APIs, model formats, and automation so you can pick the right starting point.
First-Run Integration Checklist
- Install Ollama from ollama.com — installs and registers as a background service on macOS (launchd) and Linux (systemd); installer on Windows.
- Run nvidia-smi (NVIDIA) or system_profiler SPDisplaysDataType (macOS) to confirm GPU visibility before pulling a model.
- Pull a small model first (qwen3:4b or phi3:mini) to verify GPU layer allocation before attempting larger models.
- Run ollama ps immediately after — confirm GPU layers are loaded, not CPU-only inference fallback.
- Use the compatibility checker to confirm which quantization fits your VRAM before pulling a 7B+ model.
- Verify the API is live: curl http://localhost:11434/api/tags — should return a JSON list of installed models.
- Connect your first tool: set base URL to http://localhost:11434/v1 and api_key to any non-empty string in Continue, Aider, or any OpenAI-compatible client.
- Set OLLAMA_KEEP_ALIVE=-1 for persistent development environments — model stays loaded indefinitely, eliminating cold-start latency.
- Install Open WebUI for a chat interface: docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway ghcr.io/open-webui/open-webui:main
- Create a Modelfile for any model you use daily with a custom system prompt — saves re-entering context on every session.
Secure Production Deployment Checklist
- Never expose OLLAMA_HOST=0.0.0.0 on a public IP without a reverse proxy with authentication — Ollama has no built-in auth.
- Add firewall rules to restrict port 11434 to known IP ranges: ufw allow from 192.168.1.0/24 to any port 11434
- Place Ollama behind nginx or Caddy with basic auth or mTLS if serving across an untrusted network segment.
- Set OLLAMA_ORIGINS to restrict CORS to known browser origins if serving browser-based clients.
- Run Ollama as a dedicated non-root system user on Linux: sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
- Set OLLAMA_GPU_OVERHEAD to reserve 512 MB+ VRAM headroom on shared-display GPUs: Environment="OLLAMA_GPU_OVERHEAD=536870912"
- Monitor VRAM usage with ollama ps on a schedule — unexpected model accumulation signals KEEP_ALIVE misconfiguration.
- Set OLLAMA_KEEP_ALIVE=0 on shared servers when multiple users request different models — prevents VRAM fragmentation from multiple warm models.
- Validate GPU layer count in logs on each service start: journalctl -u ollama --since "5 minutes ago" | grep layers
- Pin Ollama to a specific GPU on multi-GPU workstations: Environment="CUDA_VISIBLE_DEVICES=0" in the systemd service override.
FAQ
What is Ollama best for?
Ollama is best for developers who want local models available as an OpenAI-compatible API with zero configuration overhead. It is the fastest path to a working local inference endpoint for tools like Continue, Aider, Open WebUI, and any custom script built against OpenAI's chat completions format.
Does Ollama work on Apple Silicon?
Yes. Ollama natively supports Apple Silicon (M1–M4) using Apple Metal and unified memory. Because unified memory is shared between CPU and GPU, Apple Silicon Macs can run larger quantizations than equivalent VRAM would suggest on discrete GPUs. Ollama handles Metal backend selection automatically with no configuration required.
How do I use Ollama with a chat interface?
Pair Ollama with Open WebUI — a self-hosted browser-based frontend that connects to Ollama's API on localhost:11434. Run it in Docker with one command. Alternatively, use Continue (VS Code/JetBrains), Aider, or any OpenAI-compatible client. LM Studio is an alternative if you prefer a native desktop app with a built-in chat interface.
Is Ollama suitable for production serving?
Ollama is suitable for local development, personal inference, and small-team API serving. For production-scale inference with guaranteed throughput, autoscaling, or enterprise SLAs, use vLLM or TGI. Ollama can handle moderate concurrent requests via OLLAMA_NUM_PARALLEL but is not designed for high-traffic multi-user serving.
How do environment variables control Ollama's behavior?
Ollama is configured entirely through environment variables — there is no config file. Key variables:OLLAMA_HOST sets the bind address and port;OLLAMA_MODELS changes the model storage directory;OLLAMA_NUM_PARALLEL controls concurrent request slots;OLLAMA_KEEP_ALIVE controls how long models stay loaded. On Linux, set these persistently in the systemd service override withsudo systemctl edit ollama and restart the service.
What are the security risks of exposing Ollama on a private network?
Setting OLLAMA_HOST=0.0.0.0:11434 exposes Ollama to all network interfaces with no authentication by default. Any device on the LAN can send inference requests. Mitigations: restrict access with firewall rules (ufw allow from 192.168.1.0/24 to any port 11434), place Ollama behind a reverse proxy with authentication, and setOLLAMA_ORIGINS to restrict CORS. Never expose Ollama directly on a public IP without authentication.
How do I import a custom model using a Modelfile?
Create a text file named Modelfile with aFROM directive pointing to either an existing Ollama model tag or a local GGUF file path. Add SYSTEM for a custom system prompt and PARAMETER lines for inference settings. Then run:
Create from Modelfile
ollama create my-model -f ./ModelfileRun the custom model
ollama run my-model