Guide
AI Language Models in VS Code: Complete 2026 Guide
How to configure, manage and optimize AI language models in Visual Studio Code: GitHub Copilot, bring-your-own-key, auto model selection and local on-device models.
At a glance
- Type
- Guide
- Topics
- Visual Studio Code, GitHub Copilot, Language models
- Evidence
- Vendor-reported claim
- Written by
- Liyam Flexer
Documentation DiscoveryFor automated agent discovery and navigation, see the llms.txt specification.
Visual Studio Code provides access to multiple built-in language models, each optimized for specific development tasks. You can switch models for chat, inline suggestions, and utility tasks, or expand your options by bringing your own API key.
For foundational background on how language models operate, their characteristics, and criteria for choosing the right model, refer to the Language models concepts guide.
Which model access options does VS Code offer?
| Access Method | Setup Complexity | Best For | Authentication Required |
|---|---|---|---|
| GitHub Copilot | Low (Instant) | Standard cloud-accelerated coding, chat, and agent workflows | GitHub Account with Copilot subscription |
| Bring Your Own Key (BYOK) | Medium | Enterprise custom gateways, proprietary models, and specialized APIs | Provider API Key / Secret |
| Local On-Device Models | Advanced | High-security offline coding and zero-cost local iteration | Hardware (GPU VRAM >= 96GB) & GitHub login |
| Model Provider Extensions | Low | Local testing tools (e.g., Ollama, Foundry Toolkit) | Local runtime or extension credentials |
How do you choose how to access models?
Start with the account, credentials, or model architecture that fits your workflow:
- GitHub Copilot Access: Set up Copilot, then select your preferred model from the provider options included in your subscription tier.
- Provider Account or Harness Credentials: Follow the authentication requirements for integrations such as Anthropic Claude or OpenAI Codex.
- API Key or Custom Endpoint: Add a custom provider in the Language Models editor. This configures direct model access rather than a distinct harness.
- Locally Running Model: Integrate a local provider extension like Ollama, or review hardware requirements for Copilot-managed on-device models.
Architecture NoteThe model supplies reasoning capabilities, the harness manages tools and workflow execution, and the access provider controls billing and authentication. Always review harness-specific access requirements before reusing credentials across integrations.
How do you change the model for chat?
Different language models excel at different tasks. Utilize fast, lightweight models for quick syntax edits and simple queries, and high-capacity reasoning models for complex refactoring, architectural planning, or multi-step agent tasks.
To change the active model for chat conversations and inline code editing:
- Find the model pickerLocate the language model picker directly within the chat input field.
- Choose a modelSelect your desired model from the dropdown list.
If the picker displays Models instead of a specific name, open it to verify workspace trust or sign-in status. Learn more about workspace trust and Restricted Mode.
Note for administratorsCopilot Business or Enterprise administrators must explicitly enable preview features by opting into Editor Preview Features in their GitHub Copilot policy settings.
What are the requirements for on-device models?
Running local models like MAI Code 1.1 Flash via Copilot requires an NVIDIA GPU with 96 GB or more of VRAM (or equivalent unified memory), approximately 55 GB of free disk space, and a compatible build of llama.cpp. You also sign in with GitHub. For smaller setups, a local provider extension such as Ollama or the Foundry Toolkit runs models through a local runtime instead.
Evidence in this article Vendor-reported claim A statement made by the company that sells the product. Useful as a lead, not as a finding.
Frequently asked questions
How do I add custom API keys (BYOK) to VS Code chat?
Open the Language Models editor by clicking Manage Language Models (gear icon) in the model picker, select Add Models, choose a built-in provider or Custom Endpoint, and enter your secure API key or endpoint configuration.
What are the hardware requirements for on-device models in VS Code?
Running local models like MAI Code 1.1 Flash via Copilot requires an NVIDIA GPU with 96 GB or more of VRAM (or equivalent unified memory), approximately 55 GB of free disk space, and a compatible build of llama.cpp.
Can organization administrators enforce default models in VS Code?
Yes. Organizations can set starting models for new conversations via setting(chat.defaultModel). The model picker labels these as Org default, though developers retain the ability to switch models for individual active sessions.
How do I change the model for chat in VS Code?
Use the language model picker in the chat input field and select a model from the dropdown. The same picker changes the active model for inline code editing, so you can use fast, lightweight models for quick syntax edits and high-capacity reasoning models for complex refactoring or multi-step agent tasks.
What is the difference between a model, a harness and an access provider?
The model supplies the reasoning, the harness manages tools and workflow execution, and the access provider controls billing and authentication. Review each harness's access requirements before reusing credentials across integrations.
Why does the model picker show "Models" instead of a model name?
Open the picker to verify workspace trust or sign-in status. The label can appear when the workspace is not trusted (Restricted Mode) or you are not yet signed in.
What do Copilot Business and Enterprise administrators need to enable?
Administrators must explicitly enable preview features by opting into Editor Preview Features in their GitHub Copilot policy settings.
Which ways can I access models in VS Code?
Four: GitHub Copilot (a GitHub account with a Copilot subscription), Bring Your Own Key for custom endpoints and proprietary models, local on-device models, and model provider extensions such as Ollama or the Foundry Toolkit.
Related reading
- Category: Coding & development
Sources
- Language models concepts guide Visual Studio Code docs.
- Set up GitHub Copilot in VS Code Visual Studio Code docs.
- Agent harnesses: requirements and setup (Claude, Codex) Visual Studio Code docs.
- Workspace trust and Restricted Mode Visual Studio Code docs.
- Managing policies for Copilot in your organization GitHub Docs.
- llms.txt for the VS Code documentation Visual Studio Code docs.