Ollama in open-source AI tools: how chat apps run local models in 2026
What Ollama does
Ollama packages three jobs into one program: it downloads models from its library, stores them on disk in a compressed format, and serves them over an HTTP API. You type ollama run llama3.2 or ollama pull qwen3, and a minute later the model is answering questions in your terminal. Behind the scenes it uses the llama.cpp inference engine with GGUF model files, picks your GPU automatically (NVIDIA, AMD, Apple Silicon or Vulkan), and loads and unloads models as requests arrive.
That last point matters for open-source apps. Ollama keeps a model in memory for five minutes after the last request by default, then frees the memory. A chat app with several users can send requests to different models, and Ollama handles the loading without the app needing to know anything about GPUs.
Ollama 0.30, released June 5, 2026, added wider GGUF compatibility through llama.cpp, faster NVIDIA performance of up to 20% by the project's own measure, and Vulkan by default, which helps AMD and Intel GPUs. The October 2026 releases continue on a weekly cadence.
Which directory projects use it
| Project | How it uses Ollama |
|---|---|
| Open WebUI | Started life as "Ollama WebUI" and remains the most common front end for it |
| LibreChat | Adds Ollama as a custom endpoint in its config file |
| LobeChat | Built-in Ollama provider with model list sync |
| AnythingLLM | Ollama as both chat model and embedding model for document chat |
| Jan | Runs its own engine but can connect to an Ollama server |
| GPT4All | Runs models itself; often compared with Ollama for desktop use |
The pattern is the same in each: the app stores users, chats and documents, and Ollama does the model work. Because the API is shared, you can run several of these apps against one Ollama server.
Hardware sizing
Models are usually run in 4-bit quantized form (labelled Q4_K_M in the library), which cuts memory use to roughly 0.6 GB per billion parameters plus overhead for the context window.
| Model size | Example models | Memory needed (4-bit) | Typical hardware |
|---|---|---|---|
| 1 to 4B | Llama 3.2 3B, Gemma 3 4B | 4 to 8 GB | Any recent laptop |
| 7 to 9B | Llama 3.1 8B, Qwen3 8B | 8 to 12 GB | 16 GB laptop, Apple M-series |
| 12 to 14B | Gemma 3 12B, Qwen3 14B | 12 to 16 GB | 32 GB Mac or 16 GB GPU |
| 27 to 32B | Gemma 3 27B, Qwen3 32B | 20 to 24 GB | 24 GB GPU or 48 GB Mac |
| 70B | Llama 3.3 70B | 40 to 48 GB | Two 24 GB GPUs or 64 GB Mac |
Speed depends on memory bandwidth more than raw compute. An Apple M-series Max chip or an RTX 4090 produces tokens several times faster than a laptop CPU. If a model does not fit in GPU memory, Ollama splits it between GPU and system RAM, which works but slows output sharply.
Setting it up for a chat app
- Install Ollama from ollama.com or with
curl -fsSL https://ollama.com/install.sh | shon Linux. - Pull a model:
ollama pull llama3.1:8b. - If the chat app runs in Docker, Ollama on the host is reachable at
http://host.docker.internal:11434on Mac and Windows. On Linux, setOLLAMA_HOST=0.0.0.0so Ollama listens beyond localhost, and use the host's IP address. - In Open WebUI, set
OLLAMA_BASE_URL. In LibreChat, add an endpoint withbaseURL: http://host.docker.internal:11434/v1. In AnythingLLM, pick Ollama in the LLM settings screen. - Pull an embedding model such as
nomic-embed-textif the app will index documents.
The single most common problem is the Docker networking step. If the app reports "connection refused", Ollama is listening only on 127.0.0.1 inside the host, and the container cannot see it.
Settings worth knowing
| Variable | What it changes |
|---|---|
OLLAMA_HOST | Address and port Ollama listens on |
OLLAMA_KEEP_ALIVE | How long a model stays in memory after a request |
OLLAMA_NUM_PARALLEL | How many requests one model serves at once |
OLLAMA_MAX_LOADED_MODELS | How many models can be loaded at the same time |
OLLAMA_CONTEXT_LENGTH | Default context window for models |
OLLAMA_MODELS | Folder where model files are stored |
Context length is a frequent surprise. Ollama's default context window is smaller than many models support, so a long document can be cut off without an error. Raise it in the request, in a Modelfile, or with the environment variable, and expect memory use to grow with it.
Security
Ollama has no built-in authentication. Anyone who can reach port 11434 can run models, pull new ones and delete existing ones. Researchers have found thousands of Ollama servers exposed to the internet. Keep it bound to localhost or a private network, put a reverse proxy with authentication in front if remote access is needed, or use a VPN such as Tailscale. Chat apps like Open WebUI add their own user accounts, but those protect the app, not the Ollama port behind it.
Ollama Cloud
Ollama now offers hosted models through the same API and CLI, useful for models too large for your hardware. Plans as listed on ollama.com in October 2026:
| Plan | Price | Included usage |
|---|---|---|
| Free | $0 | Local use unlimited, limited cloud |
| Pro | $20 a month | $60 of cloud usage |
| Max | $100 a month | $300 of cloud usage |
| Team | $500 a month | $1,000 shared |
Usage beyond the included amount is billed per token at rates that vary by model. For a self-hosted app this gives a fallback: small models on your own GPU, large ones in the cloud, both through one endpoint.
When Ollama is the wrong choice
Ollama is built for a single machine and modest concurrency. If you are serving dozens of simultaneous users or need maximum throughput, a dedicated inference server such as vLLM or SGLang batches requests far more efficiently on data-center GPUs. If you need image generation, speech recognition and text models behind one OpenAI-style API, LocalAI covers more model types. And if you want the best answers rather than privacy, a hosted API such as Anthropic or OpenAI still beats any model that fits on a laptop.
Costs compared with hosted APIs
A local model costs electricity and the hardware you already own. A gaming PC drawing 400 watts for eight hours a day uses about 96 kWh a month, around $15 to $30 depending on local rates. That is cheap for heavy use, but local 8B models answer complex questions less well than current hosted models. Many teams run a small local model for private documents and routine drafting, and send harder tasks to a hosted API through a gateway such as LiteLLM.
Related: Ollama terminal guide, LocalAI stack, Hugging Face stack, Open WebUI, Stack index.
Frequently asked questions
What is Ollama used for in open-source AI apps?
It is the model runtime. Chat interfaces such as Open WebUI and LibreChat handle conversations, users and documents, and send each prompt to Ollama, which loads the model into memory and returns the reply. Separating the two lets you swap either part.
How much memory do I need to run Ollama?
A rough guide for 4-bit quantized models: 8 GB of RAM for 3 to 4 billion parameters, 16 GB for 7 to 8 billion, 32 GB for 14 billion, and 24 GB of GPU memory or 48 to 64 GB of Mac unified memory for 30 to 70 billion. Long context windows add more memory on top.
Is Ollama compatible with the OpenAI API?
Yes. Ollama exposes an OpenAI-compatible endpoint at /v1, so tools written for OpenAI can point at http://localhost:11434/v1 with any placeholder API key. Its native API at /api/chat and /api/generate offers a few extra options such as keep-alive control.
Is Ollama free for commercial use?
The Ollama software is MIT-licensed and free for commercial use. Each model has its own license, though. Llama, Gemma and Qwen models come with their own terms, so check the model card before shipping a product built on one.
Should I use Ollama or LocalAI?
Ollama is easier to install and has the largest model library and app support. LocalAI covers more model types in one server, including image generation, speech and embeddings, and exposes OpenAI and Anthropic-style endpoints. Many people start with Ollama and move to LocalAI or vLLM when they need more.