Home›Guides›Ollama in VS Code: the official extension in 4 steps (VS Code 1.127+), tested on 1.148.0

Setup · Guide

Ollama in VS Code: the official extension in 4 steps (VS Code 1.127+), tested on 1.148.0

To use Ollama in VS Code, install the official Ollama extension (VS Code 1.127 or newer), keep Ollama running, open Chat and pick a model from the Ollama section of the model picker. Local models need no sign-in. Set the context to at least 64k, the minimum the extension recommends.

Measured and written by Local AI ScopePublished Figures measured by Local AI Scope

To use Ollama in VS Code, install the official Ollama extension (VS Code 1.127 or newer), keep Ollama running, open Chat and pick a model from the Ollama section of the model picker. Local models need no sign-in. Set the context to at least 64k, the minimum the extension recommends.

We installed it on 1 December 2026 with VS Code 1.148.0, the extension Ollama.ollama 0.0.14 and Ollama 0.40.19, on an Ubuntu machine with no GPU. We also opened the extension package and read its code, so the lists and numbers below come from the extension itself, not from memory. And yes, the first model we tried is one the extension itself calls outdated. We’ll get to that.

OllamaOllamaRuntime sheet

What you need before you start

Ollama has had its own official extension since June 2026, and the release notes of VS Code 1.127 (1 July 2026) call it “the recommended way to use local Ollama models in chat”. The Ollama provider that used to come built into VS Code is now deprecated: if you were using it, install the extension and remove the old provider.

Icon of the official Ollama extension for VS Code, ID Ollama.ollama
The official extension: published by Ollama, MIT licence Image: Ollama

The requirements, straight from the Ollama documentation:

  • VS Code 1.127 or newer. Earlier versions don’t reliably cancel requests from language model providers. The extension’s own package asks for ^1.127.0.
  • Ollama installed and running. 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.
  • At least one model, local or cloud, already downloaded in Ollama.

The extension is published by Ollama, under the MIT licence. Version 0.0.14 came out on 22 October 2026; the first one, on 22 June 2026.

4 steps: from install to first answer

  1. Download a model. In a terminal: ollama pull qwen3.5:4b. It’s one of the local models Ollama itself recommends to the extension, and it supports tools, which Agent mode needs.
  2. Install the extension. In the Extensions view, search for “Ollama” and install the one by Ollama (ID Ollama.ollama). From a terminal: code --install-extension Ollama.ollama.
  3. Open Chat and click the model picker, at the bottom of the chat box.
  4. Choose a model in the Ollama section. The extension lists the models it finds at http://127.0.0.1:11434, the Ollama default address.

On our machine, the extension found both models we had downloaded (llama3.2:1b and qwen3:1.7b) without touching any setting other than the address, because our Ollama was listening on another port for the test.

This official video from the VS Code team shows the same steps in under 5 minutes, with a section on using local models for coding:

Opens on YouTube (no cookies) only when you press play.

4 and a half minutes from the VS Code channel: what a language model provider is, installing the extension, using local models for coding and the advanced agent host setup. It was recorded in July, so the version numbers have moved on since; the installation steps match the ones we tested on 1.148.0.

Why 64k context matters and how to set it

This is the setting that changes everything. In Agent mode, prompts get big fast. Our first agent request weighed 21,395 tokens. Ollama 0.40.19, on a machine with no GPU, gave the model a default context of 4,096 tokens. It didn’t fit.

The extension handled it on its own: Ollama returned an error, and the extension retried with num_ctx=25600. Then it left this warning in its output channel: “Ollama allocated a 25K context window for llama3.2:1b; at least 64K is recommended”. That 64K is written into the extension’s code (64 * 1024), and the automatic retry arrived in version 0.0.13.

Ollama output channel in VS Code 1.148.0: a 21,395-token agent prompt exceeds the 4,096-token context, the extension retries with num_ctx=25600 and warns that at least 64K is recommended
21,395 tokens against a 4,096 context: the extension retried on its own with 25,600 Real output from our test, reproduced as an image: VS Code 1.148.0, Ollama 0.40.19, 1 Dec 2026

One more trap: VS Code may show the model’s maximum context even when Ollama gives it less when it runs. Our llama3.2:1b supports 128K, but it was running with 25K. To set it properly, open Ollama Settings, set the context to 64k or more, reload the VS Code window and send the request again. Our Ollama context length guide explains how to set it in each case and what each extra block of context costs in memory.

Which local models work with Agent mode (and which ones it warns about)

Agent mode only uses tools with models that declare them: the extension exposes a model as tool-capable when Ollama reports the tools capability, and as image-capable when it reports vision. If a model doesn’t call tools, our Ollama tool calling guide explains how to check it.

Beyond that, the extension has a list of families it considers outdated for agent work. When you send a request with one of them, a warning pops up (once per conversation) with two buttons: “Choose another model” and “Continue anyway”. This is the list, as it appears in the code:

Code of the Ollama extension 0.0.14: the list of model families flagged as outdated for agent tools and the warning with the buttons Choose another model and Continue anyway
The list of outdated families and the warning, as written in the code Code of the extension Ollama.ollama 0.0.14, read on 1 Dec 2026, reproduced as an image

Our llama3.2:1b is on that list. We used it on purpose because it’s tiny, and it was useful to see the context retry, but for real agent work you’d want a newer model. Either way, it’s a warning, not a block: “Continue anyway” lets you carry on with the model you chose.

Do you need a GitHub account or a Copilot plan?

For chat with local models, the Ollama documentation is clear: local models don’t need you to sign in to Ollama. On the VS Code side, its documentation says that bringing your own model provider “can provide chat access without a Copilot plan”. There are two catches, written in the VS Code docs and release notes:

  • Without a GitHub account, the built-in utility models aren’t available. Those are the ones that write chat titles and commit messages. With your own model as the main one, VS Code 1.128 doesn’t use utility models by default; the setting chat.byokUtilityModelDefault lets you choose one for those tasks.
  • “Some agent workflows without GitHub sign-in are experimental.” In other words: chat without a Copilot plan is documented; some agent workflows without signing in are still experimental.

Ollama’s cloud models are another story: the ones ending in :cloud need ollama signin. The extension also asks your own Ollama server which models to recommend. Ours returned 6: 3 cloud models that require the pro plan and 3 local ones with the VRAM each needs.

Model recommendations served by Ollama 0.40.19 to the VS Code extension: 3 cloud models on the pro plan and 3 local models, qwen3.5:4b, gemma4:12b and qwen3.8:27b, with their VRAM
6 recommendations from our own Ollama: 3 cloud (pro plan), 3 local Summary of the real JSON returned by Ollama 0.40.19 in our test, 1 Dec 2026

Using a remote Ollama server

If Ollama runs on another computer at home, with more memory or a graphics card, the extension can use it. The setting is ollama.endpoint (by default http://127.0.0.1:11434), for example http://192.168.1.50:11434. On that computer, Ollama has to accept connections from the network, which is set with OLLAMA_HOST; our Ollama environment variables guide shows how to set it on each system.

Three more settings from the extension package:

  • ollama.headers: extra HTTP headers for the requests to Ollama.
  • ollama.inferenceTimeoutMinutes: the maximum time it waits for an answer to begin; 10 minutes by default, from 1 to 60.
  • ollama.thinkingLevels: the thinking level per model, for those that support it.

Inline completions: what the extension does not do

Let’s be honest: the official extension gives you chat and Agent mode, not the grey suggestions that appear as you type. The VS Code documentation says it in so many words: your own model “doesn’t replace the GitHub Copilot service for inline suggestions, semantic search, or embeddings”.

If what you’re after is autocomplete with Ollama, the documented route is the Continue extension, with provider: ollama in its config.yaml and a model assigned to autocomplete in its roles.

Models not showing? Refresh and Diagnose

If the Ollama section doesn’t appear in the picker, go in this order:

  1. Check that Ollama is running and that ollama list shows at least one model.
  2. Run Ollama: Refresh Models from the Command Palette.
  3. Run Ollama: Diagnose Models and read the Ollama output channel. It tells you which address it’s using, which models it sees, their thinking settings and, for loaded models, the context they got against the recommended 64K.
Output of Ollama: Diagnose Models in VS Code 1.148.0 with Ollama 0.40.19: 2 models, their thinking settings and a runtime context of 25K, below the recommended 64K
Diagnose Models: which address, which models and how much context the loaded model really got Real output from our test, reproduced as an image: VS Code 1.148.0, Ollama 0.40.19, 1 Dec 2026

If Ollama itself won’t start or answer, the problem is before VS Code: our Ollama not working guide goes through the usual errors one by one.

Our Ollama runtime page has the version we track and what it runs on.