AI setup (BYOK)
mdai’s AI features are bring your own key: you use your own account with an AI provider, pay them directly for what you use, and mdai talks to them straight from your machine. There is no mdai server in between and no AI subscription on top.
Your key is stored in the operating system keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) — never in a plain config file.
Get a key
Section titled “Get a key”| Provider | Where | Notes |
|---|---|---|
| Anthropic (Claude) | console.anthropic.com → API keys | Prepaid credits |
| Google Gemini | aistudio.google.com → Get API key | Free tier available |
| DeepSeek | platform.deepseek.com | Cheapest per token |
| OpenAI | platform.openai.com → API keys | Prepaid credits |
Typical cost for personal note-editing use is cents per day — you can set spending limits in every provider’s dashboard.
Local AI with Ollama
Section titled “Local AI with Ollama”Ollama runs a model on your own computer: no key is needed and your text never leaves the machine.
- Install Ollama and one model, for example in a terminal:
ollama pull llama3.2 - In the AI panel (⌃⌘4 / Ctrl+Shift+4), choose Ollama under Provider.
mdai uses the first installed model that can write text (embedding models
such as bge-m3 are skipped). Settings → AI → Ollama → Test Connection
checks that mdai can reach it.
Connect it in mdai
Section titled “Connect it in mdai”- Open Settings → AI → pick your provider.
- Paste the API key → Save. mdai stores it in the keychain. Click Test Connection to check that it works.
- Open the AI panel with ⌃⌘4 / Ctrl+Shift+4 (View → Toggle Ask AI) and choose that provider under Provider.
Using it
Section titled “Using it”Open Ask AI, choose Whole document or Section (then the section), and pick an action — or ignore the presets and write your own question.
| Preset | What it does |
|---|---|
| Summarize | A short version of the section you chose |
| Fix grammar | Corrections, with your wording kept |
| Translate to English | The chosen section in English |
Two things stay yours:
- Scope — the selected section, or the whole document. You choose which one leaves the machine.
- The final say — nothing changes your note on its own. Fix grammar and your own prompts arrive as a difference you Accept or Reject. Summarize and Translate give you new text, and each time you choose: New tab puts it in a new tab and leaves your note as it was, Overwrite replaces the text. An accepted change can still be undone with ⌘Z / Ctrl+Z.
Answers in the panel are shown formatted — bold, lists, headings — and arrive in your note as Markdown.
What leaves your machine
Section titled “What leaves your machine”Nothing, until you ask. When you do ask, the text you chose goes to the provider whose key you entered, and nowhere else. With Ollama it does not leave your computer at all. There is no account here, no telemetry on what you write, and no copy of your notes anywhere but your own disk.
Settings → AI says the same in one line: when you use AI, the text you send goes to the AI provider of your key.
Writing never needs a connection, apart from a one-time check when the trial starts and when you activate a license. If you never enter a key, nothing is sent and the rest of mdai works exactly as it did.
Permission before the first request
Section titled “Permission before the first request”The first time you use AI with a provider, mdai asks you to allow it. The block names the provider and says what will be sent — your instruction with the whole document, the section you selected, or the passages Ask vault found, with their file names. Nothing goes out until you press Allow and send.
The answer is stored on your own computer, in mdai’s settings file, never on a server. You can withdraw it in Settings → AI → Withdraw permission; the next AI request asks again. Ollama is not asked, because it runs on your computer.
Switching providers
Section titled “Switching providers”You can store a key for each provider in Settings and switch anytime under Provider in the AI panel. Deleting a key removes it from the keychain immediately.