Hey, you can’t connect to Ollama directly over LAN. In Cursor, Override OpenAI Base URL needs a public HTTPS endpoint because requests still go through our servers, prompt building, context, Tab, and Agent run on our side.
Workaround: expose your local Ollama through a tunnel like https://ngrok.com/ or Cloudflare Tunnel · Cloudflare One docs, get a public HTTPS URL, then paste it into Settings > Models > Override OpenAI Base URL. Then add a custom model name and enable an OpenAI API Key, for Ollama a dummy key is fine.
More details and discussion are in this thread: How can I use a local LLM on my desktop/AI computer?
If you hit a model name validation error when adding the model, like llama3.1:latest not being accepted, try naming the model in Ollama so it matches one of Cursor’s known model names, for example gpt-4o. That’s a known quirk. There’s no ETA yet for native support for local models without a tunnel.