Ollama is the engine, but it ships with no real interface of its own. To get a chat UI, RAG, or agent workflows around your models, you need to point a front-end tool at it — and the anythingllm ollama pairing is one of the most popular ways to start running local AI models privately.
The good news: every major tool connects to Ollama the same way, through its local HTTP API on port 11434. Once you understand that, hooking up AnythingLLM, Open WebUI, Cursor, or n8n takes a couple of minutes each.
This guide walks through each integration step by step, including the two errors everyone hits: “model not found” in AnythingLLM and Docker containers that can’t see Ollama on the host.
ollama serve and pull a model first. Then point each tool at http://127.0.0.1:11434 (or http://127.0.0.1:11434/v1 for OpenAI-compatible clients like Cursor). Inside Docker containers, use host.docker.internal instead of 127.0.0.1 so the container can reach the Ollama server on the host machine.Before You Start: Prerequisites
Every integration below depends on the same two things. Check them before touching any settings panel.
- Ollama is installed and the server is running (
ollama serve, or just the Ollama app running in the background on macOS and Windows). - At least one model is pulled locally, for example
llama3.1orqwen2.5-coder. - You know the exact model tag, including the colon suffix if it has one.
Pull a model and confirm the server responds:
ollama pull llama3.1
ollama list
curl http://127.0.0.1:11434/api/tags
If the curl command returns JSON with your models, the API is live. For a deeper look at the endpoints and configuration options, see our guide to the Ollama local API server.
Connect AnythingLLM to Ollama
AnythingLLM is a desktop app (and Docker image) that adds workspaces, document chat, and RAG on top of any LLM. It has native Ollama support, so no API keys are involved.
Set Ollama as the LLM Provider
Open AnythingLLM and go to Settings → AI Providers → LLM. In the provider dropdown, select Ollama.
Three fields matter here:
- Ollama Base URL:
http://127.0.0.1:11434(default, correct for the desktop app) - Chat Model Selection: pick a model from the dropdown — it auto-fills from Ollama
- Token context window: match it to your model, for example 8192 for llama3.1
Save the settings, open a workspace, and send a test message. If the model appears in the dropdown at all, your anythingllm ollama connection is working.
Fix “Model Not Found” in AnythingLLM
The most common failure is an error like model "llama3.1:latest" not found, try pulling it first. It almost always means one of two things.
1. The model was never pulled. AnythingLLM lets you type a model name manually, but Ollama only serves what exists locally. Pull it:
ollama pull llama3.1
2. The tag doesn’t match exactly. Ollama treats llama3.1, llama3.1:latest, and llama3.1:8b as distinct names. Run ollama list and copy the exact tag from the NAME column into AnythingLLM.
ollama list
# NAME ID SIZE
# llama3.1:latest a80c4f17acd5 4.9 GB
If you pulled a model you no longer need, clean it up to free disk space:
ollama rm llama3.1
Connect Open WebUI to Ollama
Open WebUI is a self-hosted, ChatGPT-style interface that runs in Docker. Because it runs inside a container, the open webui ollama connection has one extra wrinkle: networking.
Run Open WebUI with OLLAMA_BASE_URL
You tell Open WebUI where Ollama lives via the OLLAMA_BASE_URL environment variable. The official one-liner handles the common case:
docker run -d -p 3000:8080
--add-host=host.docker.internal:host-gateway
-e OLLAMA_BASE_URL=http://host.docker.internal:11434
-v open-webui:/app/backend/data
--name open-webui
ghcr.io/open-webui/open-webui:main
Open http://localhost:3000, create the admin account, and your pulled Ollama models show up in the model selector automatically.
Docker Desktop and host.docker.internal
Inside a container, 127.0.0.1 means the container itself — not your machine. That’s why pointing Open WebUI at http://127.0.0.1:11434 fails with a connection error even though Ollama is clearly running.
host.docker.internal is a special DNS name that resolves to the host. Docker Desktop (macOS and Windows) provides it natively; on Linux you need the --add-host=host.docker.internal:host-gateway flag shown above.
If models still don’t appear, verify from inside the container:
docker exec -it open-webui
curl http://host.docker.internal:11434/api/tags
A JSON response means networking is fine and the issue is elsewhere. A timeout means the host firewall is blocking port 11434 or Ollama isn’t bound to the right interface.
Connect Cursor to Ollama
Cursor doesn’t have a native Ollama option, but Ollama exposes an OpenAI-compatible API. The cursor ollama trick is to treat Ollama as a custom OpenAI provider.
In Cursor, open Settings → Models and do the following:
- Under OpenAI API Key, toggle “Override OpenAI Base URL” and set it to
http://127.0.0.1:11434/v1 - Enter any non-empty string as the API key — Ollama ignores it, but Cursor requires the field
- Click Add model and type the exact model tag, for example
qwen2.5-coder:7b - Disable the cloud models you don’t want Cursor to call
The /v1 suffix is essential — it’s Ollama’s OpenAI-compatible endpoint. You can confirm it works before touching Cursor:
curl http://127.0.0.1:11434/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"qwen2.5-coder:7b","messages":[{"role":"user","content":"Say hello"}]}'
Be realistic about quality: local chat works well for inline edits and questions, but Cursor’s agent and background features are tuned for frontier cloud models. Pick from the best Ollama models for coding to get the most out of it.
Connect n8n to Ollama
The n8n ollama integration is the simplest of the four because n8n ships a dedicated Ollama node and credential type. No base-URL hacking required.
In n8n, go to Credentials → Add credential → Ollama and set the base URL to http://127.0.0.1:11434. Then drop an Ollama node (or the Ollama Chat Model inside an AI Agent node) into a workflow, select your credential, and pick a model from the dropdown.
The networking caveat from Open WebUI applies here too. If you run n8n itself in Docker, 127.0.0.1 in the credential points at the n8n container. Use http://host.docker.internal:11434 instead, with the host-gateway mapping on Linux:
docker run -d -p 5678:5678
--add-host=host.docker.internal:host-gateway
-v n8n_data:/home/node/.n8n
--name n8n
docker.n8n.io/n8nio/n8n
Quick Reference: Base URLs Per Tool
The same server, four slightly different connection details. Keep this table handy when a tool refuses to connect.
| Tool | Base URL | Notes |
|---|---|---|
| AnythingLLM | http://127.0.0.1:11434 | Native Ollama provider, model tag must match ollama list |
| Open WebUI | http://host.docker.internal:11434 | Set via OLLAMA_BASE_URL env var |
| Cursor | http://127.0.0.1:11434/v1 | OpenAI-compatible endpoint, any API key works |
| n8n | http://127.0.0.1:11434 | Use host.docker.internal if n8n runs in Docker |
Troubleshooting Checklist
When a tool can’t reach Ollama, work through these in order. Most connection problems are solved by the first two.
- Confirm
curl http://127.0.0.1:11434/api/tagsreturns JSON from the host. - If the client runs in Docker, swap
127.0.0.1forhost.docker.internal. - Run
ollama listand verify the model tag matches exactly, including the suffix. - Check that no firewall or VPN is blocking localhost traffic on port 11434.
- Restart the client after changing its provider settings — some cache the model list.
Conclusion
Connecting Ollama to AnythingLLM, Open WebUI, Cursor, or n8n always comes down to the same formula: a running ollama serve process, a pulled model, and the right base URL. Native clients use port 11434 directly, OpenAI-compatible clients add /v1, and Docker containers need host.docker.internal.
Once the first tool is connected, the rest take minutes. Keep your model tags exact, and the “model not found” errors disappear for good.