Guide

Use Your Android Phone as a Local LLM in VS Code

Continue, Cline and Roo Code all accept an OpenAI-compatible provider, and Windsurf can point custom OpenAI model endpoints at a LAN address. This guide shows the values to enter so those tools talk to a model served from your phone.

Updated 7 min readBy FreeRouter Team

If you already use a coding assistant inside VS Code, you probably have a provider setting that accepts a base URL. That one setting is all you need to use your phone as the model server. Ollama Local AI exposes an OpenAI-compatible API on your local network, so the work here is mostly copying three values into the right fields and checking that the machine running VS Code can reach the phone.

How VS Code extensions reach the phone

VS Code itself does not talk to a model. An extension does, and it sends HTTP requests from the machine where the extension runs. For a phone endpoint to work, that machine must be on the same Wi-Fi network as the phone. This matters if you use a remote development setup, such as a container, a remote SSH host or a cloud workspace: the extension then runs on the remote side, so the remote machine, not your laptop, needs a route to the phone's local address. A cloud workspace usually has none, so use a local VS Code window for this setup.

Start the server and collect three values

On the phone, open Ollama Local AI, pick a local GGUF model (or add cloud provider keys), and tap Start Server. Note the endpoint the app shows, which looks like http://192.168.1.50:8080/v1 (an example only). You need three things for every tool below.

ValueWhat to enterWhere it comes from
Provider typeopenai (or the option labeled OpenAI-compatible)The phone speaks the standard OpenAI-style API.
Base URL (apiBase or baseUrl)http://<PHONE_IP>:<PORT>/v1Shown in the app after the server starts.
Model<MODEL_ID>The id returned by GET /v1/models.

Most tools also show an API key field. Enter a placeholder such as local-lan if it cannot be left empty.

Field names, menu paths and file formats change between extension versions. The names used on this page are generic. Treat them as a guide to what each field means and check the current documentation of your extension for the exact spelling.

Check the endpoint before configuring anything

Run these from the computer that runs VS Code. They separate network problems from extension problems, which saves a lot of guessing.

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

Copy an id from the second response; that is your <MODEL_ID>. For background on how the endpoint works, see the OpenAI-compatible API guide.

Continue

Continue keeps its models in a configuration file that you open from the extension. In the JSON form of that file, a model entry for the phone looks like this:

{
  "models": [
    {
      "title": "Phone (Ollama Local AI)",
      "provider": "openai",
      "model": "<MODEL_ID>",
      "apiBase": "http://<PHONE_IP>:<PORT>/v1",
      "apiKey": "local-lan"
    }
  ]
}

Current releases of Continue use a YAML configuration file instead, and the JSON form above belongs to older releases. The same ideas apply: a provider of openai, a model, an apiBase and an apiKey.

models:
  - name: Phone (Ollama Local AI)
    provider: openai
    model: <MODEL_ID>
    apiBase: http://<PHONE_IP>:<PORT>/v1
    apiKey: local-lan

Use whichever format your installed version creates, and check the Continue documentation if a field is not accepted.

Cline and Roo Code

These two extensions are configured from their settings panels rather than a file. The idea is the same in both.

  1. Open the extension's settings and choose the OpenAI-compatible API provider option.
  2. Set the Base URL field to http://<PHONE_IP>:<PORT>/v1.
  3. Enter a placeholder in the API key field, such as local-lan.
  4. Enter the model id from GET /v1/models in the model field.

Both are agent-style tools that can run multi-step tasks, so they send longer prompts than a plain chat window does. Start with a simple request to confirm the connection before you hand over a larger job.

Windsurf

Windsurf can point custom OpenAI model endpoints at the phone's LAN address. Where available in your version, add a custom OpenAI-compatible model, use the phone endpoint as its address and the id from /v1/models as the model name. Because the way Windsurf exposes custom endpoints has changed over time, follow its current documentation for where to enter these values.

Choosing a model for editor work

A model small enough to run on a phone has limits, and editor tools expose them quickly. Some things to keep in mind:

  • Context length: sending whole files or many files can exceed what a small model handles. Select less code at a time.
  • Tool calling: agent features that depend on structured tool calls work better with some models than others. If an agent loops or ignores instructions, test the same prompt in plain chat first.
  • Latency: inline autocomplete needs very quick responses. Chat and explain-this-code requests tolerate waiting better on a phone.
  • Cloud fallback: because Ollama Local AI is a gateway, you can add a cloud provider in the app (the Cloud tab includes NVIDIA, OpenAI, OpenRouter, Gemini, Claude, Ollama and Custom) and keep the same endpoint in your extension. See how to run an LLM on Android for when each choice fits.

Troubleshooting

  • Timeouts: confirm the phone and computer share a network. Guest Wi-Fi networks often isolate clients from each other, and a VPN on the computer can send local traffic elsewhere.
  • Connection refused: check that the server is running in the app and that the port in your extension matches the one the app shows.
  • 404 errors: the base URL must end in /v1. Some extensions add the rest of the path themselves, so do not append /chat/completions to it.
  • TLS or certificate errors: use http, not https, for a local network address.
  • Model errors: the model id must match the response from /v1/models exactly, including case.
  • Stops working later: the router may have given the phone a new address. Read the endpoint in the app again, or reserve a fixed address for the phone in your router.
  • Works with curl, not the extension: compare the field names against the extension's current documentation, since they vary between versions.

Keep the phone endpoint private

Use the endpoint only on a network you trust. Do not forward its port through your router or expose it to the public internet. Ollama Local AI is an independent app by FreeRouter Team, available on Google Play, and is not affiliated with Microsoft, Continue, Cline, Roo Code, Windsurf or any provider mentioned here. For Cursor specifically, see the Cursor setup guide, or return to the home page.

Frequently asked questions

Which VS Code extensions can use the phone endpoint?

Any extension that lets you set an OpenAI-compatible provider with a custom base URL can use it. The Ollama Local AI listing names Continue.dev, Cline and Roo Code, and Windsurf can point custom OpenAI model endpoints at the phone's LAN address.

Should I set apiBase or baseUrl?

It depends on the extension and its version. Continue uses apiBase in its model configuration, while other extensions label the same setting base URL. Always check the extension's current documentation for the exact field name.

What provider type do I choose?

Choose the OpenAI provider type, or the option labeled OpenAI-compatible, since the phone serves the standard OpenAI-style chat completions API. Then set the base URL to the phone endpoint, ending in /v1.

What API key should I enter?

Many extensions require a non-empty key field. A placeholder such as local-lan is enough for the connection to the phone, while cloud provider keys stay stored on the phone in the app.

Is this an official integration with VS Code or these extensions?

No. Ollama Local AI is an independent app by FreeRouter Team and is not affiliated with or endorsed by Microsoft, Continue, Cline, Roo Code, Windsurf or any provider. It works through the standard OpenAI-compatible base URL setting.

Keep reading

Ollama Local AIAndroid · iPhone coming soon
Install