Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AI providers and models

Drusite works fully without AI. With it, people get search by meaning, Ask your notes and meeting notes. Nothing is tied to one vendor: every feature takes any provider, and the apps show which provider and model each answer came from.

Three places a model can be

WhereWho sets it upWho can use itKey kept
The server’sYou, in the config ([ai], [ask.chat], [search.embeddings])Everyone signed inIn your config or secret files
An account’sEach person, in Settings → AIThat person, on all their devices and the web appOn the server, sealed with the account’s own key
A device’sEach person, in Settings → AI, on one desktop or phoneThat person, on that deviceOn that device only; the server never calls it

People pick a model for each feature in Settings → AI and in Ask’s model menu, from all three. Your config sets what new chats and meetings start with.

Provider kinds

Every provider, wherever it’s set up, is one of these kinds:

KindChatEmbeddingsTranscriptionNeeds
openai-compatible✓✓✓base_url; a key if the endpoint wants one
anthropic✓a key
openai✓✓✓a key
google✓✓✓a key
mistral✓✓✓a key
openrouter✓✓a key

openai-compatible covers self-hosted servers: LiteLLM, Ollama, vLLM, SGLang, llama.cpp’s server, LM Studio, LocalAI, Speaches (Whisper). For a vendor, base_url is optional and replaces its own address: a proxy, or a regional endpoint.

The server’s providers: [ai.providers.<id>]

Each provider has an ID you choose (lowercase letters, digits, - and _, up to 40), so every value can also come from the environment.

[ai.providers.local]
name = "Local models"                    # what the apps show
kind = "openai-compatible"
base_url = "http://ollama.example.test:11434/v1"
# Which models to offer. Unset or "listed": whatever the endpoint lists. Or name them, with what
# each is for (chat, embeddings or transcription; guessed from the ID unless said):
models = ["llama3.2", { id = "whisper-small", name = "Whisper", use = "transcription" }]

[ai.providers.anthropic]
kind = "anthropic"
api_key_file = "/run/secrets/anthropic"
models = ["claude-sonnet-5-5"]
max_tokens = 4096

[ai.defaults]                            # what new chats and meetings start with: provider/model
chat = "anthropic/claude-sonnet-5-5"
summaries = "local/llama3.2"             # meeting summaries; the chat default unless set
transcription = "local/whisper-small"

The same from the environment:

DRUSITE__AI__PROVIDERS__LOCAL__KIND=openai-compatible
DRUSITE__AI__PROVIDERS__LOCAL__BASE_URL=http://ollama.example.test:11434/v1
DRUSITE__AI__PROVIDERS__LOCAL__MODELS='["llama3.2"]'
DRUSITE__AI__DEFAULTS__CHAT=local/llama3.2

A provider whose models are "listed" is asked for them when the server starts and every hour after. Until it first answers, it offers nothing.

[ask.chat] (one chat model, from before [ai] existed) still works. It’s offered as one more provider with the ID ask, so ask can’t be one of yours, and it’s the chat default unless [ai.defaults] chat says otherwise.

People’s own providers

[ai.accounts]
enabled = true      # the default: people may add providers to their account
reach = "public"    # the default: which addresses the server will call for them

With enabled, people add a provider in Settings → AI and use it from every device and the web app. Its API key is sealed with a data key of the account’s own, which the master key wraps, so a database dump holds only ciphertext. A key is bound to its provider and address: changing the address drops it. No API returns a key; the apps show its last four characters.

reach decides where the server may connect for them:

  • "public": public internet addresses only. The server resolves names itself and refuses private, loopback and link-local addresses, and follows no redirects, so nobody can use your server to reach your own network. Right for a server with people you don’t fully trust.
  • "any": private addresses too. Right when everyone on the server may reach your network, such as a home server you share with family.

Your own [ai.providers] are never limited by reach.

What goes where

  • The provider sees what it’s sent. Ask sends the question and the blocks it found; search by meaning sends each block’s text to be embedded; meetings send the recording and its transcript. With a vendor, that’s the vendor; with a self-hosted model, it stays on your hardware.
  • Who can read what: only workspaces the person belongs to, checked with the same policy and row-level security as everything else. Journal entries are left out of Ask unless the person allows it.
  • What was sent where is recorded in an audit log: for each call that carried something from the notes, the feature, provider, host, model, the IDs of the blocks, how many characters and tokens, and how it went. Never the text. Workspace owners can read it at GET /api/v1/workspaces/<id>/ai-audit; it’s kept for [ask] audit_days (90).
  • No note text in the logs. Provider errors are logged as a category (unauthorized, rate_limited, network, …), never with the provider’s message, which can quote the request.
  • End-to-end encrypted workspaces are never read by the server’s AI unless an owner allows it, one request at a time. See End-to-end encryption.

Try it on your own machine

A small model with Ollama, for both chat and embeddings:

docker run -d --name ollama -p 11434:11434 ollama/ollama
docker exec ollama ollama pull llama3.2:1b
docker exec ollama ollama pull nomic-embed-text
[ai.providers.ollama]
kind = "openai-compatible"
base_url = "http://localhost:11434/v1"

[ai.defaults]
chat = "ollama/llama3.2:1b"

[search.embeddings]
base_url = "http://localhost:11434/v1"
model = "nomic-embed-text"

From inside Docker Compose, localhost is the container itself: use the Ollama service’s name instead.