Phase 8: choosing AI models, and meeting notes
Status: built, from this plan as approved (with your answers: account providers yes, the
computer’s sound in a follow-up, audio kept, a Meetings database, reach = "public" by default).
Where the build differs from the plan, it says so in “Changed from the plan” just below.
Changed from the plan
- Each app records natively, as planned, but in a follow-up PR (the first PR used the webview’s
recorder everywhere). iOS records with AVAudioRecorder and the
audiobackground mode, Android with a foreground service of the microphone type, and desktops with cpal. All of them write the file as they go, so a recording goes on with the screen locked or the window hidden, and a crash keeps what was recorded. The browser keeps the browser’s recorder. Details in §7.2. - Phones record AAC in an ADTS stream (
.aac), not M4A. An M4A file’s index is only written when recording stops, so a phone that ends the app partway would leave a file nothing can read. An ADTS file is a stream of frames: cut anywhere, it plays up to the cut. Same codec, 16 kHz mono at 32 kbit/s, about 15 MB an hour. - Desktops record Ogg Opus, not AAC: 16 kHz mono at 24 kbit/s, about 11 MB an hour, the
same size as the phones’ and the browser’s. Desktops have no AAC encoder that works the same on
macOS, Windows and Linux. The encoder is libopus 1.3.1 translated to Rust (
unsafe-libopus), so building the app needs no C toolchain. Each Ogg page (a second) is written as soon as it’s full, so a crash keeps everything up to the last second. (FLAC was tried first: lossless, but about 70 MB an hour, which would have filled the server’s default 100 MB in 80 minutes. Lossless buys nothing here: every recording is resampled to 16 kHz before transcribing.) - The computer’s sound is recorded on desktops (question 2), in the same follow-up PR. The start sheet has a switch, “Also record the computer’s sound”, remembered on each device. It’s mixed with the microphone into one track.
- The size warning (“10 minutes left before the recording is too big for your server”) isn’t built yet. The apps don’t know the server’s limit. A recording over it fails to sync, and stays on the device with Try again.
- The macOS app needs macOS 12.3 or later, the first with ScreenCaptureKit.
- Parts are transcribed one at a time, not three at once, so each gets the end of the one before as context, which is what keeps names right. An hour is about six parts.
- Gemini gets each part inline, cut small enough (7 minutes) to fit its 20 MB request, rather than through its Files API.
- Attendees is a text column (names, comma-separated), not a multi-select.
- The phone’s New page tab still makes a page. A meeting starts from the drawer’s Meetings row (its +), a page’s “…” › Record a meeting, or the slash menu. One tap fewer for the common case.
Two pieces of work, on one branch and one PR:
- Models and providers. Ask your notes lets you pick a model in the chat box, as Notion does, from every model you can use: your server’s and your own. A provider can offer many models.
- Meeting notes (the roadmap’s Phase 8): record a meeting or upload a file, transcribe it with a model you choose, and get a page with a summary, action items and the transcript. Done when a meeting becomes a page.
Everything here behaves the same on macOS, Windows, Linux, iOS, Android and the browser. Where a platform can’t do something, the app says so where you’d look for it. Nothing assumes a particular vendor, gateway or model. Examples use made-up names (“Home lab”, “OpenAI”).
1. What’s wrong today
| What you saw | Why it happens |
|---|---|
| Ask shows one fixed model with a tooltip. You can’t change it. | Ask runs only on the server’s single [ask.chat] model. Providers you add in Settings never reach Ask: Settings even says “Ask your notes doesn’t use these”. |
| One provider gets one model id, typed by hand, for “Chat”. | The device keeps one (provider, model) pair per feature. LiteLLM, OpenRouter and OpenAI each serve dozens of models under one key, and there’s nowhere to list or choose them. The app can already fetch a provider’s model list; it only uses it for suggestions. |
"https//ai…" isn't an address (http://…) | It reads as though https isn’t allowed. It is. The real problem was a missing colon, and the message didn’t say so. |
| Models: can’t reach the provider: error sending request for url (gateway.ai.svc.cluster.local) | A provider added in Settings today is a device provider: the app on the Mac calls it, not the server. Only Ask goes through the server, and only with the server’s config model. The Mac can’t resolve a name that exists only inside the cluster, and the error doesn’t say so. An account provider (§2) would be called by the server, so this address would work. |
| Settings → AI → Embeddings, “for finding notes by meaning on this device”. | Nothing on the device uses it. Search by meaning runs only on the server. |
| A server can offer only one chat model. | The config has room for one. |
2. Where a model runs: three kinds of provider
The menu and Settings both group models by provider. Each provider shows where it runs, because that decides where your notes and your key go.
| Your server’s | Your account’s (new) | This device’s | |
|---|---|---|---|
| Who adds it | The server’s owner, in the server config | You, in Settings → AI | You, in Settings → AI |
| Where the key is kept | Server config or secret file | On the server, encrypted with the server’s master key, like your notes. Never sent back to any app. | In this device’s encrypted store. Never synced, never sent to the server. |
| Which devices can use it | Every device signed in to the server | Every device signed in to your account, the browser included | Only this device |
| What it can reach | What the server can reach (e.g. http://llm.internal:4000) | What the server can reach, within the owner’s rule (§10) | What this device can reach (e.g. http://localhost:11434) |
| Keeps working when the app closes | Yes (server jobs) | Yes (server jobs) | No: the app has to stay open |
| In the browser | Yes | Yes | No. A browser can’t safely keep a key or call most vendors directly (CORS), as Phase 7 found. The browser says: “A browser can’t keep providers of its own. Add one to your account instead.” |
| Shown as | “Home lab · Server” | “OpenAI · Account” | “Ollama · This device” |
Why add account providers: today a provider has to be added again on every device, and none of them works in the browser. Long jobs, such as transcribing an hour of audio, can’t survive a phone locking. And the address in your screenshot, which only the cluster can reach, would just work from the server. The cost is that the key sits on the server, which already holds your notes. Device providers stay for models only your device can reach, such as Ollama on a laptop, and for anyone who doesn’t want a key on the server. This is open question 1 (§13).
3. Settings → AI
One page, the same on every platform (phones get the usual inset-group version).
Default models: synced with your account.
| Row | Control | Notes |
|---|---|---|
| Chat | Model menu (§4) | What a new Ask chat starts with. |
| Summaries | “Same as chat” or a model | Used for meeting summaries. |
| Transcription | A model that takes audio | Only models marked for transcription are listed. If there are none: “No provider here transcribes audio. OpenAI, Mistral, Google and most self-hosted Whisper servers do.” |
| Search by meaning | Read-only: the server’s embedding model, or “Off” | “Set by your server’s owner. Changing it re-indexes every page.” |
The old device-only Embeddings row goes, because nothing used it. Its saved value is kept in the store, untouched.
Your server: its providers and models, read-only, under the names the owner gave them. If the server has none: “Your server has no AI models set up. You can still add your own below.”
Providers: one row per provider: the name, “Account” or “This device”, the address, the key’s last four characters, and “12 models · 3 shown”. Its buttons are Test connection, Edit and Remove. Add a provider… opens the form:
- Type: Anthropic, OpenAI, Google Gemini, Mistral, OpenRouter, or OpenAI-compatible (LiteLLM, Ollama, vLLM, SGLang, LM Studio, llama.cpp and others).
- Name: defaults to the type.
- Address: filled in for vendors, empty and required for OpenAI-compatible, with the
placeholder
https://example.com/v1. It’s checked as you type (§9). - API key: optional for OpenAI-compatible. Once saved it shows as “Saved (…VrVw); type to replace”.
- Keep it: “In your account: every device, key kept on your server” or “On this device only”. Signed out: device only. In the browser: account only.
- Save saves, tests the connection, then lists the provider’s models.
The provider’s models (under the row, opened by “12 models”):
- Fetched from the provider:
- OpenAI, Mistral, OpenRouter and OpenAI-compatible:
GET /models; - Anthropic:
GET /v1/models; - Google:
GET /v1beta/models, paged.
- OpenAI, Mistral, OpenRouter and OpenAI-compatible:
- Each model has a Show in Ask checkbox, and a Use for tag: Chat, Embeddings or
Transcription. The tag comes from what the vendor says (Google’s
supportedGenerationMethods, OpenRouter’s input types) or, failing that, from the name (“whisper”, “transcribe” or “stt” means transcription; “embed” means embeddings). It can be changed from the row’s “…” menu, because names guess wrong. - A search box once there are more than 10. Refresh list fetches the list again.
- Add a model by ID, for endpoints that don’t list models or list only some: an id, an optional display name, and Use for. A hand-added model is marked “added by hand”, and Refresh never removes it.
- What’s ticked at first: when the list has 12 or fewer chat models, all of them; when it has more (OpenRouter lists hundreds), none, with “Choose which models appear in Ask”.
- If listing fails, the list says why (§9) and offers Add a model by ID. The provider still saves.
Test connection keeps its steps (reach the address → key accepted → list models → a tiny request to each model used by default), in plain words and with timings.
4. The model menu in Ask
Where: the small model label in the question box (today a grey label with a tooltip) becomes a quiet button: the model’s display name and a chevron. It sits in the same place in the floating panel, the side panel and full screen on phones.
Opening it (click, or Enter with focus on it): on desktops and in the browser, a menu above the button, 320 px wide; on phones, a bottom sheet.
- A search box at the top when there are more than 8 models.
- Groups, in this order: the server’s providers, then your account’s, then this device’s. Each group has the provider’s name with “Server”, “Account” or “This device” after it.
- Rows: the model’s display name, with a check on the one in use. “Default” in grey on your default.
- A row that can’t be used right now is greyed out, with the reason on a second line: “Set up on another device”, “Your server is too old for this (needs 0.1.0-alpha.8)”, “Last test failed: key not accepted”.
- At the foot: Make default (for the highlighted model) and Manage models…, which opens Settings → AI.
- Keyboard: arrows, type to filter, Enter picks, Esc closes, as the design doc’s menus do.
What’s remembered:
- Per chat: the chat keeps the model you last picked in it, saved with the chat on the server, so it follows you to other devices. Reopening a chat picks that model again.
- New chats start with your default model. The default is synced with your account; a server with models has its owner’s default until you pick your own.
- Each answer names the model that wrote it, in small grey text under the answer (shown on hover on desktops and always on touch screens). Changing the model partway through a chat is fine: earlier answers keep their label.
When a model goes away (its provider was removed, its box unticked, the server’s config changed, or the provider no longer lists it):
- the next question uses your default, and a line in the chat says so: “Model X isn’t available any more, so this answer uses Y.” Nothing switches without telling you;
- the button shows the model actually in use;
- if your default itself goes away, the server’s default takes over. If there is none, the first model in the menu does. Settings → AI shows “Your default, X, isn’t available. Using Y.”
A model set up on another device (a device provider on the Mac, with the chat opened on the phone): the chat’s model shows as “X (on another device)”, greyed, and the phone answers with your default, with the same one-line note.
No models at all: the empty state says “No AI models yet. Your server has none set up, and you haven’t added a provider.” with a button, Add a provider.
5. How Ask answers, and what goes where
Finding the notes doesn’t change. The server searches your pages, words plus meaning when it has an embedding model, with the same permission checks, the journal switch and the page chip. Only the last step changes: which model writes the answer, and who calls it.
Server or account model: everything happens on the server, as today.
App → server: question, chosen model. Server → provider: the found blocks + the question.
The answer streams back. The key never leaves the server. The audit log (ai_audit) records the
provider’s host and model, without any text.
This device’s model:
App → server: the question and the page scope. The server finds the blocks, builds the same prompt it would send itself, saves the question in the chat, and returns the prompt and the sources. It records in the audit log that the device asked for the context.App → provider, directly from the device: the prompt (the found blocks and the question). The answer streams into the panel.App → server: the finished answer, to save in the chat with its model’s name and sources.
What leaves the device: the question goes to your server; the found blocks and the question go to the provider you picked. The key never leaves the device, and the server never sees it. If the answer fails partway, the chat keeps the question and shows the error, as a server answer does.
Offline or signed out: Ask needs the server to find the notes, so it says “Ask needs your server to find your notes. You’re offline.” This is unchanged. Asking from the device’s own copy while offline is listed under Not in this PR (§12).
6. One choice per feature
The design note’s rule: chat, embeddings, transcription and agents each pick their own provider and model.
| Feature | Chosen where | Runs where | Remembered |
|---|---|---|---|
| Chat (Ask) | The model menu, per chat; default in Settings | Where its provider is (§2) | Per chat (server) and default (account) |
| Summaries | On the meeting’s start screen; default in Settings (“Same as chat”) | Where its provider is | Per meeting and default |
| Transcription | On the meeting’s start screen; default in Settings | Where its provider is | Per meeting and default |
| Embeddings | Server config only | Server | The model’s id is kept with every vector. Changing it re-indexes everything, and the server already does this when the id changes. Settings says so. |
Agents use MCP and their own models, so nothing changes for them here.
7. Meeting notes
7.1 Where meetings live
Meetings live in a Meetings database, made the first time you record. It works the way the
journal now does: it’s in the sidebar’s top section as “Meetings” (mic icon), its entries are
listed in the tree, and it has these properties: Date, Attendees (names, as a
multi-select), Duration and Status (Recording, Uploading, Transcribing, Summarising, Done,
Failed). You can rename it, move it, or give it other views like any database. Notion’s “My
meetings” is the model: one table of meetings, with name, date and attendees.
Starting one:
- Sidebar: “Meetings”, then New meeting.
- The page’s top bar: “…”, then Record a meeting.
- Slash menu in any page: Meeting notes starts a meeting and puts a link to its page at that spot.
- Phones: the drawer’s Meetings row (its +), or a page’s “…” menu.
The start screen is a small sheet, a bottom sheet on phones:
- Record or Upload a file;
- Transcribe with [model] and Summarise with [model], from your defaults;
- Language: Detect, or one you pick;
- one line saying where things go, e.g. “Audio is saved with the page and synced to your server. It’s sent to Home lab (your server) to transcribe, and the transcript to OpenAI (your account) to summarise.” It changes as you change the models.
7.2 Recording
As soon as you press Record, the meeting page opens, titled with the date and time (“Meeting, 28 Nov 2026, 14:05”). A recording bar is pinned to the top of the page: a red dot, the time (12:04), a level meter, Pause and Stop. You can type in the Notes tab while it records, and the summary uses what you write as a hint, as Notion does. If the level meter shows nothing for 30 seconds, the bar says “No sound from (microphone name). Check it isn’t muted.” If you leave the page, a small red “Recording 12:04” pill stays in the sidebar or top bar and takes you back.
| Platform | How it records | Permission | Screen locked / app hidden |
|---|---|---|---|
| macOS | Natively (Core Audio through cpal), Opus | macOS asks the first time (“Drusite records meetings you start, to turn them into a page.”) | Keeps recording |
| Windows | Natively (WASAPI through cpal), Opus | If Windows has the microphone off for desktop apps, the app says so and opens Settings › Privacy & security › Microphone | Keeps recording |
| Linux | Natively (PulseAudio or PipeWire, ALSA if neither runs), Opus | None | Keeps recording |
| iOS / iPadOS | Natively (AVAudioRecorder, background audio on), AAC | iOS asks the first time; the orange dot shows while recording | Keeps recording when locked. A phone call pauses it: “Paused for a call. Resume” |
| Android | Natively, as a foreground service (microphone type), AAC | Android asks the first time, and from Android 13 for the notification | Keeps recording, with a notification: “Recording meeting · 12:04 · Stop” |
| Browser | The browser’s recorder | The browser asks the first time | The tab has to stay open. Leaving asks “Stop recording and leave?”. Phone browsers stop when you switch apps, and the start sheet says so there. |
The apps write the recording to a recordings folder in their data as it’s made: every couple
of seconds on desktops, frame by frame on phones. When it stops, the file goes to the core by
its path, not through the webview as base64, and is deleted once it’s kept with the page. A
note beside each file holds the meeting’s page and the models chosen.
If the app stops while recording (closed, crashed, or ended by the phone), the file and its note are still there. The next time the app opens, it says: “A recording from 14:05 (32 min) wasn’t finished. Transcribe it · Delete”. Transcribe it goes on as Stop would have, into the same meeting’s page (or a new one if that page is gone), with the same models.
Pressing Stop in Android’s notification stops and keeps the recording. The app transcribes it the moment it’s next looked at, or offers it back as above if it was closed.
If permission is denied: “Drusite can’t use the microphone. Allow it in System Settings › Privacy & Security › Microphone.” (the equivalent on each platform).
The computer’s sound (desktops: the other side of a call on headphones). The start sheet’s switch, “Also record the computer’s sound”, mixes it with the microphone:
| Platform | How | Permission |
|---|---|---|
| macOS 13+ | ScreenCaptureKit, audio only (the app’s own sound left out) | Screen & System Audio Recording, asked the first time. Until it’s allowed, the bar says: “Drusite can’t record the computer’s sound, so only the microphone is recorded. Allow it in System Settings › Privacy & Security › Screen & System Audio Recording, then record again.” |
| Windows | WASAPI loopback of the default output | None |
| Linux | The default output’s monitor source (PulseAudio, or PipeWire’s PulseAudio server) | None. Without PulseAudio or PipeWire, only the microphone is recorded, and the bar says why. |
Phones can’t record other apps’ sound, so the switch isn’t there.
Screenshots (the browser tests’ stand-in recorder): the start sheet with the switch, paused for a call, and a recording left unfinished.
7.3 Uploading a file
You can upload m4a, mp3, wav, flac and ogg audio, and mp4 or mov video. From a video,
only the sound is kept. Files can be picked or dropped onto the page. On phones, the system file
picker includes voice memos. The page is made at once, with the status bar showing “Uploading 40%”.
7.4 Where the audio goes, and size limits
- The audio is an attachment of the meeting page: an audio block with a player, placed above the transcript. Like every attachment, it syncs through the server to S3, encrypted at rest.
- Recordings are mono speech audio, about 11–15 MB an hour everywhere: AAC on phones, Opus on desktops and in the browser.
- The limit is the server’s attachment size (
[attachments] max_bytes, 100 MB by default), so about 6 hours or more on every platform. Planned, not built yet: ten minutes before the limit the bar warns: “10 minutes left before the recording is too big for your server.” At the limit it stops and keeps what it has. - An upload over the limit: “This file is 240 MB. Your server takes files up to 100 MB. The server’s owner can raise [attachments] max_bytes.” A video is checked after its sound is taken out, so most videos fit.
- Signed out (no server), the audio stays on the device and transcription needs a device model.
- Delete audio (in the page’s “…” menu) removes it from the page and the server, and keeps the transcript. Whether audio is kept by default is open question 3.
7.5 Transcription
| Provider type | How | Notes |
|---|---|---|
| OpenAI, Mistral, OpenAI-compatible | POST /audio/transcriptions (multipart: file, model, language, prompt) | Timestamps where the model gives them (verbose_json); otherwise plain text with each part’s start time. Self-hosted: any server with this endpoint, e.g. Speaches/faster-whisper, vLLM, LocalAI, or a gateway in front of them. |
| Google Gemini | generateContent with the audio attached and a transcription instruction | Each part goes inline, cut to 7 minutes to fit. Speaker labels come from the prompt. |
| Anthropic, OpenRouter | Not offered for transcription | They take no audio here. The picker says: “Anthropic can’t transcribe audio.” |
- Speakers: labelled “Speaker 1”, “Speaker 2” when the model gives speakers (diarizing models, Gemini). Otherwise the transcript has no speaker labels.
- Where it runs: a server or account model runs it as a server job, so you can close the app or lock the phone. A device model runs it on the device. Its start screen says: “Runs on this device: keep Drusite open until it’s done.”
7.6 Long recordings
- Audio longer than 10 minutes is cut into parts of about 10 minutes, each cut at a pause near the mark, so no word is split. Each part is under every provider’s upload limit (OpenAI’s is 25 MB).
- Parts are sent one at a time, each with the end of the previous part’s text as context, so names and spellings carry over. Timestamps continue across parts.
- Progress shows by part: “Transcribing: part 3 of 7”.
- A part that fails is retried three times, waiting longer each time. If it still fails, the meeting shows “Part 4 of 7 failed: (reason). Try again”, and only that part is sent again. The parts that worked are kept.
- A transcript too long for the summary model is summarised in pieces, and then the pieces’ summaries are combined.
7.7 The page
The page is laid out like Notion’s meeting notes:
- Title: “Meeting, 28 Nov 2026” at first. When it’s done, it becomes a short title the summary model suggests (“Budget review: Q1 hiring”), unless you renamed the page yourself.
- Properties: Date, Attendees and Duration. Attendees is filled with the names the summary model heard. You can edit it.
- A meeting block with three tabs, Summary · Notes · Transcript, a quiet tab bar like the
database view tabs. The status bar (§7.8) sits just above the tabs. The tab you last chose is
remembered on this device.
-
Notes is where you type during the meeting, and it opens first while recording. The summary uses it as a hint and never changes it.
-
Summary opens first once it’s done:
- a few short paragraphs;
- Decisions, a bulleted list, left out when there are none;
- Action items, as to-dos with the person’s name in the text when it was said (“Sam: send the draft by Friday”). Under them, Add to a task board…: you pick a database, and each item becomes a row there, titled with the item and linking back to the meeting.
At the foot, in grey: “Transcribed by X · Summarised by Y”.
-
Transcript has the audio player, then paragraphs like “
00:03:12Speaker 1: …”. Clicking a timestamp plays the audio from there.
-
- Each tab holds ordinary blocks: editable, searchable, and readable by Ask. Below the meeting block the page is an ordinary page.
- If nothing was heard (silence, or a muted mic), the Summary tab says: “No speech was heard in the recording. Check that the right microphone is chosen and not muted, then record again.” The audio is kept, so you can check it. Notion shows the same case in your screenshot.
- Markdown copy and export: a meeting block becomes three headings:
## Summary,## Notesand## Transcript.
Summarise again (the page’s “…” menu) can use another model. If you’ve edited the summary sections it asks first: “Replace the summary, decisions and action items you edited?” Your notes and the transcript are never replaced.
The summary prompt is built in. It asks for the sections above, in the meeting’s language, from the transcript and your notes only, with no made-up names or dates. Settings → Meetings has one text box, “Extra instructions for summaries”, added to the prompt (e.g. “Use British spelling”).
Journal entries aren’t touched. A meeting has a Date, so a journal query or view can show the day’s meetings, but nothing is written into your journal.
7.8 Progress and failure
The status bar at the top of the meeting page and the database’s Status property always agree:
| State | The bar says | You can |
|---|---|---|
| Recording | ● 12:04, level meter | Pause, Stop |
| Uploading | “Uploading audio: 40%” | Cancel (keeps the audio on this device) |
| Transcribing | “Transcribing: part 3 of 7” | Cancel |
| Summarising | “Writing the summary…” | Cancel (keeps the transcript) |
| Done | (bar disappears) | |
| Failed | “Transcription failed: (reason).” | Try again, Choose another model |
The audio is never thrown away by a failure. It’s kept on the device until the server has it, and kept with the page after that. A server job that was interrupted by a restart picks up where it stopped.
7.9 Privacy and consent
- Before the first recording on each device, a sheet: “Before you record. Tell everyone in the meeting that you’re recording. In many places the law requires their consent. The audio is saved with the meeting page and synced to your server. To make the transcript and summary it’s sent to the models you choose, which are named before you start.” Got it.
- The start screen always names where audio and transcript go (§7.1).
- While recording, the red dot and time are always visible in the app, and the OS shows its microphone indicator.
- Meeting pages are ordinary pages: Ask can read them and agents can see them, under the same rules as other pages. The transcript isn’t logged anywhere. The audit log records only the provider’s host, the model, the feature (“transcription”) and the size.
8. Server config
The server can offer several models, and [ask.chat] keeps working:
[[ai.providers]]
id = "lab" # stable: saved choices refer to it
name = "Home lab" # what the apps show
kind = "openai-compatible"
base_url = "http://llm.internal:4000/v1"
api_key_file = "/run/secrets/llm"
# Which models to offer. "listed" offers everything the endpoint lists; or name them:
models = [
{ id = "big-model", name = "Big model" },
{ id = "whisper-large-v3", use = "transcription" },
]
[ai.defaults]
chat = "lab/big-model"
transcription = "lab/whisper-large-v3"
[ai.accounts]
enabled = true # people may add their own providers (§2)
reach = "public" # "public": public internet addresses only; "any": private ones too
- The config and the UI work side by side. Providers in the config (or in a Kubernetes
manifest, through the config file,
DRUSITE__AI__…environment variables, and*_filesecrets) show in the app as “Server”, read-only, marked “Set in the server’s config”. Providers you add in the UI show as “Account”. The menu lists both together. Nothing in the config is required, and a server with no AI config still lets people add their own, if[ai.accounts]allows it. Server providers are managed only in the config, so a GitOps deployment stays the one source of truth, and the UI can’t change them. [ask.chat], if set, becomes one more server provider with one model, and it’s the default chat model unless[ai.defaults]says otherwise. Existing deployments work unchanged; moving to[[ai.providers]]is optional.reach = "public"stops people on a shared server from pointing it at addresses inside its own network. A home lab where the owner is the only user sets"any".[search.embeddings]is unchanged.
8.1 How keys entered in the UI are kept on the server
The server protects account provider keys with the same envelope encryption it uses for workspaces:
- Encrypted at rest. Each account gets its own 32-byte data key, and every API key is sealed
with it (XChaCha20-Poly1305). That data key is stored only wrapped by the server’s master key
source: the
envorfilekey, or a KMS (OpenBao/Vault Transit), where the master key never leaves the KMS. A database dump or backup on its own holds only ciphertext. - Tied to its row. The sealed key is bound to the account, the provider and the provider’s address. A ciphertext copied into another row, or onto another address, fails to open.
- Write-only. No API ever returns a key, to any app or to the server’s owner through the app. Apps see only the last four characters.
- The key goes only to the address it was saved with. Changing a provider’s address clears its key, and you have to enter it again. Otherwise a stolen session could point the provider at another host and collect the key.
- Opened only at the moment of a call. The key is decrypted in memory for that one request and wiped afterwards (zeroized). It’s never logged, never put in traces or error messages, and never stored in plain text in Postgres or S3.
- Gone when you’re done. Removing a provider deletes its key. Deleting the account deletes its data key, so anything left behind can’t be opened. Rotating the master key works as it does for workspace keys: the new one, put first, wraps new account keys, and the old ones still open what they wrapped.
- Who can still read it: someone holding both the database and the master key (or access to the KMS) can, as with your notes. That’s the trade-off of keeping it on the server. A key you don’t want on the server stays a “This device” provider. On the device it’s kept in the store encrypted by SQLCipher, with that store’s key in the OS keychain or keystore.
9. Error messages
They’re written for the person reading them, and each says what to do next.
| When | Message |
|---|---|
https//host/v1 | “The address is missing a colon after https. Did you mean https://host/v1?” (clicking fixes it) |
host/v1 | “Addresses start with https:// or http://. Did you mean https://host/v1?” |
ftp://… or another scheme | “Addresses start with https:// or http://.” |
| A space in the address | “The address has a space in it.” |
http:// to a public address | Warning, not an error: “Your key will be sent unencrypted. Use https:// unless this is on your own network.” |
/models is 404, but works under /v1 | “Found it at https://host/v1. Use that?” |
The name can’t be found from this device, ending in .cluster.local, .svc, .internal or .lan | “This device can’t find gateway.ai.svc.cluster.local. Names like this only work inside their own network. Use an address this device can reach, or keep the provider in your account so your server calls it.” |
| The name can’t be found (other) | “Couldn’t find host. Check the address and your connection.” |
| Connection refused | “Nothing answered at host:port. Is the server running?” |
| Timeout | “host didn’t answer within 10 seconds.” |
| Untrusted certificate | “host’s certificate isn’t trusted by this device. If it’s your own certificate authority, install it on this device first.” |
| 401 | “The provider didn’t accept the key. Check it, or make a new one.” |
| 403 | “The key works, but isn’t allowed to use model.” |
| 404 for a model | “The provider has no model called model. Refresh the list or check the id.” |
| 413 | “The audio part was too big for provider.” (parts are cut small enough, so this means a provider limit lower than usual. Retrying cuts the parts smaller.) |
| 429 | “provider is limiting requests. Trying again in 30 seconds…”, then “…still limited. Try again later.” |
| 5xx | “provider had a problem (error 502). Try again, or choose another model.” |
Account provider blocked by reach | “Your server only calls public addresses for your own providers. Keep this one on this device, or ask the server’s owner to allow private addresses.” |
| A model that can’t transcribe | “model doesn’t take audio. Choose a transcription model.” |
| Microphone denied | §7.2 |
10. Migration
- Device providers stay as “This device” providers, with their keys untouched.
- The device’s old Chat choice (provider plus a typed model id) becomes that provider’s first ticked model, so it shows in the menu. It does not become your default. Ask used the server’s model before, and it still starts with that.
- The old Embeddings choice stays in the store, and the row is gone (§3).
[ask.chat]becomes a server provider with one model and the default (§8). Saved chats and their answers keep their model labels, and their model is the server’s default.- Older servers with a new app: the menu shows the old server’s one model and your device models. Device models are greyed with “Your server is too old for this (needs 0.1.0-alpha.8)”, because they need the new context step. Account providers and meetings need the new server too, and say so.
- Older apps with a new server: they keep showing the default model and answering with it, as today.
- Database migrations add: account providers (key sealed with the master key), each provider’s ticked models, the model per chat, defaults per account, and meeting jobs and their parts.
11. Tests
| What | How |
|---|---|
| Model listing per vendor | drusite-ai against fakes of each API (the existing adapters.rs style): Anthropic, OpenAI, Google (paged), Mistral, OpenRouter, and OpenAI-compatible as LiteLLM, Ollama, vLLM and llama.cpp each answer, quirks included. |
| Use-for guessing | Unit tests over real-world model ids. |
| Address checks | Unit tests for every row of §9, in Rust and in the UI’s in-memory core, which must give the same messages. |
| Transcription | /audio/transcriptions (multipart, verbose_json and plain), Gemini with inline audio, a server without timestamps asked again for plain text, providers without audio. |
| Chunking | Made-up audio (tones with silences at known places): cuts land in silences, parts stay under the size, timestamps line up, a failed part retries alone. |
| Server | On Postgres in CI: several server models, account providers (key sealed, never returned), the reach rule (private addresses refused), Ask with a chosen model, the device-model flow (context, then saving the answer), model-gone fallbacks, meeting jobs that survive a restart, permission checks on everything. |
| Self-hosted, for real | A Linux CI job runs real self-hosted servers, not fakes: Ollama with a small chat model, and Speaches (faster-whisper) with its tiny model. Ask answers through it; a synthetic spoken clip (made with a TTS tool at build time, never real recordings) is transcribed and summarised into a meeting page. |
| UI | Playwright on the in-memory core: the menu (groups, search, keyboard, greyed rows, the “isn’t available any more” note), Settings → AI (add, list, tick, add by hand, errors), the meeting states from §7.8. The same tests run against the web app in Chromium and WebKit. Browser recording uses Chromium’s fake microphone. |
| Desktop apps | The existing CI matrix (macOS, Windows, Linux) builds and runs the core tests. The native recorder is tested with a file standing in for the microphone. |
| Phones | The Android build in CI. The iOS build checked locally. |
| By hand, on real devices | The microphone prompts, recording with the screen locked, a call interrupting on iOS, and the Android notification. You’d run these, since I don’t approve permission prompts on your Mac. I’ll write the checklist into the PR. |
No real notes or recordings go in the repo. Test pages and audio are synthetic.
12. Not in this PR
- Asking from the device’s own copy while offline.
- On-device models (still “Later” on the roadmap).
- Renaming speakers, and live transcription while recording.
- Calendar integration: Notion’s “Event” property, naming a meeting after its calendar event.
- The size warning before a recording reaches the server’s limit (§7.4).
13. Open questions
- Account providers, with keys kept on your server. Recommend yes. You add a provider once and get it on every device and in the browser. Meeting jobs keep going with the app closed, and the server can reach cluster-only addresses. The cost is that the key lives on the server (encrypted, never sent back to apps), alongside notes it already holds. Without them, the browser gets only the server’s models, and a provider has to be added on each device.
- Recording the computer’s sound on desktops (the other side of a call): ScreenCaptureKit on macOS (a second permission, “Screen & System Audio Recording”), WASAPI loopback on Windows, the monitor source on Linux. Phones can’t do it at all. Decided: built in the follow-up PR with the native recorders (§7.2), behind a switch on the start sheet.
- Keep the audio after transcribing? Recommend keep by default, with Delete audio on each meeting and a Settings › Meetings switch “Delete audio after transcribing”. Keeping it lets you re-transcribe with a better model, or check what was said. It costs about 15–30 MB an hour of storage.
- Where meetings live: recommend the Meetings database in the sidebar (§7.1), plus the slash command that links one in from any page. The alternative is Notion’s way: a meeting block inside whatever page you’re on, with no central list.
reachdefault for account providers on a fresh server: recommend"public", so a shared server can’t be pointed at its own network. Your own deployment would set"any"so it can reach your cluster’s gateway. That’s a one-line change in your deploy config, not in this repo.