LM Studio in VS Code — agentic coding with your local models

Connect LM Studio's local server to VS Code with LocalPilot and get an agent that edits files, runs commands and reviews changes — using the GGUF or MLX models you already downloaded.

Ask AI about this page

LM Studio gives you a polished way to download and run GGUF/MLX models with an OpenAI-compatible server. LocalPilot connects to that server and adds the agent layer: tools, file edits, terminal, diagnostics, parallel sessions and change review inside VS Code.

Setup

  1. In LM Studio open the Developer tab, load a model (e.g. Qwen2.5-Coder-14B-Instruct), and click Start Server (default http://localhost:1234).
  2. Install LocalPilot (download VSIX). The lmstudio provider on port 1234 is pre-configured — your loaded models appear in the model picker immediately.
  3. Pick the model and start an Agent chat.

With the lms CLI installed (LM Studio → Developer → Install lms), Settings → Models can also download catalog models straight into LM Studio (lms get) and shows which sizes fit your hardware. Deleting LM Studio models stays in the LM Studio app; you can disable them in LocalPilot instead.

Enable Keep model loaded and raise the server’s context length in LM Studio’s model settings — LocalPilot reads the reported max_context_length to budget its context.

What works

Troubleshooting

Symptom Fix
“No models found” Start the server in the Developer tab; make sure at least one model is loaded
Edits never happen The model lacks tool training — try Qwen2.5-Coder-Instruct or Devstral
Slow responses Enable GPU offload fully; reduce localpilot.maxOutputTokens

Next: Models & providers · Agent, Ask & Plan