Run a local LLM model with cursor?

Hey, thanks for the question.

Right now, Cursor doesn’t support directly connecting to local models via localhost. All BYOK requests go through Cursor servers to build prompts, so you need a public HTTPS endpoint.

A workaround is to use tunneling, like https://ngrok.com/ or Cloudflare Tunnel · Cloudflare One docs, to expose your local instance (Ollama, LM Studio, etc.) to the internet. Then set that URL in Cursor Settings > Models > Override OpenAI Base URL.

More setup details in these threads:

The team is aware of the request for native support for local models without tunneling. Let me know if you have any questions setting it up.