Use Ollama in Apple Mail
MailTwin is a menubar assistant for Apple Mail. Its provider setting lets you point the writing at a model running on your own Mac. This page covers Ollama, which MailTwin lists as Local (Ollama). If you serve models some other way, see the LM Studio, llama.cpp and oMLX guide or the full provider guide.
What you need
- A Mac running macOS 13 or later.
- MailTwin installed, with Apple Mail set up as usual.
- Ollama installed and running.
- A model pulled into Ollama. A recent 7–14B instruct model is a sensible size for email replies on most Apple Silicon Macs. MailTwin’s default model name for Ollama is
llama3.1, and that is the name the app checks for unless you change it (see the note under step 4).
Setup
- Install and start Ollama. Install it from ollama.com and make sure it is running. By default it listens on
127.0.0.1:11434, which is also MailTwin’s default address. MailTwin’s own Install Ollama button in the provider card opens the download page. - Pull a model. In Terminal run
ollama pull llama3.1. MailTwin’s in-app hint for this provider suggests exactly that command. - Open the provider settings. In MailTwin, right-click the menubar icon, choose Settings, then AI and Providers, and open the Local (Ollama) card.
- Check the Server URL. The Server URL field shows
http://127.0.0.1:11434. Leave it as is if Ollama is on its default port. If you left the field empty, MailTwin uses the same address. Press Return in the field to re-check.
Model note: the Local (Ollama) card has no model field. It asks Ollama forllama3.1. A tag such asllama3.1:8bcounts as a match when you asked for the bare name. To run a different Ollama model, use the OpenAI-compatible path described in the LM Studio guide with Ollama’s/v1address, where you can type any model id. - Test it. Click Test. The card shows the result, and the status line above it shows what is missing if anything is.
- Make it the active provider. Click Make active (the button is hidden when Local (Ollama) is already active). MailTwin never switches provider on its own.
How to check it is working
- The provider status reads Ready. MailTwin gets this by asking Ollama for its installed models (
/api/tags) and confirming the model it needs is on the list. No email text is involved in that check. - In Apple Mail, select a message, press ⌘⇧M to open the MailTwin panel, type a few keywords and generate a reply. Ollama’s own log, or
ollama psin Terminal, should show the model loaded while it works. - Replies from this provider arrive when the model has finished. MailTwin’s Ollama integration makes a single non-streaming request, so you will not see text appear word by word.
- Settings → Privacy lists each request MailTwin made, which is a way to confirm the provider and model that answered.
Troubleshooting
These are the messages MailTwin shows, with the cause behind each.
“Ollama is not reachable. Start or install Ollama, then check the server address in Settings → AI → Providers.”
Nothing answered at the address. Ollama is either not running or listening on a different port. Start it, or correct the port in Server URL.
“MailTwin could not verify the Ollama server address or response.”
Something answered but not in the format Ollama uses, or the address could not be turned into a request. Check that the address is just the host and port, for example http://127.0.0.1:11434, and that no other program is using that port.
“For privacy, Local (Ollama) only connects to this Mac. Use localhost, 127.0.0.1, or ::1 as the server address.”
MailTwin refuses any other host before it builds a request. The rules are: scheme http or https; host localhost, 127.0.0.1 or ::1; no username or password, query or fragment; and no path for Ollama. An address on another machine, a LAN name or a tunnel hostname is rejected, so a remote Ollama is not supported by this provider.
“Ollama is running, but the selected model ‘…’ is not installed. Pull that model or choose an installed model.”
Ollama answered, but the model list does not include the model MailTwin asks for (llama3.1 by default). Run ollama pull llama3.1, or use the OpenAI-compatible route to choose another model.
What runs where
With Local (Ollama), the model runs inside Ollama on your Mac. When you ask for a reply, MailTwin sends the request, including the email text it needs for that action, to the address in Server URL. The code accepts only a loopback address for this provider, does not follow redirects, and checks the address before building the request, so a non-loopback value never receives email text. No MailTwin server is involved in the AI request: MailTwin has no AI proxy.
This describes the AI request only. It does not cover other things Ollama itself may do, such as downloading models when you pull them.
Frequently asked
Does MailTwin work with Ollama in Apple Mail?
Yes. MailTwin has a built-in Local (Ollama) provider. Install Ollama, pull a model, select it in Settings → AI → Providers, and generate replies from the MailTwin panel beside Apple Mail.
Can I use a remote or LAN Ollama server?
No. The Local (Ollama) provider only connects to localhost, 127.0.0.1 or ::1 on the same Mac, and refuses any other address before building a request.
Does it need an API key?
No. Local (Ollama) needs no key. The separate Local (OpenAI-compatible) provider has an optional key field for servers that ask for one.
Trial
The 30-day trial covers this provider. Get MailTwin. For the other providers, see the provider guide.