MailTwin
Provider setup

Use LM Studio in Apple Mail

Also llama.cpp and oMLX · OpenAI-compatible local server · Updated 7 November 2026

MailTwin can write and rewrite email in Apple Mail using a model served from your own Mac. LM Studio, llama.cpp’s llama-server and oMLX all expose the OpenAI chat API, and MailTwin talks to them through one provider: Local (OpenAI-compatible). For Ollama’s own provider, see the Ollama guide. The wider picture is in the provider guide.

What you need

Setup with LM Studio

  1. Load a model and start the local server in LM Studio. LM Studio’s server feature is in its Developer view; check LM Studio’s own documentation for the current menu names. Note the address it shows. LM Studio’s usual port is 1234, so the address is typically http://127.0.0.1:1234 (MailTwin’s source comments name 1234 as LM Studio’s port; confirm the one your install shows). If you enable authentication in LM Studio, copy the token.
  2. Open the provider settings. In MailTwin, right-click the menubar icon, choose Settings, then AI and Providers, and open the Local (OpenAI-compatible) card.
  3. Enter the address. In Server URL, type the LM Studio address, with or without /v1 on the end: http://127.0.0.1:1234 and http://127.0.0.1:1234/v1 both work. The field’s default is http://127.0.0.1:8000, which is oMLX’s port, so change it.
  4. Add a key only if the server asks for one. The API key (optional) field is stored in the macOS Keychain. MailTwin sends it as an Authorization: Bearer header, and only when the field is not empty. Leave it blank otherwise.
  5. Choose the model. Open Advanced and look at Model. The default is auto, which uses the first model id the server lists at /v1/models. That is the model already loaded on a single-model server. To pin a model, type its id exactly as the server lists it.
  6. Save and test. Click Save & Test (Save stores the key without testing). The status should read Ready.
  7. Make it the active provider. Click Make active (hidden when Local (OpenAI-compatible) is already active).

llama.cpp (llama-server) and oMLX

These use the same card and the same steps; only the address differs. MailTwin’s source names the default ports as 8000 for oMLX and 8080 for llama.cpp’s server, and the Server URL field accepts whichever port you run.

Ollama through its OpenAI-compatible endpoint

The same provider accepts Ollama’s own /v1 endpoint: enter http://127.0.0.1:11434/v1 as the Server URL. Unlike the dedicated Local (Ollama) card, this route lets you type any model id under Advanced → Model.

How to check it is working

Troubleshooting

“No local server answered. Start your OpenAI-compatible server (oMLX, LM Studio, llama.cpp…), then check the server address in Settings → AI → Providers.”

Nothing is listening at the address. Either the server is not running, or the port is wrong. The most common cause is leaving the default 8000 in place for a server on 1234 or 8080.

“The local server answered, but not with an OpenAI-style model list.”

Something answered at that address, but the response to /v1/models was not an OpenAI-style list. Point the address at the server’s API itself, for example http://127.0.0.1:8000 or …/v1, and not at a web page or another service.

“For privacy, Local (OpenAI-compatible) 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: scheme http or https; host localhost, 127.0.0.1 or ::1; no username or password, query or fragment; and a path of nothing, /, /v1 or /v1/. A LAN address, a hostname for another machine, or a path such as /api is rejected.

“The local server is running but lists no models. Load a model in the server, then check again.”

The server answered with an empty model list. Load a model in the server, then run Save & Test again.

“The local server is running, but it does not list the model ‘…’.”

You typed a model id that the server does not list. Load that model, type an id from the server’s list, or set the model back to auto.

“The local server rejected the request. It needs an API key, or the stored key is wrong.”

The server replied with HTTP 401 or 403. Enter the server’s key in API key (optional) and save.

What runs where

With a local server, the model runs in LM Studio, llama.cpp or oMLX on your Mac. When you ask for a reply, MailTwin sends the request, including the email text needed 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 what the server software itself does, such as downloading models.

Frequently asked

Can I use LM Studio with Apple Mail?

Yes. Start LM Studio’s local server, choose Local (OpenAI-compatible) in MailTwin under Settings → AI → Providers, and enter the server address. MailTwin generates replies from its panel beside Apple Mail.

Which local servers work?

Any server on the same Mac that speaks the OpenAI chat API: LM Studio, llama.cpp’s llama-server, oMLX, mlx-serve, or Ollama’s /v1 endpoint.

What does the model setting auto mean?

auto, the default, uses the first model id the server lists at /v1/models. To pick a specific model, type its id under Advanced → Model.

Trial

The 30-day trial covers this provider. Get MailTwin. For the other providers, see the provider guide.