Connect Ollama to Cursor

Last verified: 2026-08-24 · Example model: llama3.1

1. Install Ollama and pull a model

Follow an install guide for your OS, then pull a model:

ollama pull llama3.1

Pick another model from our Ollama hub or a per-model run guide.

2. Confirm Ollama is running

  1. Run ollama list to confirm your model is downloaded.
  2. Ollama serves an OpenAI-compatible API at:
http://localhost:11434/v1

3. Connect Cursor to localhost

  1. Open Cursor Settings (Ctrl+Shift+J / Cmd+Shift+J).
  2. Go to Models.
  3. Enable Override OpenAI Base URL and paste the Ollama URL above.
  4. If Cursor asks for an API key, use any placeholder such as ollama.
  5. Add a model with the exact Ollama tag:
llama3.1
  1. Select the model in chat and send a test prompt.

Troubleshooting

← Local guides · Ollama hub