Skip to content

Documentation / Reference

Local models with Ollama

Run the model on your machine or on your own server with Ollama, so that your data does not leave your infrastructure.

Ollama runs language models on your own hardware. Paired with OpenDB, it gives you an agent whose requests never leave your infrastructure.

Install Ollama and a model

Install Ollama by following the instructions on its site, then download a model:

Terminal
ollama pull qwen3:4b

Check that it answers:

Terminal
ollama list

Connect Ollama to OpenDB

  1. Open Settings → Models.
  2. Click Connect next to Ollama.
  3. Keep the default address, http://localhost:11434, if Ollama runs on the same machine. No key is required.
  4. Enable the models you downloaded.

From a terminal, check the enabled models:

Terminal
opendb ai:models ollama

Choose a model

OpenDB's agent works by calling tools. Choose a model that supports them.

Your hardware Starting point
A laptop without a dedicated graphics card A small model, around 4 billion parameters
A workstation with a graphics card A medium model, 8 to 14 billion parameters
A dedicated server A large model, depending on the memory available

A larger model follows instructions better, writes more accurate SQL and makes fewer mistakes when choosing tools. A small model is fine for exploring a schema and asking simple questions.

Ollama on another server

You can host Ollama on a server of your network and connect OpenDB to it: give its address instead of http://localhost:11434.

The agent's requests then travel over your network. Protect this access: Ollama does not authenticate its clients by default.

Other local servers

Any server that exposes an OpenAI-compatible API is connected as a custom provider. See AI providers.

Tips with a small model

  • Stay in read-only mode as long as you do not need to write.
  • Ask one question at a time. Multi-part requests lose a small model more easily.
  • Lower the number of rows read per query in Settings → AI agent: a small model has less room for data.
  • Hide the tables you do not need to lighten the schema the agent has to understand. See Project settings.
  • Write the project memory in the imperative, with precise instructions. See Memory.

What stays local

With Ollama on your machine:

  • your questions and the rows read by the agent do not leave your computer;
  • OpenDB sends nothing to a third party;
  • usage tracking stays stored locally.

You then do not need to clone the database to protect your data. Cloning remains useful for working on a copy rather than on production.

Troubleshooting

Symptom What to check
No model appears Is Ollama running? Has a model been downloaded?
OpenDB cannot reach Ollama Are the address and port correct? Is a firewall blocking the connection?
The agent does not use its tools Does the model support tool calls? Try a larger model.
Answers are very slow The model is too large for your hardware