Skip to content

Set up AI ​

Xandria uses the model you choose. Set it up once in Settings → AI; the rest of Xandria works the same before and after.

Choose a model ​

ChoiceGood for
OllamaLocal models on your own computer. Nothing leaves your machine.
OpenAI-compatibleOpenAI, or any service or local server with an OpenAI-compatible endpoint, with your own key.
Codex CLIOpenAI's Codex agent, using your existing Codex sign-in. Tested on Windows, macOS and Linux.
OpenCode CLIThe OpenCode agent, using your existing OpenCode setup. Tested on Linux.

The Agent needs a model that can use tools. Codex and OpenCode always can; with Ollama, pick a model that supports tool use.

How Settings → AI is laid out ​

  • Model Defaults says which model does each job: Chat (the Agent), Metadata (book details) and Semantic Model (search by meaning).
  • Configured Providers lists every model you've added, with a Test button and its key or address. Codex (and, on Linux and macOS, OpenCode) is listed from the start.
  • Permissions controls what agents may do. See Let AI edit Notes and Canvas and Connect outside agents.
Settings → AI in Local mode: Codex selected for Chat and a local Ollama embedding model selected for Semantic Model.Settings → AI in Local mode: Codex selected for Chat and a local Ollama embedding model selected for Semantic Model.

Add a chat model ​

  1. Open Settings → AI.
  2. Under Model Defaults, open the Chat list and choose Add Provider.
  3. In the Add Provider dialog:
    • Model Kind: Chat.
    • Served By: Ollama or OpenAI-compatible.
    • Service URL: filled in for Ollama. For another service, paste its address.
    • Model: the model's name, for example one you've downloaded in Ollama.
  4. Leave Use for → Chat ticked and choose Add Provider.
  5. For a provider that needs a key, enter it under API Key in its card in Configured Providers.
  6. Choose Test. When the test passes, open Agent from the rail and ask a question.

For a local model, install Ollama first and download a model that supports tool use. Larger models give better answers; small ones are fine for trying it out.

To use Codex or OpenCode, just choose it in the Chat list; see Use the Codex CLI or Use the OpenCode CLI.

Search by meaning ​

In Local mode, search by meaning runs on your computer. It needs an embedding model, which turns passages into something Xandria can compare by meaning. (With sync on, search by meaning isn't available yet, and Semantic Model doesn't appear.)

  1. Under Model Defaults, open the Semantic Model list and choose Add Provider. Model Kind is already Embedding.
  2. Set Served By to Ollama, with Model qwen3-embedding:0.6b, which runs locally and is a good default. An OpenAI or other OpenAI-compatible embedding service, including llama.cpp, works too.
  3. Leave Use for → Semantic ticked and choose Add Provider, then Test in its card.
The Add Provider dialog for an Embedding model, with Ollama, its local service address and qwen3-embedding:0.6b.The Add Provider dialog for an Embedding model, with Ollama, its local service address and qwen3-embedding:0.6b.
Configured Providers in Settings → AI, with the Ollama embedding model and Codex CLI tested on this computer.Configured Providers in Settings → AI, with the Ollama embedding model and Codex CLI tested on this computer.

Then turn on Semantic Search for your folders. Xandria works through your books in the background; large libraries take a while the first time, and new books are added as they arrive.

Keys and privacy ​

Provider keys are stored encrypted and are never shown again after you save them. Xandria sends a provider only what a request needs: your question and the relevant passages. See How AI works.

Next: Use the Codex CLI

Your library. Your reading. Your work.