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.
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
- In LM Studio open the Developer tab, load a model (e.g.
Qwen2.5-Coder-14B-Instruct), and click Start Server (defaulthttp://localhost:1234). - Install LocalPilot (download VSIX). The
lmstudioprovider on port 1234 is pre-configured — your loaded models appear in the model picker immediately. - 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_lengthto budget its context.
What works
- Tool calling via
/v1/chat/completionstoolsfor models LM Studio marks as tool-capable; automatic text-protocol fallback otherwise. - Streaming, reasoning content (shown as a collapsible “Thought” step), and
stream_optionsusage reporting for the context meter. - Inline completions through
/v1/completionswith a coder base model. - Vision with multimodal models (Qwen2.5-VL, Gemma 3) for screenshots.
- Multiple models: load a small model for completions and a large one for the agent; LocalPilot lists them both.
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