VS Code can use a local LLM in three ways. Copilot Chat and agent sessions accept your own models: install the Ollama extension, or add a Custom Endpoint for LM Studio, llama.cpp or vLLM. Copilot's inline suggestions cannot use a local model and still need GitHub. For local tab completion, add an extension that supplies its own, such as Continue or llama.vscode.
The honest answer to “can VS Code run on a local model” is: partly, and the parts matter. Chat and agents can be fully local. Tab completion from Copilot cannot. Several background features sit in between, and whether they call GitHub depends on two settings most people never open.
This guide follows the VS Code and GitHub documentation as published on 14 November 2026, three days after VS Code 1.146 reached stable, together with the Ollama, Continue and llama.vscode project pages. It covers the editor’s built-in AI features first and third-party extensions second. Autonomous agent extensions get one section and a pointer, because they have their own guide. For choosing a model, see our comparison of open-weight coding models.
What works locally in VS Code today
| Feature | Copilot chat with your own model (Ollama extension or Custom Endpoint) | Copilot on-device model (experimental) | Continue | llama.vscode |
|---|---|---|---|---|
| Chat | Yes | Yes, with one Copilot-provided model | Yes | Yes |
| Agent and edit sessions | Yes, if the model supports tool calling | Yes | Yes, if the model supports tools | Yes, through its Llama Agent |
| Tab completion | No. Copilot’s inline suggestions need a GitHub account and internet | No | Yes, with an autocomplete model | Yes, with a fill-in-the-middle model |
| Offline or air-gapped | Yes for chat; set the utility models to a local model | No. Requires GitHub sign-in | Yes; install from a .vsix file | Yes, once llama.cpp and the model are on the machine |
| Maintained | Yes | Experimental | No. Final release June 2026 | Yes |
Two terms in VS Code’s docs are easy to confuse. Bring your own key, or BYOK, means a model you add and VS Code calls directly, local or hosted. On-device models are something else: a model that Copilot itself provides and manages on your machine, which requires a GitHub sign-in. Only the first is a private, self-chosen local model.
GitHub Copilot with a local model: what VS Code supports
VS Code’s language models page lists four ways to get a model into chat: through GitHub Copilot, through a provider account for the Claude or Codex harness, through an API key or custom endpoint, or as a locally running model added by a provider extension such as Ollama. The last two are BYOK.
What the documentation says about BYOK, in its own terms:
- No Copilot plan needed. BYOK models, including local ones, work without a Copilot plan and without signing in to a GitHub account. GitHub’s own BYOK page says it works without a Copilot subscription. What the plans cost, if you keep one, is in our Copilot pricing breakdown.
- Requests bypass GitHub. GitHub states that the client sends model requests directly to the provider you configured, not through GitHub’s Copilot API.
- Chat and utility tasks only. Semantic search, inline suggestions and features that rely on embeddings still require a GitHub account.
- Agents need tool calling. A model that does not support tool calling is not shown in the model picker for agent sessions.
- Organisations can switch it off. For Copilot Business and Enterprise, a policy named Bring Your Own Language Model Key in VS Code governs the feature. One passage says administrators can disable it and the FAQ says they must enable it, so check the policy on GitHub.com before assuming either.
The harness detail that affects sign-in
VS Code now runs agent sessions through different harnesses. The docs say that in Local harness sessions, BYOK models work with no GitHub account at all. They also say the Local harness is deprecated and will be removed in February 2027, with workflows moving to the Copilot harness.
In Copilot harness sessions, BYOK is behind the experimental setting chat.agentHost.byokModels.enabled. The docs add that BYOK models can run in the desktop Agents window without a GitHub sign-in once provider credentials are configured, while the browser-based Agents window always requires one. If you depend on a signed-out, fully local workflow, test it on the Copilot harness before February.
Copilot with Ollama in VS Code
The Ollama provider that used to be built into VS Code is deprecated. The docs tell you to install the official Ollama extension instead and to remove any built-in Ollama configuration.
-
Install Ollama and pull a model that supports tools:
ollama pull qwen3.8:27b -
Install the Ollama extension from the Ollama publisher on the Marketplace. Its listing requires VS Code 1.127 or newer, because earlier versions do not reliably cancel requests from model providers. Version 0.0.14 was current when we checked.
-
Open Chat, open the model picker at the bottom of the input and choose a model under Ollama. The extension discovers models from
http://127.0.0.1:11434. Local models need no sign-in; only Ollama’s cloud models ask forollama signin. -
Fix the context. Ollama’s VS Code page warns that the editor may show a model’s maximum context even when Ollama allocated less. Open Ollama’s settings, set the context length to at least 64K, reload the VS Code window and send the prompt again. From a terminal the equivalent is:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve -
If models are missing from the picker, run Ollama: Refresh Models from the Command Palette, then Ollama: Diagnose Models and read the Ollama output channel.
Ollama’s default context depends on memory: 4K below 24 GiB of VRAM, 32K from 24 to 48 GiB and 256K at 48 GiB or more. On a typical developer GPU the default is far too small for an agent, and the symptom is an assistant that loses the thread, not an error. ollama ps shows the context that was actually allocated. The extension also has a setting, Inference Timeout Minutes, for requests that take more than ten minutes to start responding.
VS Code with LM Studio, llama.cpp or vLLM: the Custom Endpoint provider
For any server other than Ollama, use the Custom Endpoint provider. It replaces the older OpenAI Compatible provider, and the github.copilot.chat.customOAIModels setting is deprecated. It speaks three API types: Chat Completions, Responses and the Anthropic Messages API.
-
Start the server. LM Studio listens on port 1234 after
lms server start. For llama.cpp, pass the port explicitly, because current builds default to 9931:llama-server -hf ggml-org/Qwen3.8-27B-GGUF:Q4_K_M \ --alias qwen3.8-27b --host 127.0.0.1 --port 8080 -c 65536 -
In VS Code, run Chat: Manage Language Models, select Add Models, then Custom Endpoint. Enter a group name, a display name and an API key. A local server started without a key ignores the value.
-
Choose the API type. VS Code then opens
chatLanguageModels.json. A complete entry for the server above:[ { "name": "Local llama.cpp", "vendor": "customendpoint", "apiKey": "${input:localApiKey}", "apiType": "chat-completions", "models": [ { "id": "qwen3.8-27b", "name": "Qwen3.8 27B (local)", "url": "http://127.0.0.1:8080/v1/chat/completions", "toolCalling": true, "vision": false, "maxInputTokens": 57344, "maxOutputTokens": 8192 } ] } ] -
Save, then select the model in the chat picker. Restart VS Code if it does not appear.
Three properties decide whether this works:
url: give the full path. If the URL has no API path, VS Code appends one for the API type and inserts/v1when it is missing, so the docs advise giving the full endpoint URL to avoid ambiguity.toolCalling: must betruefor the model to appear in agent sessions. Set it only if the model and the server’s chat template really support tools.maxInputTokensandmaxOutputTokens: VS Code treats their sum as the context window. Here they add up to 65,536, matching-c. Declare more than the server holds and requests will overflow.
For a Responses API server that keeps no state, such as a local one, the docs say to add "statefulResponses": false so that VS Code sends the full history each time. A server shared by a team is a different sizing problem; our vLLM, Ollama and llama.cpp comparison covers it.
What still goes to GitHub
Adding a local model does not make every AI feature local. The documentation separates three groups.
Always GitHub. Inline suggestions, semantic search and features that rely on embeddings require a GitHub account and internet connectivity, and are not available through BYOK models.
GitHub by default, local if you change a setting. VS Code uses small utility models in the background for chat titles, summaries, commit messages, pull request descriptions, rename suggestions and intent detection. The docs say the model you pick for a chat does not control these. When a Copilot token is available, utility flows use GitHub Copilot’s utility models by default, even while your chat runs on a local model. Three settings change that:
chat.utilityModelsets the model for general utility flows such as titles, summaries and Git review.chat.utilitySmallModelsets the model for fast flows such as commit messages, rename suggestions and intent detection. The docs recommend a fast, inexpensive model here.chat.byokUtilityModelDefaultaccepts None, Main Agent Model or GitHub Copilot, and decides what utility flows use when the main agent model is a BYOK model.
Pick the values in the Settings editor, which lists the available models. If you are signed out, VS Code shows a notice asking you to configure the first two, because no built-in utility model exists without a Copilot token.
Local once configured. Chat, agent sessions and inline chat. The inlineChat.defaultModel setting lists every model in the picker, so editor inline chat can run on the same local model.
One more route looks local but is not. GitHub’s enterprise custom models, in public preview, let an organisation add its own provider keys, OpenAI-compatible providers included. GitHub says users reach those models through its Copilot API and need a Copilot licence and internet access, with requests routed through GitHub. That is central billing and control, not a private path to a server under a desk.
Copilot’s on-device model
VS Code’s documentation describes an experimental feature called on-device models. Copilot downloads a model it manages, currently MAI Code 1.1 Flash, and VS Code serves it through llama.cpp on your machine. Responses from it are labelled On-device and use no AI credits.
The requirements are steep and specific:
- A GitHub sign-in with Copilot access; on Business or Enterprise, an administrator must enable Editor Preview Features.
- An NVIDIA GPU with 96 GB or more of GPU memory. The docs say unified memory shared with the system counts.
- About 55 GB of free disk space for a 52.8 GB download.
- Your own llama.cpp build, b11658 or later. VS Code does not install it; you set
chat.copilot.localModel.llamaServerPathto thellama-serverexecutable and enablechat.copilot.localModel.enabled.
GitHub’s BYOK page describes the same model as something Windows users can add to their machine. Treat this as Copilot with local inference for one model, not as a way to bring your own. If you want a model of your choice, or no GitHub account in the loop, use BYOK.
VS Code local LLM code completion: Continue and llama.vscode
Since Copilot’s inline suggestions cannot use a local model, tab completion needs an extension that implements VS Code’s inline completion API itself. Completion models are small and specialised. Continue’s docs note that most have no more than 10 billion parameters and are trained on a fill-in-the-middle prompt format, which is why a large chat model makes a poor autocomplete model. Our small language model guide explains the trade-off.
llama.vscode
llama.vscode is published by the llama.cpp organisation under the MIT licence, and version 0.0.78 was released on 13 November 2026. It offers completion on input, accepted with Tab, plus chat and an agent, all against llama.cpp. The README maps hardware to the fill-in-the-middle presets built into llama-server:
| GPU memory | Preset flag | Model the flag selects |
|---|---|---|
| More than 64 GB | --fim-qwen-30b-default | Qwen3-Coder 30B A3B |
| More than 16 GB | --fim-qwen-7b-default | Qwen2.5-Coder 7B |
| Less than 16 GB | --fim-qwen-3b-default | Qwen2.5-Coder 3B |
| Less than 8 GB | --fim-qwen-1.5b-default | Qwen2.5-Coder 1.5B |
The extension can install llama.cpp for you on macOS and Windows, and the presets download weights on first use, so fetch them before taking a machine offline.
Continue with a local LLM
Continue was the usual answer here for two years, so its status needs stating plainly. Its repository now says it is no longer actively maintained and is read-only. A final 2.0.0 release in June 2026 removed anonymous telemetry and the sign-in flow. The Marketplace listing was last updated on 19 June 2026. The extension still installs and still works with local servers; it will not receive fixes for future VS Code changes.
Continue reads ~/.continue/config.yaml, or %USERPROFILE%\.continue\config.yaml on Windows. Each model lists the roles it serves. One larger model can take chat, edit and apply while a small one takes autocomplete:
name: Local Config
version: 0.0.1
schema: v1
models:
- name: Qwen3.8 27B
provider: ollama
model: qwen3.8:27b
roles:
- chat
- edit
- apply
capabilities:
- tool_use
defaultCompletionOptions:
contextLength: 32768
- name: Qwen2.5-Coder 1.5B
provider: ollama
model: qwen2.5-coder:1.5b
roles:
- autocomplete
Points from Continue’s docs that save time:
- Roles. A model without a
roleslist gets chat, edit, apply and summarize. Autocomplete must be assigned explicitly. - Autocomplete model. The docs recommend
qwen2.5-coder:1.5bthrough Ollama, a download under 1 GB, and advise against thinking models for completion because they respond too slowly. - Agent mode. It needs tool support. If Continue reports that agent mode is not supported, add
capabilities: [tool_use]; if errors continue, the docs say the model may not support tools whatever its card claims. - Context. Continue may request a larger context than other tools, which can make Ollama refuse to load the model. Lower
contextLengthunderdefaultCompletionOptions. - LM Studio. Use
provider: lmstudio; the defaultapiBaseishttp://localhost:1234/v1. - Conflicts. Disable Copilot’s completions while Continue’s are on, since two providers interfere with each other.
Where Cline, Zoo Code and Kilo Code fit
These extensions are autonomous agents with their own chat panel. They do not use Copilot’s model picker. They talk to Ollama, LM Studio or an OpenAI-compatible server through their own provider settings, read and edit files, and run commands with your approval. Choose them when you want an agent to carry a task across many files; choose Copilot Chat with a local model or Continue when you want an assistant inside the normal editing flow. Roo Code, formerly the best-known of the group, shut down in May 2026. Settings, context sizes and model choices for the family are in our Cline set-up guide for local models.
Copilot CLI with Ollama
Some searches for Copilot and Ollama are about the terminal agent, not the editor. GitHub’s docs say Copilot CLI discovers models served by Ollama on 127.0.0.1:11434 and lists them in the model picker under “Local and self-hosted”. Ollama provides a launcher:
ollama launch copilot
Two cautions from GitHub’s page. For an unknown model, Copilot CLI can assume a limit of 128,000 prompt tokens, which may exceed what a small local model holds, so configure token limits. And setting COPILOT_OFFLINE to true stops the CLI from contacting GitHub’s servers, for telemetry for example; full isolation also needs the model provider to be local.
Offline and air-gapped use
VS Code’s FAQ says a BYOK local model can be used completely offline. GitHub’s wording for restricted networks is that the model endpoint must be reachable from the client within that environment. In practice:
- Install VS Code, the Ollama extension or your Custom Endpoint configuration, and the model weights while you still have a connection, or bring them in as files.
- Point both utility model settings at a local model.
- Expect inline suggestions, semantic search and embedding-based features to be unavailable.
- For tab completion, install Continue from the
.vsixfile on its GitHub Releases page, which is the method its offline guide gives, or use llama.vscode with weights already downloaded. - Size the hardware before you commit: the VRAM calculator and our model picks by VRAM tier show what fits. The local LLM overview covers the basics.
A policy note for companies: BYOK usage is reported only from client telemetry in supported clients, according to GitHub, and requests do not pass through GitHub. That is the privacy benefit and also the governance gap. Nothing central records which model a developer pointed the editor at.
How VDF AI fits
VDF AI does not run, host, resell or integrate with GitHub Copilot, the Ollama extension, Continue or llama.vscode. The set-ups above are sound for one developer. For a department, they leave open who hosts the model, who approves which models may be used, and where the record of prompts and edits is kept, since each developer’s editor is configured separately. Teams weighing a move away from a hosted assistant can start with our page on what changes when you leave GitHub Copilot.
VDF Code is the governed coding assistant VDF AI offers for that situation. Its product page describes extensions for VS Code, JetBrains IDEs, Neovim and Visual Studio with inline completions, chat, edit-mode refactors and pull request review, deployed in your VPC, your data centre or a fully air-gapped site. VDF AI Router sits in front of local open-weight models and approved external endpoints, enforces allow and deny lists, and has an air-gap mode that routes to local models only.
Sources
VS Code, GitHub, Ollama, Continue and llama.cpp pages as they read on 14 November 2026.
- VS Code: AI language models, bring your own key, Custom Endpoint and on-device models
- VS Code: agent harnesses and the Local harness deprecation and Agents window accounts
- VS Code 1.146 release notes
- GitHub Docs: the bring-your-own-key concept page for Copilot
- GitHub Docs: enabling custom models in your enterprise
- GitHub Docs: adding LLM models to Copilot CLI
- Ollama extension on the Visual Studio Marketplace
- Ollama: VS Code, Copilot CLI and context length
- Continue repository and maintenance notice and Marketplace listing
- Continue: config.yaml reference, autocomplete, Ollama provider, Ollama guide, LM Studio provider and running without internet
- llama.vscode repository
- llama.cpp server README
- LM Studio CLI: lms server start
- Ollama library: qwen3.8 and qwen2.5-coder
Need local models in the editor for a whole engineering organisation, with central control? Look at VDF Code, or book a conversation.