Want to chat with a local Ollama model right inside VS Code, or let it act as an agent that edits your files, without paying for a cloud model? In late 2026 there are three good ways to do it, and one older method that’s on its way out.
This guide covers the official Ollama extension for VS Code, the Copilot Chat “Manage Language Models” route (bring your own model), and Continue for tab autocomplete. You’ll learn exactly what each one can and can’t do, whether you need a GitHub account, the settings that matter, and fixes for the usual problems.
Facts are checked against the Ollama docs, the Ollama VS Code extension repo, the VS Code model provider docs and the VS Code BYOK announcement, as of December 2026.
- Best for chat and agents: install the official Ollama extension (ID
Ollama.ollama). Your Ollama models appear in the VS Code chat model picker. - Needs: VS Code 1.127 or newer and Ollama running locally. Ollama 0.17.6 or newer is recommended.
- No Copilot plan needed for local models.
- Set context to 64k or more in Ollama Settings, or agents lose track.
- The built-in Copilot Ollama provider is deprecated. Switch to the extension.
- Autocomplete: VS Code’s BYOK models can’t do inline suggestions. Use Continue for local tab completion.
Haven’t set up Ollama yet? Install it from ollama.com, then see my guide to updating Ollama to make sure you’re on a recent version.
Your Options at a Glance
| Method | Chat | Agent mode | Tab autocomplete | GitHub sign-in |
|---|---|---|---|---|
| Ollama extension | Yes | With tool-calling models | No | Not for local models |
| Manage Language Models (BYOK custom endpoint) | Yes | With toolCalling enabled |
No | Not on the Local harness |
| Built-in Copilot Ollama provider | Deprecated. Move to the extension. | |||
| Continue extension | Yes | Its own agent | Yes | No |
Most people should use the Ollama extension for chat and agents, plus Continue only if they also want local autocomplete.
Prepare Ollama First
- Check Ollama is running: open
http://127.0.0.1:11434in a browser. It should say “Ollama is running”. - Pull at least one model. The Ollama docs use
ollama pull qwen3.6as the example. For coding on a 24 GB GPU, the newqwen4is a strong choice. - Raise the context length. Open Ollama Settings and set context length to at least 64k. The Ollama VS Code docs say to do this, then reload the VS Code window and resend your prompt. You can also start the server with
OLLAMA_CONTEXT_LENGTH=65536.
Agents send long system prompts and file contents, so a small context is the number one cause of “the model ignores my instructions”. More detail in my Ollama context length guide.
Method 1: The Official Ollama Extension
Ollama publishes its own VS Code extension. It adds the models from your Ollama server to the normal VS Code chat model picker.
Requirements:
- VS Code 1.127 or newer.
- Ollama installed and running, with at least one local or cloud model.
- Ollama 0.17.6 or newer is recommended for cloud sign-in and richer model details.
Setup:
- Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X) and search Ollama. Install the one published by Ollama (ID
Ollama.ollama). - Open the Chat view.
- Click the model picker. Your models appear under an Ollama section.
- Pick a model and start chatting.
The extension finds your server at http://127.0.0.1:11434 by default. Local models need no sign-in at all.
Useful commands (Command Palette):
- Ollama: Refresh Models after you pull a new model.
- Ollama: Diagnose Models writes a report to the “Ollama” output channel when something’s wrong.
Settings worth knowing:
ollama.thinkingLevelsmaps a model tag to a thinking level, for example{"qwen4:latest": "high"}. Use unquotedtrueorfalsefor models with simple on/off thinking.- Ollama: Inference Timeout Minutes raises the time limit for slow, long answers.
Cloud models: run ollama signin, then pull a cloud tag such as kimi-k2.6:cloud. It shows up in the picker beside your local models. See my Ollama cloud models guide for pricing and privacy.
Method 2: Manage Language Models (BYOK)
VS Code also lets you add your own models to chat directly, a feature Microsoft calls bring your own key (BYOK). Its June 2026 announcement names running “a model locally with Ollama” as one use.
Important: the VS Code docs now say “The built-in Ollama provider is deprecated” and recommend the Ollama extension. If you set up Ollama through the old built-in provider, install the extension and remove the old configuration.
You can still add Ollama through the generic Custom Endpoint provider, which replaced the old “OpenAI Compatible” option:
- Open the Command Palette and run Chat: Manage Language Models (or click the gear in the model picker).
- Click Add Models and choose the custom endpoint provider.
- Enter a group name. VS Code opens
chatLanguageModels.json. - Add your model with its
id(for exampleqwen4), aname, theurlhttp://localhost:11434/v1,apiTypeset tochat-completions, and"toolCalling": trueif the model supports tools. - Optional keys:
vision,maxInputTokens,maxOutputTokens.
The other apiType values are responses and messages. Ollama supports the OpenAI chat completions format, so chat-completions is the safe choice.
Harness note: VS Code runs BYOK models on a “Local” harness that works with no GitHub account, but the docs say it “will be removed in February 2027”. The newer Copilot harness needs the experimental setting chat.agentHost.byokModels.enabled. If you want a setup that won’t need changing next year, use the Ollama extension.
No GitHub account? VS Code uses small “utility” models for things like chat titles. Set both chat.utilityModel and chat.utilitySmallModel to one of your local models, or set chat.byokUtilityModelDefault to “Main Agent Model”.
Using Ollama Models in Agent Mode
Agent mode lets the model read files, edit code and run terminal commands for you. The VS Code docs are clear on one rule: a model must support tool calling to appear in agent mode.
- Pick a model with the “tools” tag on its Ollama library page. Qwen4, Qwen3.6, Qwen3.8, Gemma 4 and most recent coding models qualify.
- For custom endpoint models, add
"toolCalling": true. - Keep context at 64k or more.
- Expect a local model to be slower and less reliable than a frontier cloud model on big multi-file tasks. Review each change before accepting.
How tool calling works under the hood is covered in my Ollama tool calling guide. If you prefer a terminal agent, see my guide to running Qwen4 with Claude Code and OpenCode.
Method 3: Continue for Tab Autocomplete
VS Code’s docs state that local BYOK models can’t be used for inline suggestions. If you want grey “ghost text” completions from a local model as you type, use an extension that provides its own completions. Continue is the most popular choice.
- Install Continue (ID
Continue.continue) from the Extensions view, or runcode --install-extension Continue.continue. - Pull a small, fast coding model for completions, for example
ollama pull qwen2.5-coder:1.5b. Small models keep suggestions instant. - Open Continue’s config. Current versions use
~/.continue/config.yaml(older versions usedconfig.json). - Add an Ollama model with the autocomplete role, pointing at
http://localhost:11434. - Start typing in a code file. Press Tab to accept a suggestion.
Continue can also use an embeddings model such as nomic-embed-text for codebase search. Its exact config keys change between versions, so check Continue’s docs for your installed version. My older DeepSeek in VS Code guide shows Continue and Cline side by side.
Which Ollama Models Work Best
| Your hardware | Chat and agent | Autocomplete |
|---|---|---|
| 8 GB GPU or 16 GB Mac | A 7B to 9B coding model with tools | 1.5B coder model |
| 12 to 16 GB GPU | 14B-class model, or a 30B-class MoE at low quant | 1.5B to 3B coder model |
| 24 GB GPU or 32 GB Mac | qwen4 (Qwen4-35B-A3B) |
3B coder model |
| No good GPU | An Ollama cloud model | Small CPU model, or skip |
Running chat and autocomplete at the same time loads two models. Make sure both fit in memory, or completions will feel laggy.
What Still Needs GitHub or Copilot
Even with local models, some VS Code AI features still need a GitHub account or Copilot, per Microsoft’s BYOK announcement:
- Inline suggestions (Copilot completions).
- Semantic codebase search.
- Embeddings.
If you want those for free, GitHub Copilot Free covers them with monthly limits, and you can still use Ollama models for chat alongside it.
Common Problems and Fixes
| Problem | Cause | Fix |
|---|---|---|
| No Ollama section in the model picker | Extension not installed, old VS Code, or Ollama not running | Update VS Code to 1.127+, start Ollama, run Ollama: Refresh Models |
| Model missing in agent mode | Model doesn’t support tool calling | Pick a model with the tools tag, or set "toolCalling": true |
| Agent forgets instructions or files | Context too small | Set context to 64k in Ollama Settings, reload the window |
| “Failed to fetch models from Ollama” | Known issue in old Copilot Chat versions with the built-in provider | Update VS Code and Copilot Chat, switch to the Ollama extension |
| Answers time out | Slow model or long output | Raise Ollama: Inference Timeout Minutes, or use a smaller model |
| No tab completions | BYOK models can’t do inline suggestions | Use Continue for local autocomplete |
| Ollama on another PC not found | Extension looks at 127.0.0.1 by default | Expose Ollama on your network and point the endpoint at it |
| Very slow replies | Model running on CPU | Check ollama ps shows 100% GPU; pick a smaller model |
For running Ollama on one PC and VS Code on another, see my guide to accessing Ollama from another computer.
FAQ
Can I use Ollama in VS Code without Copilot?
Yes. Install the official Ollama extension. Local models need no GitHub sign-in or Copilot plan.
Is the Copilot Chat Ollama provider still supported?
No. VS Code’s docs mark the built-in Ollama provider as deprecated and recommend the Ollama extension.
Can Ollama models do agent mode in VS Code?
Yes, if the model supports tool calling. Set the context length to 64k or more.
Can Ollama give me tab autocomplete in VS Code?
Not through VS Code’s built-in model picker. Use the Continue extension with a small Ollama coding model.
Which VS Code version do I need?
VS Code 1.127 or newer for the Ollama extension.
What is the best Ollama model for VS Code?
On a 24 GB GPU, qwen4 is the strongest choice right now. On smaller cards, pick a 7B to 14B coding model with tool support.
Does my code leave my computer?
Not with local models. Ollama cloud models do send prompts to Ollama’s servers.
Sources
- Ollama docs: VS Code integration
- ollama/ollama-vscode on GitHub (commands, settings, requirements)
- VS Code docs: Add model providers and local models (deprecation, toolCalling, harnesses)
- VS Code docs: AI language models (utility model settings)
- VS Code blog: Use your own language model key
- VS Code issue: Failed to fetch models from Ollama



