Connect Ollama to Cursor
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
- Run
ollama listto confirm your model is downloaded. - Ollama serves an OpenAI-compatible API at:
http://localhost:11434/v1
3. Connect Cursor to localhost
- Open Cursor Settings (Ctrl+Shift+J / Cmd+Shift+J).
- Go to Models.
- Enable Override OpenAI Base URL and paste the Ollama URL above.
- If Cursor asks for an API key, use any placeholder such as
ollama. - Add a model with the exact Ollama tag:
llama3.1
- Select the model in chat and send a test prompt.
Troubleshooting
- Connection refused — start Ollama and run
ollama serveif needed. - Model not found — the name must match
ollama listexactly. - Slow or out of memory — try a smaller model or check VRAM on the model card.