Home/FAQ & Glossary/How do I connect my local AI to coding tools like VS Code or Cursor?
FREQUENTLY ASKED QUESTIONsoftware
← Back to FAQ & Glossary

How do I connect my local AI to coding tools like VS Code or Cursor?

Both Ollama and LM Studio run a built-in local server that mimics the OpenAI API, letting you wire them into VS Code, Cursor, or terminal coding agents using a single localhost URL. You do not need a paid API key or an active internet connection—your source code stays 100% on your machine.

Step 1: Turn on your local AI server

  • If using Ollama: The server starts automatically in the background at http://localhost:11434/v1 as soon as you open the app. Open Ollama's Settings and bump the context length to at least 32K–64K so coding extensions do not truncate your files.
  • If using LM Studio: Open the Developer (Local Server) tab on the left sidebar, load your coding model (such as Qwen 3 Coder or Qwen 2.5 Coder), and click Start Server—this exposes the endpoint at http://localhost:1234/v1.

Step 2: Point your editor to localhost

Coding ToolHow to Connect ItBest For
VS Code (Continue.dev)Install the free Continue extension, click the model dropdown, select Ollama or LM Studio, and choose your downloaded model.All-around local coding (autocomplete + sidebar chat + inline edits).
VS Code (Official Ollama / Cline / Roo)Install the official Ollama extension (or Cline / Roo Code for autonomous agents) and pick your local model from the chat selector.Multi-file editing and agentic tasks (requires a 14B–32B+ model with tool-calling support).
CursorOpen Cursor Settings → Models, scroll to OpenAI API Key, enter any dummy text (such as local), toggle on Override OpenAI Base URL, and paste your local /v1 URL. (Note: Cursor requires a public tunnel such as ngrok or Tailscale for custom endpoints whenever its cloud router validates the URL.)Developers already using Cursor who want local chat on sensitive repos.

Two quick tips for a snappy coding setup

  1. Split your models by role (when using Continue): Assign a small, ultra-fast model (such as Qwen 2.5 Coder 3B or 7B) for instant Tab autocomplete, and pair it with a smarter 14B to 32B model for Chat and Refactoring.
  2. Pick a "Coder" or tool-capable model: General-purpose chat models frequently break when coding agents attempt to edit files or run tools. Stick to models specifically trained for code and tool-calling, such as Qwen 3 Coder, Devstral, or GLM-4.

Looking for verified hardware rigs?

Check our real-time £/GB VRAM index to find systems optimized for local model inference.

Explore VRAM Index →
Rent Cloud GPU Power

Not Ready to Buy a Full Rig?

Don't want to spend £3,500+ upfront? Rent the GPU power instead.

Buying a dedicated AI workstation is a serious investment—and if you aren't ready to spend that much right now, you don't have to. Renting cloud GPUs gives you instant access to high-VRAM hardware like RTX 4090s and H100s on demand. Spin up an instance for fine-tuning or running massive 70B+ models, pay strictly for the minutes you use, and avoid the upfront hardware cost, electricity bills, and maintenance.

Vast.ai Global GPU Marketplace

Lowest $/hr
Unbeatable $/hr rates on community-hosted RTX 4090 & 3090 rigs
Deploy Pod →

RunPod Community & Secure Cloud

Community & Secure Cloud
RTX 4090 from $0.34/hr • H100 SXM from $1.99/hr (Billed in USD)
Deploy Pod →

FindBestRig independently benchmarks cloud GPU providers to compare rental economics against physical hardware.