Ollama
Connect Ollama to SurfSense
Connect Ollama
Connect to your Ollama local server. Add it from Workspace Settings > Models.
Base URL
Choose the URL from where the SurfSense backend runs.
SurfSense Runs in Docker
Use this when SurfSense is running from Docker and Ollama is running on your computer.
http://host.docker.internal:11434This is the default in SurfSense.
Ollama Runs in Docker
Use this only when Ollama is a service in the same Compose stack as SurfSense.
http://ollama:11434SurfSense Runs Without Docker
Use this when SurfSense and Ollama both run directly on the same computer.
http://localhost:11434Ollama Runs on Another Computer
Use this when Ollama is running on another machine in your network.
http://<host>:11434Replace <host> with the LAN IP or domain for that machine.
Embeddings on a Separate Ollama Server
Search-space model connections configure chat and completion models. The global embedding model is configured in the backend environment.
Use Chonkie's LiteLLM embedding provider when embeddings run on Ollama:
EMBEDDING_MODEL=litellm://ollama/nomic-embed-text
EMBEDDING_BASE_URL=http://host.docker.internal:11434If chat and embeddings run on different Ollama instances, keep the chat model
connection pointed at the chat server and set EMBEDDING_BASE_URL to the
embedding server. OLLAMA_EMBEDDING_BASE_URL is also supported as an
Ollama-specific fallback when EMBEDDING_BASE_URL is not set.
Add the Connection
- Open Workspace Settings.
- Go to Models.
- Select Ollama.
- Set API Base URL.
- Leave API Key empty unless your endpoint needs one.
- Select the models you want to enable.
- Save the connection.
Do not add /v1 to the URL. SurfSense uses Ollama native routes such as /api/version and /api/tags.
Verify
From the host:
curl http://localhost:11434/api/versionFrom the SurfSense backend container:
docker compose exec backend curl http://host.docker.internal:11434/api/version
docker compose exec backend curl http://host.docker.internal:11434/api/tagsTroubleshooting
Name or service not known
The backend cannot resolve the host name.
Use http://host.docker.internal:11434 unless you run Ollama as a Compose service named ollama.
Connection refused
Ollama is not reachable from the backend.
Start Ollama and confirm that port 11434 is open.
No models found
Pull at least one model:
ollama pull llama3.2Then refresh model discovery in SurfSense.