Guide

Use Cursor with a Local LLM on Your Phone

Cursor can send its OpenAI-style requests to any compatible base URL, including the one an Android phone serves on your Wi-Fi. This guide covers the exact settings, how to find the endpoint and model id, and what to check when the connection fails.

Updated 6 min readBy FreeRouter Team

Many coding tools can talk to the same OpenAI-style API, and that is what makes this setup possible. Ollama Local AI turns an Android phone into an OpenAI-compatible server on your local network, and Cursor lets you override the OpenAI base URL. Together they let you point Cursor at the phone instead of a hosted service, as long as your version of Cursor can reach private network addresses. The steps below follow the quick start from the app and add the checks that save time when something does not connect.

What you need before you start

  • An Android phone running Android 8.0 or newer with Ollama Local AI installed (Google Play listing).
  • A local GGUF model loaded in the app, or at least one cloud provider key added in the app. If you are new to model files, see how to run an LLM on Android.
  • A computer running Cursor that is connected to the same Wi-Fi network as the phone.

Step 1: Start the server on the phone

Open the app, pick a local GGUF model (or add your cloud provider keys), and tap Start Server. Leave the phone awake and on Wi-Fi while you work. Android may restrict background apps to save battery, so if the connection drops after the screen turns off, check the phone's battery settings for the app.

Step 2: Find the endpoint

The app shows the endpoint once the server is running. It has three parts: the phone's local IP address, the port, and the /v1 path.

http://<PHONE_IP>:<PORT>/v1

# example only
http://192.168.1.50:8080/v1

Copy the value from the app instead of reusing the example, because your router assigns the address and it can change. If you need to confirm the phone's address independently, the Wi-Fi details screen in Android or the connected-devices list in your router will show it.

Step 3: Verify the endpoint from your computer

Test from the same machine that runs Cursor so you know the network path works before you touch any settings.

curl http://<PHONE_IP>:<PORT>/health
curl http://<PHONE_IP>:<PORT>/v1/models

The first call checks that the server is running. The second returns the models the phone offers, and each entry has an id field. Keep one of those ids handy, because Cursor needs it as the model name. If either command hangs or is refused, fix that before continuing; the troubleshooting section below covers the usual causes.

Step 4: Configure Cursor

  1. Open Settings and go to Models.
  2. In the OpenAI API Key field, enter any placeholder such as local-lan.
  3. Enable Override OpenAI Base URL.
  4. Paste the phone endpoint from step 2, including /v1 at the end.
  5. Add the model id from step 3 as a custom model name if Cursor does not list it already.

Cursor changes its settings screens from time to time, so a label may sit in a slightly different place in your version. Check Cursor's own documentation if a control has moved or if you want to know how your version handles custom base URLs on private network addresses.

Choosing the model id

The model name Cursor sends must match what the phone reports. The id comes from GET /v1/models, not from the display name in the app or from the file name on disk. If you switch the loaded model on the phone, call /v1/models again, because the id in your Cursor settings may need to follow it.

To see exactly what Cursor will send, reproduce one request by hand. This is standard OpenAI-style chat usage:

curl http://<PHONE_IP>:<PORT>/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer local-lan" \
  -d '{
    "model": "<MODEL_ID>",
    "messages": [
      {"role": "user", "content": "Write a one-line docstring for a function that adds two numbers."}
    ]
  }'

If this succeeds, the phone side is working and any remaining problem is in Cursor's configuration.

Using cloud models through the same endpoint

The phone is a gateway, so Cursor does not need to know what sits behind it. In the app, Add Provider has a Cloud tab (NVIDIA, OpenAI, OpenRouter, Gemini, Claude, Ollama and Custom) and a Local tab. After you add a provider, its models are served through the same endpoint, and Cursor keeps the same base URL. Requests to a cloud provider go directly from the phone to that provider. The provider keys stay in AES-256 encrypted storage on the phone, which is why Cursor only needs a placeholder key.

Troubleshooting connection problems

SymptomLikely causeWhat to do
Request times outPhone and computer are on different networksJoin both to the same Wi-Fi network and confirm neither is on a separate guest or IoT network.
Connection refusedServer is not running, or the port is wrongConfirm the server is started in the app and copy the port from the endpoint shown there.
404 or "not found"Missing /v1 in the base URLMake sure the base URL ends with /v1 and has no extra path.
SSL or TLS errorThe URL uses httpsUse http on a local network.
Works on the phone's Wi-Fi but not from the computerGuest-network client isolation, VPN, or a firewallDisable the VPN temporarily, use a non-isolated network, and check the computer's firewall.
"Model not found"Model id does not matchRun GET /v1/models and copy the id exactly.
Worked yesterday, fails todayThe router gave the phone a new IP addressRe-read the endpoint in the app, or reserve a fixed address for the phone in your router.

If curl works from your computer but Cursor still reports it cannot reach the address, the cause may be on Cursor's side: depending on the version and the feature, some requests may be sent from Cursor's own servers rather than from your computer, and those cannot reach a private LAN address. Check Cursor's documentation for how it handles custom base URLs. Do not solve it by publishing the phone to the internet.

Keep the endpoint private

The endpoint is meant for devices on your own network. Do not forward its port on your router, and do not put it behind a public tunnel or reverse proxy. Assume anyone who can reach it could send requests to the models and providers configured behind it, which could use up a metered cloud account. Ollama Local AI is an independent app by FreeRouter Team and is not affiliated with Cursor, OpenAI, Anthropic or any other provider mentioned here.

For other editors, see the VS Code, Continue, Cline, Roo Code and Windsurf guide, or go back to the home page for the full feature list.

Frequently asked questions

What do I enter for the API key in Cursor?

Cursor asks for an OpenAI API key, so enter any placeholder such as local-lan. In the setup described for Ollama Local AI, the key field only has to be filled in; the real credentials for cloud providers are stored in the phone app.

Where do I find the endpoint to paste into Cursor?

Start the server in Ollama Local AI and read the endpoint shown in the app. It looks like http://192.168.1.50:8080/v1, where the address and port are only an example and yours will differ.

How do I find the model id?

Send a GET request to /v1/models on the phone endpoint, for example with curl from your computer. The id values in the response are what you use as the model name.

Can Cursor use a cloud model through the phone as well?

Yes, as long as you add that provider in the app. Ollama Local AI can route to OpenAI, Anthropic Claude, NVIDIA NIM, Hugging Face, OpenRouter, Gemini and custom OpenAI-compatible endpoints, while Cursor keeps using the same phone endpoint.

Is this an official Cursor integration?

No. Ollama Local AI is an independent app by FreeRouter Team and is not affiliated with or endorsed by Cursor. It works because Cursor accepts a custom OpenAI-compatible base URL.

Keep reading

Ollama Local AIAndroid · iPhone coming soon
Install