Ollama
An open-source tool that runs open-weight LLMs locally with one command and serves them through OpenAI- and Anthropic-compatible APIs, plus paid cloud models.
Ollama is an MIT-licensed runtime for open-weight LLMs. ollama run gemma4 downloads a model and starts a chat with no account, and a local server on port 11434 speaks the Ollama, OpenAI and Anthropic API formats. Local use is free. Ollama Cloud runs larger models on Ollama's servers, pay per token or on Pro and Max plans with monthly usage credits.
Ollama is an open-source runtime for running open-weight LLMs on your own machine. Install it, run ollama run gemma4, and a model is answering prompts locally with no API key and no account. It downloads models from its own library, keeps a local server running on port 11434, and exposes that server in three API formats: Ollama's own, OpenAI's and Anthropic's.
It is aimed at developers who want a model for local development, prototyping, privacy-sensitive work or offline use, and increasingly at people who want to point a coding agent at an open model. The company also sells Ollama Cloud, which runs larger models on Ollama's hardware through the same CLI and API.
Highlights
- One-command run.
ollama run <model>pulls a model and opens a chat;ollama pull,ollama psandollama createmanage the local library. Model names are short tags such asgemma4:e2borqwen3.5:9b. - Three API formats on localhost.
/api/chatis the native API;/v1/chat/completionsand/v1/responsesfollow OpenAI's;/v1/messagesfollows Anthropic's. The OpenAI-compatible routes support vision and tool calling. The Responses route is stateless, soprevious_response_idis not supported. - Agent launcher.
ollama launch claude,ollama launch codexandollama launch opencodestart a coding agent wired to an Ollama model, and the macOS app can connect Claude Desktop and ChatGPT Desktop. - Modelfile. A
Modelfilesets a base model withFROM, parameters such asnum_ctxandtemperature, and aSYSTEMprompt. It also imports your own GGUF file or a directory of Safetensors weights. - Broad GPU support. NVIDIA cards with compute capability 5.0 or higher and driver 550 or newer, AMD Radeon through ROCm, Apple GPUs through Metal, and additional Windows and Linux GPUs through Vulkan. Without a supported GPU it runs on the CPU.
- Ollama Cloud. Cloud models run from the same app, CLI and API, or directly at
https://ollama.com/apiwith an API key and no local install. Cloud models do not support structured outputs as of November 2026.
In an AI-assisted workflow
# macOS / Linux (Windows PowerShell: irm https://ollama.com/install.ps1 | iex)
curl -fsSL https://ollama.com/install.sh | sh
ollama run gemma4:e2b # pull + chat in the terminal
# call it like OpenAI from any client or script
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemma4:e2b",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'Existing OpenAI SDK code works by setting the base URL to http://localhost:11434/v1.
Sizing is the part that decides whether local works for you:
| Gemma 4 tag | Download size listed by Ollama | Context window |
|---|---|---|
gemma4:e2b | 4.6 to 7.5 GB | 128K |
gemma4:12b | 7.7 to 8.0 GB | 256K |
gemma4:26b | 16 to 19 GB | 256K |
gemma4:31b | 19 to 20 GB | 256K |
The model has to fit in memory with room for the context, and a model that spills from VRAM to CPU slows down sharply. ollama ps shows the split in its PROCESSOR column; aim for 100% GPU.
TIP
The default context is small on most machines: 4k tokens below 24 GiB of VRAM and 32k from 24 to 48 GiB. Ollama's docs say agents, coding tools and web search need at least 64,000 tokens, so raise it in the app's settings or with OLLAMA_CONTEXT_LENGTH=64000 ollama serve before blaming the model for forgetting things.
Pricing
Local use is free. Ollama Cloud prices, as of November 2026 from ollama.com/pricing:
- Pay as you go: $0 subscription. Pay per token for cloud models, with 3 concurrent requests.
- Pro: $20 a month (or $200 a year), including $60 of usage credits a month and access to larger models.
- Max: $100 a month, including $300 of usage credits, 10 concurrent requests and early access to new models.
- Team: $500 a month, in early access as of November 2026, with unlimited users and $1,000 of shared credits. Enterprise is custom.
Per-token rates vary by model and some models have cheaper off-peak rates, so check the pricing page's model table for the one you plan to use.
Good to know
- Single-machine by design. Requests beyond what memory allows are queued (512 by default), and on most backends each model handles one request at a time unless you set
OLLAMA_NUM_PARALLEL. Parallel requests multiply context memory. - Local means local only if you keep it that way. Cloud models and web search go through ollama.com.
OLLAMA_NO_CLOUD=1turns those features off. - Version. v0.40.18 is the latest release as of November 2026; the project has about 188,000 GitHub stars.
- Old tutorials. Many guides still use
llama3orllama3.1, which remain in the library but date from 2024. Pick a current family such as Gemma 4 or Qwen 3.5 unless you need to reproduce older results.
Against the alternatives: LM Studio is the GUI-first option (Ollama vs LM Studio). llama.cpp gives you the engine directly, with every flag and backend exposed and no model library. vLLM is the tool for serving one model to many concurrent users on GPUs (vLLM vs Ollama). To decide whether to self-host at all, read Self-Host vs API.
Frequently asked questions
- Is Ollama free?
- Running models on your own machine is free and open source under the MIT license, with no account. Ollama Cloud is the paid part: as of November 2026 the pay-as-you-go tier has no subscription and bills cloud models per token, Pro is $20 a month with $60 of usage credits, Max is $100 a month with $300 of credits, and Team, in early access, is $500 a month with $1,000 of shared credits.
- How much RAM or VRAM do I need for Ollama?
- Enough to hold the model file plus its context. Ollama's library lists a size for each tag: for Gemma 4, about 4.6 to 7.5 GB for e2b, 7.7 to 8.0 GB for 12b and 19 to 20 GB for 31b. Ollama also sets the default context from your VRAM: 4k tokens under 24 GiB, 32k from 24 to 48 GiB, and 256k at 48 GiB or more. Run ollama ps to see whether a loaded model is fully on the GPU.
- Does Ollama send my prompts to its servers?
- Not for local models: Ollama's FAQ says it does not see your prompts or data when you run locally. Cloud models are processed on Ollama's servers under what its docs call a zero data retention policy, without storing, logging or training on the content. To rule cloud use out entirely, set OLLAMA_NO_CLOUD=1 or disable_ollama_cloud in ~/.ollama/server.json.
- Ollama vs LM Studio?
- Both run open models locally. Ollama is a background service with a CLI and API first, which suits scripts, coding agents and apps that call localhost; it also has a desktop app. LM Studio is a GUI for browsing, downloading and tuning models visually. Neither is built for high-concurrency production serving; use a dedicated engine such as vLLM for that.
Filed under
local-llm · cli · inference · open-source
Related
- ToolLM StudioA free desktop app for downloading and running open-weight LLMs locally on llama.cpp or MLX, with an OpenAI-compatible server, SDKs and a headless daemon.
- ToolvLLMA high-throughput, memory-efficient inference and serving engine for LLMs, with PagedAttention, continuous batching, and an OpenAI-compatible API server.
- GuideSelf-Host vs API: When Does Running Your Own LLM Actually Pay Off?The real economics of self-hosting an LLM vs. calling a hosted API — GPU utilization, privacy, latency, and the hidden ops costs that decide the crossover.
- AgentLLM Inference EngineerUse this agent to serve and optimize self-hosted LLM inference — sizing GPUs, configuring a serving engine like vLLM (continuous batching, PagedAttention, tensor parallelism), applying quantization, and tuning throughput and tail latency against a cost and p95 budget. Examples — "serve Llama-3-70B at p95 under 2s on our GPUs", "our self-hosted model is slow and the GPUs sit half-idle — raise throughput", "quantize this model to fit one GPU without wrecking quality".
- Toolllama.cppThe MIT-licensed C/C++ engine behind most local LLM tools: GGUF models, backends for nearly every GPU and CPU, and an OpenAI-compatible server in one binary.
- GuideBest Open-Source LLMs in 2026: The Open-Weight Families ComparedThe open-weight LLM families current in November 2026, from DeepSeek, Mistral Large 4, and Qwen to Gemma 4 and Muse, with sizes, context, and exact licences.
- GuideBest Tools for Running LLMs Locally in 2026The local LLM stack ranked by job — Ollama, LM Studio, Jan, llama.cpp, vLLM, and LiteLLM — with a verdict each and the line where local inference stops paying.
- TermGGUFGGUF is the single-file binary model format used by llama.cpp and other GGML-based runtimes, storing quantized tensors plus typed metadata in one file.