Setup guide - From LM Studio and GitHub Copilot docs
Use LM Studio in GitHub Copilot
VS Code chat (GitHub Copilot) supports bring-your-own-key models through the Custom Endpoint provider, which speaks Chat Completions, Responses or Messages. LM Studio documents OpenAI-compatible /v1/chat/completions and /v1/responses plus Anthropic-compatible /v1/messages at http://localhost:1234, so you combine the two.
Last verified 6 steps5 official sources
Steps
- Step 1.
Start LM Studio's local server (LM Studio docs).
Terminallms server start --port 1234 - Step 2.
In VS Code, open the Language Models editor: select Manage Language Models (gear icon) from the language model picker, or run Chat: Manage Language Models from the Command Palette.
- Step 3.
Select Add Models, then select Custom Endpoint from the list. Enter a group name, then a display name and API key for the endpoint.
- Step 4.
Select the API type: Chat Completions, Responses, or Messages. Make sure the model supports this API type. VS Code opens a chatLanguageModels.json file where you configure the model details.
- Step 5.
Example model entry, combining VS Code's documented Custom Endpoint schema with LM Studio's documented chat completions URL and model id (illustrative, not copied from either page as a whole).
JSON[ { "name": "LM Studio", "vendor": "customendpoint", "apiKey": "${input:lmstudioApiKey}", "apiType": "chat-completions", "models": [ { "id": "openai/gpt-oss-20b", "name": "gpt-oss-20b (LM Studio)", "url": "http://localhost:1234/v1/chat/completions", "toolCalling": true, "vision": false, "maxInputTokens": 28000, "maxOutputTokens": 4000 } ] } ] - Step 6.
Optional: list the model identifiers LM Studio is serving (LM Studio docs).
Terminalcurl http://localhost:1234/v1/models
Caveats
- Combined path: neither GitHub nor LM Studio publishes an LM Studio-in-Copilot guide. VS Code documents the Custom Endpoint mechanism and LM Studio documents the endpoints and model ids. The JSON in step 5 is assembled from both and is not verbatim. The maxInputTokens/maxOutputTokens values are placeholders and must fit the context length you set in LM Studio.
- VS Code docs: 'BYOK applies to the chat experience and utility tasks only.' Inline code completions still use Copilot's own models.
- The VS Code flow asks for an API key. LM Studio needs none unless Require Authentication is on, so any placeholder value should do. This was not verified.
- For a Responses API type against LM Studio, VS Code documents statefulResponses (default true). LM Studio's Responses endpoint advertises prior response state support, but this pairing was not tested.
- The Custom Endpoint provider replaces the deprecated OpenAI Compatible provider, and the github.copilot.chat.customOAIModels setting is deprecated.
More setup guides
Same tool, other providers
Related reading
- LM Studio Bionic: A Local-First AI Agent for Open ModelsLM Studio launches Bionic, a standalone agent harness for open models with local inference, voice input, and zero data retention cloud options.
- Ollama vs LM Studio vs vLLM vs llama.cpp: Picking a Local Runtime for Coding AgentsOllama vs LM Studio vs vLLM vs llama.cpp for coding agents: what each local runtime is for, where they overlap, and which to pick for your setup.
- Claude Code vs Codex vs Copilot CLI: Local Sandboxes ComparedCopilot CLI local sandboxing is GA. How it compares with Claude Code and Codex on defaults, network, credentials, Windows, and what still runs outside.
- GitHub Copilot CLI With Ollama: Local Models and the New SandboxCopilot CLI 1.0.94 finds local Ollama models from /model and ships an OS-level sandbox. Setup, the 4k context trap, and why local is not offline.
- Claude Sonnet 5.5 Developer Guide: Pricing and API ChangesClaude Sonnet 5.5 costs $2/$10 per million tokens, and cache reads fell to $0.10 on October 7 - half of Opus 5.5 on every line. Pricing math and API changes.
- GitHub Copilot's September Reset: Prepaid Seats, One Unified Agent Experience, Balanced Reviews by DefaultGitHub Copilot September changes: prepaid Business and Enterprise seats, one unified agent experience and Balanced reviews by default. What it means for teams.
FAQ
How do I use LM Studio in GitHub Copilot?
VS Code chat (GitHub Copilot) supports bring-your-own-key models through the Custom Endpoint provider, which speaks Chat Completions, Responses or Messages. LM Studio documents OpenAI-compatible /v1/chat/completions and /v1/responses plus Anthropic-compatible /v1/messages at http://localhost:1234, so you combine the two.
Which LM Studio model ids work in GitHub Copilot?
The official docs read for this guide list openai/gpt-oss-20b and ibm/granite-4-micro. Requests go to http://localhost:1234/v1.
Is this an official LM Studio and GitHub Copilot setup?
The steps draw on both LM Studio's and GitHub Copilot's docs. It was last checked against 5 official pages on October 17, 2026.
Sources
Last verified against 5 official pages.
- code.visualstudio.comhttps://code.visualstudio.com/docs/agent-customization/language-models
- lmstudio.aihttps://lmstudio.ai/docs/developer/openai-compat
- lmstudio.aihttps://lmstudio.ai/docs/developer/openai-compat/chat-completions
- lmstudio.aihttps://lmstudio.ai/docs/developer/openai-compat/models
- lmstudio.aihttps://lmstudio.ai/docs/integrations/claude-code
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.