How to Pin GitHub Copilot to a Specific Model in VS Code Settings
🔍 WiseChecker

How to Pin GitHub Copilot to a Specific Model in VS Code Settings

When you use GitHub Copilot in Visual Studio Code, the default behavior lets the extension choose which AI model handles your code completions and chat responses. This can lead to inconsistent output quality or unexpected behavior if the model switches between versions during a session. By pinning Copilot to a specific model, you gain predictable performance and avoid surprises from automatic model updates. This article explains how to locate the correct VS Code settings, configure the model selection, and verify that your pinned model is active.

Key Takeaways: Pinning a GitHub Copilot Model in VS Code

  • VS Code Settings UI > Extensions > GitHub Copilot > Model: The main dropdown where you select a specific model for code completions and chat.
  • settings.json > github.copilot.advanced.model: The JSON key that stores the pinned model identifier for persistent configuration across workspaces.
  • Copilot Status Bar Icon > Model Info: The indicator in the VS Code status bar that shows which model is currently active after pinning.

ADVERTISEMENT

Why Pinning a Model Matters for GitHub Copilot

GitHub Copilot uses multiple AI models under the hood. The default model may change over time as Microsoft releases updates or rolls out new versions. When you pin a specific model, you lock Copilot to that exact model until you manually change the setting. This is useful for teams that need reproducible code suggestions or for developers who prefer a particular model’s output style.

Pinning also prevents disruptions during long coding sessions. If the model switches mid-session, the tone of suggestions can shift, and previously generated code patterns may not continue consistently. By fixing the model, you maintain a uniform experience from start to finish.

The setting applies to both Copilot completions inline and Copilot Chat responses. However, some advanced features like custom instructions or agent mode might behave differently depending on the pinned model. The next section covers the prerequisites and scope of this configuration.

Prerequisites for Pinning a Model

Before you pin a model, make sure you meet these requirements:

  • Visual Studio Code version 1.92 or later installed.
  • GitHub Copilot extension version 1.194 or later installed and activated.
  • An active GitHub Copilot subscription (Copilot Individual, Business, or Enterprise).
  • Network access to GitHub Copilot servers for model selection validation.

Steps to Pin GitHub Copilot to a Specific Model

Follow these steps to set a fixed model for GitHub Copilot in VS Code. You can use either the Settings UI or the settings.json file. Both methods achieve the same result.

Method 1: Using the VS Code Settings UI

  1. Open the Settings editor
    Press Ctrl + , to open the Settings tab. Alternatively, go to the menu bar and select File > Preferences > Settings.
  2. Search for the Copilot model setting
    In the search bar at the top of the Settings tab, type model. The results will show all settings containing that word.
  3. Locate the GitHub Copilot model dropdown
    Scroll to the section labeled Extensions > GitHub Copilot. Look for the setting named Github > Copilot > Advanced: Model. This is a dropdown menu that lists available models.
  4. Select your preferred model
    Click the dropdown and choose the model you want to pin. Common options include gpt-4, gpt-4o, or claude-3.5-sonnet. The exact list depends on your Copilot subscription and region.
  5. Save the setting
    The change is saved automatically when you select a model. No additional button is needed. Close the Settings tab to apply the change.

Method 2: Editing settings.json Directly

  1. Open the Command Palette
    Press Ctrl + Shift + P to open the Command Palette. Type Preferences: Open User Settings (JSON) and select it.
  2. Locate or create the Copilot model key
    In the settings.json file that opens, find the line "github.copilot.advanced". If it does not exist, add it at the top level of the JSON object.
  3. Add the model identifier
    Inside the github.copilot.advanced object, add a key called "model" with the model identifier as a string. For example: "github.copilot.advanced": { "model": "gpt-4o" }. Save the file.
  4. Verify the JSON syntax
    VS Code validates the JSON file automatically. If you see red squiggly lines, check for missing commas or braces. Correct any errors before closing the file.
  5. Reload the window
    To ensure the change takes effect, press Ctrl + Shift + P, type Developer: Reload Window, and press Enter. This restarts the extension host with the new model setting.

ADVERTISEMENT

Common Issues When Pinning a Copilot Model

The model dropdown shows no options

If the dropdown in Settings UI is empty, your Copilot extension may be outdated. Update the GitHub Copilot extension from the Extensions panel. Also verify that you are signed in to your GitHub account and that your subscription is active. After updating, restart VS Code and check the dropdown again.

The pinned model reverts to default after restart

This usually happens when you have a workspace-level setting that overrides the user setting. Open the .vscode/settings.json file in your project folder and remove any github.copilot.advanced.model entry there. The user setting will then take precedence. Alternatively, set the model in the workspace settings directly if you want it to apply only to that project.

Copilot still uses a different model than the one I pinned

Some Copilot features, such as agent mode or custom instructions, may bypass the pinned model setting. Check the VS Code status bar for the active model indicator. Click the Copilot icon in the status bar and select Model Info to see which model is currently running. If it differs from your pinned selection, disable any custom instruction files or agent mode overrides in the Copilot settings.

Pinning a model breaks Copilot Chat completions

Certain models are optimized for code completions but not for chat. If you pin a model that does not support chat, Copilot Chat may fail to respond. Switch to a model that supports both modes, such as gpt-4o or claude-3.5-sonnet. Check the GitHub Copilot release notes for the latest compatible model list.

Pinned Model vs Default Model: Key Differences

Item Pinned Model Default Model
Selection method Manual via Settings UI or settings.json Automatic by Copilot extension
Consistency across sessions Fixed model until changed May switch with extension updates
Predictability of output High for code completions and chat Variable depending on model version
Support for all Copilot features Depends on chosen model capabilities Full feature support guaranteed
Workspace override possible Yes, via workspace settings.json No, always follows extension defaults

Pinning gives you control but requires awareness of which models support which features. The default model is safer for general use but less predictable. Choose based on your need for consistency versus feature completeness.

You can now pin GitHub Copilot to a specific model using the VS Code Settings UI or by editing settings.json directly. After pinning, verify the active model by clicking the Copilot status bar icon and selecting Model Info. For teams, consider adding the pinned model setting to your project’s .vscode/settings.json file so all members use the same model. If you later want to unpin, simply set the model dropdown back to default or remove the key from settings.json.

ADVERTISEMENT