# Set up Ollama

Serve a local model with Ollama, raise its context window, add it to Borago Board as a self-hosted service and run a first task on it.

Ollama is the easiest self-hosted server for Borago Board. It needs no API key and a run costs nothing. It is also the only server that tells the app its real context window, and the only one the app can start and download models for. The full walk-through is [Run tasks on a local model with Ollama](/docs/tutorials/local-model-with-ollama/).

## You need

- The desktop app and a project, see [Creating a project](/docs/guides/creating-a-project/).
- A computer with about 24 GB of graphics memory, or 32 GB of unified memory on an Apple silicon Mac. [Using a local AI model](/docs/local-models/) explains why.

## Steps

### 1. Install Ollama and pull a model

Install Ollama from [ollama.com](https://ollama.com/download). Then download a model that calls tools well.

```
ollama pull qwen3-coder:30b
```

While Ollama runs, it serves the OpenAI-compatible endpoint at `http://localhost:11434/v1`.

### 2. Raise the context window

Ollama serves a small window by default. On Linux, run the first command, add the two lines and restart Ollama.

```
sudo systemctl edit ollama.service
```

```
[Service]
Environment="OLLAMA_CONTEXT_LENGTH=32768"
```

The [Ollama tutorial](/docs/tutorials/local-model-with-ollama/) gives the macOS and Windows equivalents. The app cannot set the window itself.

### 3. Add the service

Open Settings from the gear and choose **Self-hosted services**. Press **Add a self-hosted service**. Name it, keep **Server address** as `http://localhost:11434/v1`, leave **API key (optional)** empty and press **Add**.

### 4. Verify

Press **Edit** on the new row. **Models on this server** fills in. Press **Verify**. The card shows whether the model makes tool calls and the context window Ollama really serves. If Ollama is installed and stopped, the editor offers **Start it**. Leave **Context window (tokens)** empty, because Ollama reports its own.

### 5. Choose it for the runs

In the project, press **Edit project**, open **AI Roles**, and in **Task runner** choose your service from **Self-hosted AI services (your hardware)**. Choose the model and press **Save changes**.

What happens. Self-hosted runs have a shell and a file editor in the project container, a code search and task breakdown. They have no web search, no page fetch and no investigator. A run stops at **Time limit per task (min)**, 120 minutes by default.

## First task to try

```
Create a file named hello.txt in the project's root folder containing the
single line "Hello from a local model". Then list the root folder.
```

Related: [Run tasks on a local model with Ollama](/docs/tutorials/local-model-with-ollama/), [Using a local AI model](/docs/local-models/), [Set up vLLM](/docs/tutorials/keys/vllm/), [Choosing an AI provider](/docs/guides/choosing-an-ai-provider/)
