Skip to content

Use copilot with local models completely offline #246551

Closed

Description

@Igorgro

In the latest version of VSCode it is now possible to use local models (for example ollama) in the copilot (https://code.visualstudio.com/docs/copilot/language-models#_bring-your-own-language-model-key). However it still requires to login to GitHub to get started. Can this limitation be removed to allow use of copilot with local model completely offline?

Activity

  1. okamototk commented on Apr 17, 2025

    @okamototk

    For super confidencial project such as fsi, national defence or goverment project, we often can't allow to access public internet service. Also I heard some automotive projects around Europe have similllar situation.

    If vscode support offline with ollama completely, it could be big help for such projects.

  2. added
    feature-request
    on Apr 30, 2025
  3. 334456777 commented on May 18, 2025

    @334456777

    The same as me

  4. trymeouteh commented on May 29, 2025

    @trymeouteh

    Would like to be able to use the ai features in VSCode with ollama or other AI providers without needing a Github account

  5. ak99372 commented on Jun 25, 2025

    @ak99372

    Copilot shouldn't be built into VS Code to begin with. Dev's should have a choice which AI to integrate with through extensions (like with everything else). That would solve all privacy issues as well.

  6. 64 remaining items

  7. dmitrivMS commented on May 22, 2026

    @dmitrivMS
    Collaborator

    Vijay Upadya (@vijayupadya) Could you comment?

  8. vijayupadya commented on May 22, 2026

    @vijayupadya
    Contributor

    This looks like it's from the Copilot Free session rate-limit counter sourced from CAPI's x-usage-ratelimit-session header, surfaced because the user is signed into Copilot Free; the BYOK provider isn't the source.

    Even when chat completions go through their BYOK provider (GLM-5.1-Coding), other Copilot-backed calls still hit CAPI with their Copilot token — e.g., model/metadata listing, embeddings, the auxiliary "summarization/small" model, etc. Those CAPI responses carry the quota + x-usage-ratelimit-session headers, which feed this notification.

  9. junliu-mde commented on May 22, 2026

    @junliu-mde

    This looks like it's from the Copilot Free session rate-limit counter sourced from CAPI's x-usage-ratelimit-session header, surfaced because the user is signed into Copilot Free; the BYOK provider isn't the source.

    Even when chat completions go through their BYOK provider (GLM-5.1-Coding), other Copilot-backed calls still hit CAPI with their Copilot token — e.g., model/metadata listing, embeddings, the auxiliary "summarization/small" model, etc. Those CAPI responses carry the quota + x-usage-ratelimit-session headers, which feed this notification.

    Thanks for the prompt reply. I think the user prompt here could be more clear.

  10. dmitrivMS commented on May 22, 2026

    @dmitrivMS
    Collaborator

    Jun Liu (@junliu-mde) You could also override the utility models to point them at the same BYOK using chat.utilityModel and chat.utilityModelSmall settings.

  11. Igorgro commented on May 22, 2026

    @Igorgro
    Author

    Huge thanks for implementing this feature. I tried to use it with "chat.allowAnonymousAccess": false so that copilot do not perform any request upstream. However I noticed this one irritating issue. When running new chat, it makes 4 calls to provider, as shown in the debugger view:

    Image

    There one request is the chat message itself, title (meh, but ok) and 2(!) requests for generating buzzword to show to user while response is generating. All these requests are sent in parallel. So I have 2 questions: 1. why there 2 identical requests are sent. 2. How can these utility requests can be disabled, because I can only run single LLM on my ollama and 4 parallel requests are executed sequentially resulting in answer appears far too late - each chat have a 2 minute cooldown to start.

  12. dmitrivMS commented on May 22, 2026

    @dmitrivMS
    Collaborator

    Igor Mahov (@Igorgro) If you are signed out, set chat.allowAnonoymouseAccess to false and keep chat.utilityModel and chat.utilityModelSmall to Default it will not make any utility calls. However, that will turn off a lot more things than title updates.

    We are discussing providing more control over individual utility operations, but those 2 settings is what you have right now.
    I suggest you open new issue(s) for the concerns above.

    Vritant Bhardwaj (@vritant24) FYI

  13. Igorgro commented on May 22, 2026

    @Igorgro
    Author

    Dmitriy Vasyura (@dmitrivMS) Yes, I agree that this is not a good solution. I definitely don't want to lose functionality provided by these models. Being able to just disable buzzword generation will be a good solution. However, I have an idea on how this can be implemented in other way. The base problem here is that to use chat itself I should load ollama model with sufficient context size (40k+). However Copilot Ollama provider does not provide (or I didn't find it in docs) to set num_ctx param for each model separately. So I'm now setting global param via OLLAMA_CONTEXT_LENGTH server env variable. However it will result in the inability to load second small utility model because it will be loaded with same redundantly big context (according to debug view small generations take less than 1000 tokens). So implementing per-model context size param can be a possible solution. I can file this as a separate issue

  14. MorganMarshall commented on May 23, 2026

    @MorganMarshall

    Just one question, will inline suggestion work with local models?. i.e. there is no quota in anony mode?

    Inline suggestions (aka code complete) isn't meant to work as those are custom-trained models and are no longer compatible with chatcompletion-based models.

    Inline code completions/autocomplete/code completions are to be routed to the local models

  15. bartlettroscoe commented on May 23, 2026

    @bartlettroscoe

    @dmitrivMS ... However Copilot Ollama provider does not provide (or I didn't find it in docs) to set num_ctx param for each model separately.

    Is it not possible to just call llama-swap/llama-server as the model inference server? That way, you can customize each model any way you want.

  16. added and removed
    verification-needed
    on May 25, 2026
  17. MattTheCuber commented on Jun 10, 2026

    @MattTheCuber

    Is there an issue tracking adding a feature for supporting inline suggestions (code completion) with BYOK (local models)?

  18. dmitrivMS commented on Jun 10, 2026

    @dmitrivMS
    Collaborator
  19. MattTheCuber commented on Jun 10, 2026

    @MattTheCuber

    Thank you!

  20. locked and limited conversation to collaborators on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedmodel-byokon-testplan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions