# Set up AI

Connect an API provider, a local model, or an installed CLI agent.

Choose how you want to work. Oleafly can run its built-in assistant against a model API, connect to a local model, or use an installed CLI agent.

| You already have… | Choose… |
| --- | --- |
| A model API key | **Providers and keys** |
| A local model server | **Ollama** or a custom OpenAI-compatible provider |
| An installed coding agent | [**CLI agents**](/docs/cli-agents/) |
| An external MCP client | [**MCP**](/docs/mcp/) |

Open **Settings → AI Assistant** to configure the route you want. You can keep several providers connected and switch models in chat.

![Settings → AI Assistant → Providers and keys. Expand your provider to configure it. Ollama is near the bottom of the list.](https://cdn.oleafly.com/images/screenshots/desktop/docs/settings-providers-dark-window-v2.png#view=519,89,883,902)

## Connect a provider

1. Open **Providers and keys** and expand a provider.
2. Enter its API key and save.
3. Oleafly checks the connection and refreshes the model list.
4. Choose a model in the assistant, or set a default in **Instructions**.

OpenAI

Anthropic

Google Gemini

Perplexity

Z.AI

Groq

OpenRouter

DeepSeek

Mistral

xAI

Ollama

Each provider card in Settings links to its key setup. Ollama connects to a local model server.

## Choose a model

Model rows show capability information when available: context size, vision, tools, and reasoning. Use a model with tool support for project work and vision for image inspection.

**Verified** means a tool-call check succeeded. **Untested** means the assistant has not verified that model; **Blocked** includes a reason it cannot be selected. These badges describe tool compatibility. They do not rate the quality of a model's research or writing.

Refresh a provider's catalog when its available models change. You can also add a model by its identifier.

## Connect a local model

Install and start [Ollama](https://ollama.com/), then download a model in Ollama. In Oleafly, open the Ollama card and choose **Check for Ollama**. Select an installed model once the server is found.

A local model keeps model requests on your machine. Online research tools still contact their source services when used.

## Add a custom endpoint

Choose **Add custom provider** for an OpenAI-compatible service, local server, or gateway. Enter a name, base URL, and any required key. Save and choose a model.

Editing a saved provider lets you change its address. A saved key will be sent to the new address when that provider is used, so check the destination before saving.

## Set writing preferences

**Instructions** holds standing preferences and the default chat model. Use concrete instructions:

> Use British spelling. Preserve citation keys. Explain changes to equations before applying them.

**Personas** stores named instruction presets. **Skills** supplies procedures for recurring research work. [Explore skills →](/docs/skills/)

## Keys and costs

Provider keys are encrypted in local app storage and kept out of project source files. Hosted requests go to the selected provider with the supplied context. Model API charges and CLI subscriptions are billed by their providers.

[Review usage and budgets →](/docs/ai-usage/)
