Visual Studio Code's chat panel isn't limited to cloud models. With Ollama running on your PC, you can pick a local model in VS Code's model picker and chat with it, and Microsoft says local models can be used completely offline. The setup has changed recently: Microsoft's documentation now says the built-in Ollama provider is deprecated and points you to the official Ollama extension instead. This guide follows Microsoft's and Ollama's documentation; Forge PC hasn't tested how well any particular model codes, so speed and quality will depend on your model and hardware.
What you need
According to Ollama's VS Code page:
Visual Studio Code 1.127 or newer. Earlier versions don't reliably cancel requests from language model providers.
Ollama installed and running, with at least one model available. Ollama 0.17.6 or newer is recommended for cloud model sign-in and richer model metadata; older versions may still work with local models.
A suitable PC. Local models run on your GPU or CPU. If you're unsure what your graphics card can handle, see how much VRAM you need and our guide to running AI models locally with Ollama and LM Studio.
Microsoft's language model documentation says these "bring your own key" (BYOK) models work without signing into a GitHub account and without a Copilot plan.
Step 1: pull a model in Ollama
Open a terminal and download a model, for example:
ollama pull qwen3.6
Run ollama list to confirm it's there. If you need help choosing or tidying up models, see how to manage Ollama models.
Step 2: install the Ollama extension
Install the Ollama extension (from the Ollama publisher) from the Visual Studio Marketplace.
Open Chat.
Open the model picker at the bottom of the chat input.
Choose a model from the Ollama section.
The extension discovers models from http://127.0.0.1:11434 by default, which is where Ollama listens on your PC.
If you previously set up the deprecated built-in Ollama provider, Microsoft says to install the extension and remove the built-in provider configuration so you keep using Ollama models without interruption.
Step 3: set a bigger context length
Coding chats send a lot of text. Ollama's documentation notes that VS Code may show a model's maximum context length even when Ollama allocates a smaller context at runtime. For local models, open Ollama's settings, set the context length to at least 64k, reload the VS Code window and resend your prompt. Bigger contexts use more memory; our guide on setting Ollama's context length explains the trade-off.
What works offline, and what doesn't
Microsoft says you can use a BYOK local model completely offline once it's added. Some features still need a GitHub account and an internet connection: semantic search, inline suggestions (code completions) and features that rely on embeddings aren't available through BYOK models. So you get local chat, but not Copilot-style autocomplete from your Ollama model. For a different local coding set-up, see how to use Continue with Ollama.
Copilot Business and Enterprise users should note that an organisation administrator can disable bring-your-own-key models.
If Ollama models don't appear
Ollama's troubleshooting steps:
Make sure Ollama is running.
Run ollama list and confirm models are available.
Run Ollama: Refresh Models from the Command Palette.
Run Ollama: Diagnose Models and check the Ollama output channel.
Our verdict
Using Ollama in VS Code chat is now a two-minute job: pull a model, install the official Ollama extension, pick the model in chat and raise the context length to at least 64k. Microsoft says it works offline and without a Copilot plan, but code completions, semantic search and embedding-based features still need a GitHub account and internet connection.