Can Cursor use a local model on a Mac? Not directly, and here is why
- Not directly. When you give Cursor your own key and address, Cursor's servers make the request, not your Mac. An address like 127.0.0.1 or localhost then points at the wrong computer. Cursor's help page says it routes these requests through its servers, and a reply on Cursor's forum says localhost and local-network addresses will not work.
- The usual workaround is a public https tunnel (ngrok or Cloudflare Tunnel) in front of your local server. Your prompts then travel through the tunnel and Cursor's servers, which gives up most of the reason to run a model locally. Tab completion stays on Cursor's own models either way.
- To keep the model and the code on your Mac, use a tool that runs on your Mac and calls the model itself: Cline in VS Code, Zed, or Aider in the terminal. Outlier's local API, a Pro feature, is at
http://127.0.0.1:8766/v1for exactly that.
Checked on 2026-10-12. I did not run Cursor against a local model or a tunnel for this page. What it says about Cursor comes from Cursor's own help page and forum. What it says about Outlier I checked in the app's source for 1.11.918. There are no benchmark numbers here, and the receipts at the bottom name every source.
Outlier Pro: $249 once · or 4 × $62.25 · founders price $124.50 while seats last
Free to start (Nano and Lite). macOS 26+, Apple silicon. Refund window: 30 days, no questions asked.
I make Outlier, a local AI app for Mac. Until today our developer page listed Cursor among the tools you could point at Outlier's local API. For Cursor that is wrong, and I have changed the page. This is what Cursor does with a model address of your own, what you can do about it, and what to use if the point is to keep the model and your code on your Mac.
Why a localhost address fails in Cursor
Most coding tools that take a model address run on your Mac and call that address themselves. Cursor does not. When you add your own API key, or change the base URL, the request goes to Cursor's servers first. Cursor's help page for API keys says "all requests are routed through Cursor's servers for final prompt building." The server then calls the address you gave it.
That is why 127.0.0.1 and localhost fail. Those names mean this computer, to whichever computer reads them. When Cursor's server reads one, this computer is Cursor's, and nothing of yours is listening there. A reply on Cursor's forum from February 2026 puts it the same way: localhost is not supported directly, and local-network addresses will not work because the server cannot reach them. A symptom that fits is a local server whose log stays empty, because nothing ever connects to it.
What your own key covers in Cursor, and what it does not
The same help page lists limits that apply even when the address does work. Custom API keys only work with chat models. Tab completion continues using Cursor's built-in models. Cursor's Zero Data Retention policy does not apply to requests that use your own key, so the data terms are the ones of whoever is behind the key. The page does not mention local models at all.
So even a perfect setup would give you your own model in Cursor's chat panel and nothing for Tab completion.
The tunnel workaround, and why I would not use it for a private model
The forum reply suggests exposing the local server as a public https address with ngrok or Cloudflare Tunnel, then pasting that address into Cursor under Settings, Models, Override OpenAI Base URL. I did not try it. I would not, if I were running a model locally to keep my code private.
The model would be local, but the path would not be. Your prompt goes from your editor to Cursor's servers, out to the tunnel's public address, and down to your Mac. The address is public too. A plain Ollama server has no password, so anyone who learns the address could use your Mac to run models.
Outlier would refuse a tunnel anyway. Its engine answers only requests addressed to this Mac: a Host header of 127.0.0.1, localhost or [::1]. Anything else gets a 421 reply. A tunnel normally passes its own public name as the Host, and rewriting it would switch off the check that stops a web page you visit from using your model. I did not try a tunnel with Outlier. I did test the check itself: a request with Host: example.com got the 421. The evidence is on what 127.0.0.1:8766 is.
What to use instead on a Mac
Pick a tool that runs on your Mac and makes the call itself. Cline is an open-source coding agent for VS Code. Zed is an editor that lets you point its AI features at an LLM API address. Aider runs in the terminal. Each takes an OpenAI-style base URL and a key. A request from your Mac to a model on your Mac never leaves it.
A local model will not match the cloud models Cursor uses by default, and predictive completion is the gap you will feel first. The Cursor alternatives page goes through that gap and the options.
Point those tools at Outlier
- In Outlier, open Settings, go to the Advanced tab, find Developer, and switch on OpenAI-compatible API. The app asks you to confirm.
- Copy the endpoint,
http://127.0.0.1:8766/v1, and the API key. The key is hidden until you press Show, and Copy puts it on the clipboard. - In your tool, add an OpenAI-compatible provider with that base URL and key. For the model name use
outlier-compactfor the Core tier, oroutlier-nanofor the fastest one. - Leave Outlier open. The engine stops when the app quits.
The API is part of Pro, $249 once. On the free plan the toggle opens an upgrade card instead, and a request to /v1 comes back 402. The endpoint answers from the model alone: no web search, no memory, no project files. The developers page has working code and says which request fields are honoured, and how to run a local OpenAI API on a Mac has the longer version.
What I did not test
- Cursor itself. Nothing here came from running it. Cursor changes often and the forum reply is from February 2026. If Cursor has added a way to call local models, tell me at matt@outlier.host and I will fix this page.
- A tunnel, with Outlier or with anything else.
- Cline, Zed or Aider against Outlier's API. The endpoint uses the OpenAI request shape and the developers page has working OpenAI SDK code, but I did not set up these three for this page.
- Any Outlier version before 1.11.918 for the Settings path.
Frequently asked questions
Can Cursor use a local model?
Not directly. When you use a custom base URL, Cursor's servers make the request, so an address on your own Mac (localhost or 127.0.0.1) cannot be reached. The workaround is a public tunnel to your local server, which sends your prompts through the tunnel and Cursor's servers.
Why does localhost not work as the OpenAI base URL in Cursor?
Because your Mac is not the computer that reads the address. Cursor's servers build the final prompt and call the URL, and to them 127.0.0.1 means their own computer. Cursor's help page says requests made with your own key are routed through its servers, and a reply on Cursor's forum says localhost and local-network addresses will not work.
Does Cursor Tab work with a local model?
No. Cursor's help page says custom API keys only work with chat models and that Tab completion continues using Cursor's built-in models.
Can I use Ollama or LM Studio with Cursor?
Only through a public tunnel, for the same reason: they listen on your Mac and Cursor's servers cannot reach it. A tunnel makes the server public, so check that it asks for a key. A plain Ollama server does not.
What can I use instead of Cursor for a local model on a Mac?
A tool that runs on your Mac and calls the model itself, such as Cline in VS Code, Zed or Aider, pointed at a local server like Outlier's OpenAI-compatible API at http://127.0.0.1:8766/v1. Outlier's API is part of Pro.
Try Outlier free
Free: Nano + Lite. Pro: $249 once · or 4 × $62.25; $124.50 for the first 25 · or 4 × $31.13. macOS 26+. In the US, Klarna or Afterpay at checkout: four payments, two weeks apart. Refund window: 30 days, no questions asked.
Download free (290 MB) Buy ProOn your phone?