Use local LM Studio models in VS Code chat through the LanguageModelChatProvider API.
This extension discovers chat-capable models from LM Studio, exposes them to VS Code under the lmstudio vendor, and forwards chat requests to LM Studio's OpenAI-compatible /v1/chat/completions endpoint.
- Automatic model discovery from LM Studio
- Uses LM Studio context metadata instead of hardcoded placeholder limits
- Filters out embedding-only models from chat registration
- Refreshes available models on demand with a cached fallback
- Includes built-in diagnostics for provider and model visibility
- VS Code
1.90.0or later - LM Studio running locally or on a reachable host
- LM Studio API enabled, defaulting to
http://localhost:1234 - GitHub Copilot Chat installed in VS Code
npm install
npm run compileThen press F5 in VS Code to launch an Extension Development Host.
Package and install the extension:
npx vsce packageThen install the generated .vsix in VS Code.
Set the LM Studio base URL in your VS Code settings if you are not using the default host:
{
"lmstudio.apiBase": "http://localhost:1234",
"lmstudio.enableExperimentalAgentMode": false,
"lmstudio.requestTimeoutSeconds": 120
}http://localhost:1234 is the built-in default. If you use a different host, IP, or port such as http://localhost:12345, set lmstudio.apiBase directly or use LM Studio: Connection Settings and the extension will use that saved value.
lmstudio.enableExperimentalAgentMode is off by default. This keeps LM Studio models available for normal chat, but hides them from agent/autopilot mode unless you explicitly opt in. Local runtimes like LM Studio and Ollama can loop, unload, or stall during tool-heavy agent turns, so the extension now treats agent mode as experimental.
- Start LM Studio.
- Make sure the LM Studio local server is enabled.
- Open VS Code with this extension installed.
- Open chat and pick an LM Studio model from the model selector.
For normal chat, nothing else is required. If you want LM Studio models to appear in agent/autopilot mode too, enable lmstudio.enableExperimentalAgentMode and fully restart VS Code.
If you changed the extension manifest or installed a new .vsix, fully restart VS Code instead of using Reload Window.
LM Studio: Run DiagnosticsLM Studio: Test Available ModelsLM Studio: Connection Settings
The Manage LM Studio... button in VS Code model management opens the same connection settings panel.
curl http://localhost:1234/api/v1/modelsYou should see LM Studio's model inventory. Chat models should have type: "llm". Embedding models are intentionally ignored by this extension.
Use LM Studio: Run Diagnostics from the Command Palette. The output shows:
- whether the extension is active
- which models the extension discovered from LM Studio
- which models VS Code currently sees under the
lmstudiovendor
- Confirm LM Studio is reachable at the configured URL.
- Confirm you restarted VS Code after installing or updating the extension.
- Confirm the diagnostics command lists the expected models.
- If diagnostics finds models but the picker does not update, close all VS Code windows and launch VS Code again.
- Leave
lmstudio.enableExperimentalAgentModeoff unless you specifically want to test local tool calling. - If you do enable it, prefer models that report tool-use capability in LM Studio and keep
lmstudio.requestTimeoutSecondshigh enough for your hardware. - If LM Studio or Ollama repeatedly loops in agent/autopilot mode, switch back to normal chat for local models. This is usually a local runtime/tool-calling limitation, not a connection problem.
npm install
npm run compile
npm run watchsrc/extension.tsregisters the provider and commandssrc/lmstudio-provider.tsdiscovers LM Studio models and serves chat responsespackage.jsondefines the extension manifest and contributions
MIT