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.
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
- Open the Settings editor
Press Ctrl + , to open the Settings tab. Alternatively, go to the menu bar and select File > Preferences > Settings. - Search for the Copilot model setting
In the search bar at the top of the Settings tab, typemodel. The results will show all settings containing that word. - 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. - Select your preferred model
Click the dropdown and choose the model you want to pin. Common options includegpt-4,gpt-4o, orclaude-3.5-sonnet. The exact list depends on your Copilot subscription and region. - 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
- Open the Command Palette
Press Ctrl + Shift + P to open the Command Palette. TypePreferences: Open User Settings (JSON)and select it. - 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. - Add the model identifier
Inside thegithub.copilot.advancedobject, add a key called"model"with the model identifier as a string. For example:"github.copilot.advanced": { "model": "gpt-4o" }. Save the file. - 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. - Reload the window
To ensure the change takes effect, press Ctrl + Shift + P, typeDeveloper: Reload Window, and press Enter. This restarts the extension host with the new model setting.
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.