Subscription-based providers

Some cloud providers offer a subscription, which has a fixed monthly fee instead of pay-per-use (unlike the API keys).

In a nutshell, subscription-based providers work by either reusing your existing CLI tools (e.g. Claude Code, GitHub Copilot and OpenAI Codex via ACP) whereas some require installing the ACP server manually (e.g. Google Antigravity). Because they require something to be installed on your device, these providers are not available on Mobile (Android or iOS) or standalone mode.

See also the dedicated Privacy section to better understand what data is being sent to a cloud provider.

Using the Flatpak

The Flatpak version of Trilium (see Installing from Flathub) runs in a sandbox that hides the programs installed on your computer, so on its own it cannot find Claude Code, the GitHub Copilot CLI, the Codex CLI or Google's Antigravity ACP server. Trilium can start them outside the sandbox once you allow it to:

  1. Install the CLI on your computer and sign in to it, as described below for each provider.

  2. Allow Trilium to start programs outside its sandbox by running this in a terminal:

    flatpak override --user --talk-name=org.freedesktop.Flatpak org.triliumnotes.Trilium
  3. Restart Trilium, then go to Options → AI / LLM and add the provider.

Trilium then looks the CLI up in your computer's PATH and in your login shell's, and starts it there through flatpak-spawn --host. Until the permission is granted, adding one of these providers fails with a message that repeats these steps.

The environment variables that point Trilium at a CLI (such as TRILIUM_CLAUDE_CODE_PATH) name a file inside the sandbox, so with the Flatpak, leave them unset and let Trilium find the CLI on your computer.

 Claude Code

To use a subscription:

  1. First, Claude Code needs to be installed on the machine that runs Trilium. So for a Desktop Installation, Claude needs to be installed locally and for a Server Installation accessed via a browser, Claude needs to be installed on the server.
  2. Claude Code must already be authenticated. To do so, run claude in a terminal once, type /login and follow the instructions.
  3. Go to Options → AI / LLM and add the Claude Code provider.
How Trilium identifies your Claude Code binary

In this order:

  • By looking for a TRILIUM_CLAUDE_CODE_PATH environment variable pointing to the Claude binary. This allows overriding the path if needed.
  • By looking for claude in your PATH, generally works in most circumstances.
  • By asking your login shell for its PATH which lets a desktop install find a CLI installed through nvm, fnm, asdf or Homebrew, since a GUI-launched app doesn't inherit your terminal's environment.

After your provider is set up, you'll benefit from the same features as an API key (note tools, web search, extended thinking, image/PDF attachments, streaming).

 GitHub Copilot

GitHub Copilot gives access to the models of your GitHub Copilot subscription (Pro, Pro+, Business or Enterprise), without an API key. Usage counts against your Copilot plan.

  1. Install the GitHub Copilot CLI on the machine that runs Trilium, for example with npm install -g @github/copilot. As with Claude Code, for a Server Installation it needs to be installed on the server.
  2. Sign in by running copilot login in a terminal once. If you already use GitHub Copilot in another editor on the same machine, that login is reused.
  3. Go to Options → AI / LLM and add the GitHub Copilot provider.
How Trilium identifies your Copilot CLI binary

In this order:

  • By looking for a TRILIUM_COPILOT_PATH environment variable pointing to the Copilot binary.
  • By looking for copilot in your PATH.
  • By asking your login shell for its PATH, the same as for Claude Code.

Known limitations

  • The agent can only work with your notes through Trilium's note tools; its own file, shell and web tools are blocked for security reasons.
  • Images can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via Text Extraction (OCR) when the note tools are enabled.

 Google Antigravity

Google Antigravity gives access to Gemini models using a Google account (free, Google AI Pro or Google AI Ultra), without an API key. At the time of writing, a free Google account is enough to use it.

Unlike Claude Code or GitHub Copilot, Google's Antigravity ACP server is not part of the CLI so it needs to be installed manually just for Trilium. The downloaded archive is around 112-334 MB and the extracted size is around 230 MB-2 GB based on the platform.

 Windows

  1. Download Google's Antigravity ACP server for your platform. The link is shown when adding the provider in Options → AI / LLM. Unpack it on the device that runs Trilium.
  2. Make it findable by Trilium, either:
    1. by adding the unpacked folder to your PATH, or
    2. by setting a TRILIUM_ANTIGRAVITY_ACP_PATH environment variable pointing to agy_acp_server.exe.
  3. Go to Options → AI / LLM and add the  Google Antigravity provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.

 Linux &  macOS

  1. Download Google's Antigravity ACP server for your platform. The link is shown when adding the provider in Options → AI / LLM. Unpack it on the device that runs Trilium.
  2. Make it findable by Trilium, either:
    1. by adding the unpacked folder to your PATH, or
    2. by setting a TRILIUM_ANTIGRAVITY_ACP_PATH environment variable pointing to agy_acp_server.par.
  3. Go to Options → AI / LLM and add the  Google Antigravity provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.

NixOS

  1. On NixOS, antigravity-acp package is already available but only in nixos-unstable at the time of writing. The easiest method to test it out is to use the nix shell with flakes:

    NIXPKGS_ALLOW_UNFREE=1 nix shell --impure github:nixos/nixpkgs/nixos-unstable#antigravity-acp
    trilium
  2. Go to Options → AI / LLM and add the  Google Antigravity provider. When the list of models is loaded for the first time, the Google sign-in page opens in a browser on the machine running Trilium; finish signing in there.

Known limitations

  • The agent can only work with your notes through Trilium's note tools; its own file and shell tools are blocked for security reasons.
  • The Antigravity ACP server requires authentication via a login link. The login link needs to be run on the same device, so it might not be possible to set up the provider while using the web version of a Docker installation. Desktop Installation should work fine.
  • Images can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via Text Extraction (OCR) when the note tools are enabled.
  • The results of tool calls (e.g. reading a note, writing attributes) are not properly displayed because they are not exposed by the ACP server.

 OpenAI Codex

OpenAI Codex gives access to the Codex models of your ChatGPT plan (Free, Go, Plus, Pro or Business), without an API key. At the time of writing, a free ChatGPT account is enough to use it. Usage counts against your plan's Codex limits, which are small on the Free plan.

 Most platforms

  1. Install the Codex CLI on the machine that runs Trilium, for example with npm install -g @openai/codex. As with Claude Code, for a Server Installation it needs to be installed on the server. Trilium ships the ACP adapter that connects to it, so nothing else is needed.
  2. Go to Options → AI / LLM and add the  OpenAI Codex provider. When the list of models is loaded for the first time, the ChatGPT sign-in page opens in a browser on the machine running Trilium; finish signing in there.

NixOS

  1. On NixOS, Codex is available as the codex package in nixpkgs. The stable channel can lag behind Codex's releases, so a newer version can be taken from nixos-unstable:

    nix shell github:nixos/nixpkgs/nixos-unstable#codex
    trilium
  2. Go to Options → AI / LLM and add the  OpenAI Codex provider. When the list of models is loaded for the first time, the ChatGPT sign-in page opens in a browser on the machine running Trilium; finish signing in there.

Trilium keeps its own Codex sign-in and settings, separate from any Codex CLI you use in a terminal, so an existing codex login is not reused.

How Trilium identifies your Codex CLI binary

In this order:

  • By looking for a TRILIUM_CODEX_PATH environment variable pointing to the Codex binary.
  • By looking for codex in your PATH.
  • By asking your login shell for its PATH, the same as for Claude Code.

Known limitations

  • The agent can only work with your notes through Trilium's note tools, and search the web when the chat allows it; its own file, shell and other tools are blocked for security reasons.
  • The ChatGPT sign-in opens in a browser on the device running Trilium, so it might not be possible to set up the provider while using the web version of a Docker installation. Desktop Installation should work fine.
  • Images and SVGs can be attached to the conversation, PDFs cannot. The LLM should still be able to read PDF notes and attachments via Text Extraction (OCR) when the note tools are enabled.