So guys, there are many options using local llm but the DeepSeek-R1 is drop a weeks ago. If you want use the ollama/local llm in cursor i got u.
First u need a ollama, Ollama then after installing it u need cors for ollama, it required or cursor give 403 Forbidden as u can see we need define OLLAMA_ORIGINS
in windows environment.
Ok, next we need the deepseek-r1 models, i try deepseek-r1:8b because this model have good benchmark the model running on my pc with Nvidia RTX 3070 8GB(enough vram i got 60-70t/s). We can use
ollama run deepseek-r1:8b
then the models start the downloading, if that clear we can quit the ollama via tray icons windows or what ever, we need to close for restarting ollama because we define the cors.
then u can run ollama via start menu.
By default, ollama serve endpoint http://127.0.0.1:11434
but if u direct using the endpoint to cursor i cant be used. so we need ngrok. U can download and login it, then they instruct u to login via auth token.
Next we need ngrok to give public url for ollama.
.\ngrok.exe http 11434 --host-header="localhost:11434"
Then we got the endpoint for OpenAI Public URL
U can check if ur endpoint is active
Ok, we move to cursor
We need define model what we use in cursor, u can check with ollama list
for list of models u have.
On OpenAI Key use ur public url https://xxxxxx.ngrok-free.app
with api key ollama
the u done.
If the step done, we can go try some model with cursor chat.
As u can see, the local llm works properly at some case it not support for compose because cursor only allow antrophic and gpt models.
Top comments (9)
Any idea why it is not working for me??
Isnt that because page will load like this insted of api? Can I somehow bypass this?
Its not necessary, we can try on curl if ollama is running then will be showing mssge "Ollama is running".
Have u ever save the base url? the base url not save automaticlly, and verify.
And, just apply the ollama model

If u check both of model like sonnet and r1:8b its undifined model cause u only have r1 models.
It´s working!
Nice!
I´ve tried also 4ccc-88-101-25-25.ngrok-free.app/v1
Nice!
Thanks!