# Ollama

> Run ShopAssist on Ollama's cloud or your own Ollama server, with the context window set high enough.

Source: https://shopassist.coec.dk/docs/ai/ollama · Updated 2026-10-01

## Ollama cloud [#cloud]

Create an API key at **ollama.com → Settings → Keys** and choose the preset **Ollama (cloud)** (base URL `https://ollama.com/v1`).

## Self-hosted Ollama [#self-hosted]

1. Run Ollama behind a reverse proxy with TLS and authentication on a public HTTPS URL. ShopAssist never calls `localhost` or private addresses.
2. Choose the preset **Ollama (self-hosted)** and enter the URL (for example `https://llm.example.com/v1`) and the API key your proxy expects.
3. Pull a model with tool support.

### Context window [#num-ctx]

Ollama truncates prompts to a small context by default, and ShopAssist's prompts are longer. Set `num_ctx` to **16384 or higher** in a Modelfile:

```text
FROM qwen3:14b
PARAMETER num_ctx 16384
```

```bash
ollama create shopassist-qwen -f Modelfile
```

Use `shopassist-qwen` as the model. Without it, the connection test fails with `context_too_small`.

## Data location [#data-location]

> **Data location:** Data goes wherever this endpoint runs. Self-hosted endpoints must be reachable over HTTPS with authentication.

## Troubleshooting [#troubleshooting]

* **`endpoint_blocked`:** the URL is not public HTTPS on port 443.
* **`ttft_slow`:** the first token takes more than 8 seconds; use a smaller model or a GPU.
* **`tools_unsupported`:** the model has no tool template.
