Repository navigation
Description
Problem
VS Code's GitHub Copilot extension currently supports BYOK (Bring Your Own Key) models for chat via chatLanguageModels.json (VS Code insiders) or with other openAI compatible provider extensions like the Unify Chat Provider, but not for inline code completions.
When setting "github.copilot.selectedCompletionModel" to a custom model ID (e.g., a local model served via OpenAI-compatible API), the setting is silently ignored because the model ID is not in the list returned by GitHub's API. The extension falls back to the default Copilot cloud model (gpt-41-copilot), and completions always go through proxy.business.githubcopilot.com.
This means:
Chat works with local models ✅
Inline code completions always require GitHub's cloud ❌
Disconnecting from the internet disables completions entirely ❌
Current Behavior
vscode/extensions/copilot/src/extension/completions-core/vscode-node/lib/src/openai/model.ts
Line 139 in 40a9d56
| if (!genericModels.includes(userSelectedCompletionModel)) { |
if (!genericModels.includes(userSelectedCompletionModel)) {
// Silently falls back to default model
userSelectedCompletionModel = null;}The fallback is silent — no warning or error is shown to the user. Completions continue to go to GitHub's cloud proxy.
Expected Behavior
Users should be able to configure a custom/OpenAI-compatible endpoint for inline code completions, similar to how chat completions work with chatLanguageModels.json or the Unify Chat Provider. This would enable:
Fully offline code completions
Use of self-hosted local models (llama.cpp, FastFlowLM, vLLM, etc.)
BYOK models for organizations that cannot use GitHub's cloud
Activity
GitSparTV commentedon May 29, 2026
Usual case for local autocompletion is Ollama with
qwen2.5-coder.Currently only Continue is able to use local models for autocompletion. Kilo code uses cloud models
Arifursdev commentedon Jun 10, 2026
#313468
#309009
hu3bi commentedon Jun 10, 2026
Maybe we can close 2 of those issues as duplicate and merge relevant comments into 1 issue. At least 3 issues open for the same thing.
hope it is ok to ping you guys
Ulugbek Abdullaev (@ulugbekna) Vritant Bhardwaj (@vritant24)
Change Completions Modelcommand #309009GitSparTV commentedon Jun 10, 2026
This issue has 30 likes, first one that is not a duplicate has 3.
Move your likes there, guys
vritant24 commentedon Jun 10, 2026
Apologies, thanks for pointing that out. I'll open this up and dedupe the other to this one
Change Completions Modelcommand #309009 as a duplicate of this issue72 remaining items
unbadfish commentedon Sep 30, 2026
Notice
jointInlineCompletionProvider.ts, a key file for BYOK FIM service, any PR whose base commit is before this commit, may need to be re-written.Thus, I think a smart way to union the community is to release (and continuously update) a patch (base on the former patch mentioned before) in a separate repo. I would soon do that . . .
DrkWzrd commentedon Oct 16, 2026
So... this is dead.
Nice. Just force your users to put a shitty extension in your not-as-fast-today IDE.
GitSparTV commentedon Oct 16, 2026
If you really need one right now, Continue extension is probably the only one supporting any model you want.
SettingPrompter commentedon Oct 17, 2026
except it doesnt, seems like you haven't used it well
GitSparTV commentedon Oct 17, 2026
SettingPrompter I use it every day with Ollama Qwen3.5-3b. It detects FIM mode where model does a better job at autocompleting.
But I agree the multiline mode sucks and I have to set maximum token limit just in case
SettingPrompter commentedon Oct 17, 2026
its unironically ass yeah, thats why i've been seeking for a normal one and ended up here using the patch 😭
sitjac commentedon Nov 3, 2026
Another real-world use case for this feature:
Our organization provides Claude / DeepSeek / GLM models through an internal OpenAI/Anthropic-compatible gateway, registered in VS Code via the BYOK
customendpointprovider. Chat, Inline Chat, and Agent mode all work great with these custom models.However, inline completions (ghost text) cannot use them. Setting
"github.copilot.selectedCompletionModel"to our custom model ID is silently ignored — the extension logsUser selected model <id> is not in the list of generic models ... falling back to default modelat trace level only, with no visible warning. From a user's perspective it looks like the setting simply doesn't work, especially since the settings UI accepts any string.Two asks:
completionsUrlper model, as explored in Support BYOK endpoints for Inline suggestions (fix #318545) #330816).For enterprises whose policies route all LLM traffic through an internal gateway, this is currently the only Copilot surface that cannot comply. Thanks!
SettingPrompter commentedon Nov 4, 2026
have u fixed the patch? do u need help with it? i could take a look if its required
unbadfish
unbadfish commentedon Nov 4, 2026
SettingPrompter Apologize for my delay. I will release my patch on Saturday night (UTC +8). I managed to intergrade inline FIM and next edit suggestion into one patch, but both still need improve.
SettingPrompter commentedon Nov 4, 2026
bet
unbadfish commentedon Nov 4, 2026
A usable patch for vscode 1.145.0, ~2k lines. Much longer than 300 lines provided by the "ghost".
I develop this patch in 1.140.0, edited in 1.142, 1.143, 1.144.1, when vscode bumped from 1.144.1 to 1.145.0, this patch can be cleanly used.
Inline-FIM_NES-1.145.0.patch
Settings and playground:
inline.zip
In short:
FIM
everything lives in
.vscode/settings.jsonunderghost_text.providers[].prompt/suffix:"mode": "fim_completions",prompt/suffixsent as-is."mode": "chat_completions"+messages, and deleteprompt/suffixviarequestDelete."mode": "fim_tokens"+template_kind. UNTESTEDNES
Add an endpoint to the active profile's
chatLanguageModels.json(vendor+name+models[].id/url/apiKey).settings.jsonreference it asvendor/name/id. WhicheverapiTypeit uses (chat-completions,responsesormessages) should be set inchatLanguageModels.json.Screenshot (UI in Chinese):
FIM

NES


SettingPrompter commentedon Nov 4, 2026
took a look, looks fine to me, the mentioned 2k lines is just splitting into files, the backbone has been kept tiny which is the most important part, thanks
balabommablock-cpu commentedon Nov 8, 2026
A product view, since this thread mixes three different asks and they need different amounts of work.
The three asks
github.copilot.selectedCompletionModelaccepts any string, and if the model isn't in the server list it quietly falls back (completions-core/.../openai/model.ts, around line 139, logged at INFO only). ɔɐſʇı̣s (@sitjac)'s report above is exactly this.What already exists
url+apiKeyper model inchatLanguageModels.json.xtabProvider.url/apiKeyoverrides, but they'redefineTeamInternalSetting, so only the team can use them.So the plumbing is mostly there. The missing piece is one public way to say "use this model for completions".
A small path, in order
xisn't available, using the default." This alone would close a lot of confused reports.chatLanguageModels.json, a model can declare a completions endpoint and a format:fim(sendsprompt+suffix) orchat(for gateways that only speak chat). It then shows up in the completions model picker. Keys stay in one place, same as chat. The patches shared here (Support BYOK endpoints for Inline suggestions (fix #318545) #330816, unbadfish's 1.145 patch) show these two formats cover most setups.One line of UI that helps everyone: show "Completions:
<model>at<host>" in the status menu. Local users can see it's really local, and enterprise users can show their security team where traffic goes.A question for the team: is the blocker product policy or quality? Either answer helps. If it's quality, step 2 can ship as "experimental, your model, your results". If it's policy, a clear "not planned" would save this thread a lot of waiting, which is kinder than a quiet backlog.
Step 1 seems worth doing whatever the answer is.
SettingPrompter commentedon Nov 8, 2026
what?
SettingPrompter commentedon Nov 8, 2026
unbadfish what model have you ended up using with nes and autocomplete?