DGX Spark Owners: Anyone Successfully Connected Ollama to Cursor?

Hello World! :wink:

I’m trying to figure out how to connect NVIDIA DGX Spark’s Ollama instance with Cursor. I already have Ollama running and can successfully access it over the network using curl, but I’m having trouble figuring out how to properly connect it to Cursor.

Any guidance would be greatly appreciated. Thanks!

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.

I appreciate your reply, thank you very much!

the missing piece of the puzzle for me was..
.. one have to expand “API Keys” link to see “Override OpenAI Base URL”, etc

Thanks again!