---
title: "AI Language Models in VS Code: Complete 2026 Guide"
slug: ai-language-models-in-vs-code
description: "How to configure, switch and optimise AI language models in Visual Studio Code: GitHub Copilot, bring-your-own-key (BYOK), and local on-device models."
date: 2026-11-17
last_reviewed: 2026-11-17
status: published
type: knowledge-base
image: ai-language-models-in-vs-code
image_alt: "Cover graphic: AI Language Models in VS Code: Complete 2026 Guide, over a dark blue network of connected points."
tags: [VS Code, GitHub Copilot, BYOK, on-device models, language models, developer tools]
---

# AI Language Models in Visual Studio Code

**In short:** Visual Studio Code lets you switch between cloud models through GitHub Copilot, your own API keys (BYOK) and local on-device models, from one model picker in the chat input. The model supplies the reasoning, a harness coordinates tools and workflow, and the access provider handles authentication and billing; knowing which layer you are changing is most of the configuration.

## Key takeaways

- **Model flexibility:** switch between cloud models (GitHub Copilot), custom API keys (BYOK) and local on-device models.
- **Orchestration layers:** models provide raw reasoning, harnesses coordinate tools and workflows, and access providers handle authentication and billing.
- **Advanced controls:** configure thinking effort, context sizes and auto-model routing from the chat input field or the Language Models editor.

*This guide follows the VS Code documentation, linked under [Sources](#sources); menu names, limits and hardware figures are the documentation's and may change between releases.*

VS Code provides access to multiple built-in language models, each optimised 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 background on how language models work, their characteristics and how to choose one, see the VS Code [language models concepts guide](https://code.visualstudio.com/docs/agents/concepts/language-models).

## Quick comparison: model access and deployment options

| Access method | Setup complexity | Best for | Authentication required |
| :--- | :--- | :--- | :--- |
| **GitHub Copilot** | Low (instant) | Standard cloud-accelerated coding, chat and agent workflows | GitHub account with a Copilot subscription |
| **Bring your own key (BYOK)** | Medium | Enterprise custom gateways, proprietary models and specialised APIs | Provider API key or secret |
| **Local on-device models** | Advanced | High-security offline coding and zero-cost local iteration | Hardware (GPU VRAM of 96 GB or more) and GitHub login |
| **Model provider extensions** | Low | Local testing tools (for example Ollama, Foundry Toolkit) | Local runtime or extension credentials |

## Choose how to access models

Start with the account, credentials or model architecture that fits your workflow:

- **GitHub Copilot access:** [set up Copilot](https://code.visualstudio.com/docs/setup/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, described in the [agent harnesses documentation](https://code.visualstudio.com/docs/agents/run/agent-harnesses).
- **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 such as Ollama, or review the hardware requirements for Copilot-managed on-device models (see the FAQ below).

> **Architecture note:** the model supplies reasoning capabilities, the harness manages tools and workflow execution, and the access provider controls billing and authentication. Review the [harness-specific access requirements](https://code.visualstudio.com/docs/agents/run/agent-harnesses) before reusing credentials across integrations.

## How to change the model for chat

Different language models excel at different tasks. Use 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:

1. Find the language model picker in the chat input field.
2. Select the model you want from the dropdown list.

If the picker shows **Models** instead of a specific name, open it to check workspace trust or sign-in status. See the documentation on [workspace trust and Restricted Mode](https://code.visualstudio.com/docs/editing/workspaces/workspace-trust).

> **Note for organisations:** Copilot Business and Enterprise administrators must explicitly enable preview features by opting into `Editor Preview Features` in their [GitHub Copilot policy settings](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization).

## 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** (the gear icon) in the model picker, select **Add Models**, choose a built-in provider or Custom Endpoint, and enter your API key or endpoint configuration.

**What are the hardware requirements for on-device models in VS Code?**
Running local models such as MAI Code 1.1 Flash via Copilot requires an NVIDIA GPU with 96 GB or more of VRAM (or equivalent unified memory), about 55 GB of free disk space and a compatible build of `llama.cpp`.

**Can organisation administrators enforce default models in VS Code?**
Yes. Organisations can set starting models for new conversations with the `chat.defaultModel` setting. The model picker labels these **Org default**, though developers can still switch models for individual sessions.

## Sources

- Visual Studio Code documentation: [Language models concepts](https://code.visualstudio.com/docs/agents/concepts/language-models), [Set up GitHub Copilot](https://code.visualstudio.com/docs/setup/copilot), [Agent harnesses](https://code.visualstudio.com/docs/agents/run/agent-harnesses), [Workspace Trust](https://code.visualstudio.com/docs/editing/workspaces/workspace-trust).
- GitHub Docs: [Managing policies for Copilot in your organization](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization).
