{"slug": "use-your-own-language-model-key-in-vs-code", "title": "Use your own language model key in VS Code", "summary": "Microsoft announced at Build 2026 that VS Code now supports bring your own language model key (BYOK), allowing developers to use models from providers like Azure, Anthropic, OpenAI, or local models via Ollama directly in the Chat model picker without a GitHub Copilot plan. The feature enables greater flexibility for agent workflows and offline scenarios, with billing handled by the provider.", "body_md": "# Use your own language model key in VS Code\n\nJune 18, 2026 by [Kayla Cinnamon](https://github.com/cinnamon-msft)\n\nAt Microsoft Build this year, I had the opportunity to present in the opening keynote. One thing I showed was using local models inside VS Code on the new Surface RTX Spark Dev Box. My model was periodically analyzing my log files and giving me summaries, so I could easily diagnose issues without having to look through the logs myself. Check out the [recording at 12:18](https://build.microsoft.com/sessions/KEY01).\n\nUsing local models gives you even greater flexibility when working with agents. Sometimes you want the built-in models available through GitHub Copilot. Sometimes you want to try a new model from a provider your team already uses. Sometimes you want to experiment locally. VS Code allows you to do all of these workflows with bring your own language model key (BYOK) and bring your own local model.\n\nWith BYOK in VS Code, you can add models from providers like Azure, Anthropic, Huggingface, Gemini, OpenAI, OpenRouter, or you can run a model locally with Ollama, Foundry Local, and more, then use them directly from the Chat model picker.\n\n## What is BYOK?\n\nBYOK lets you use a language model from a supported provider by adding your own API key or endpoint configuration in VS Code. Once configured, those models appear in the same Chat model picker you already use for Copilot. Support is built in for several providers and VS Code is extensible, so any model provider can enable support through an extension.\n\nThis gives you more choice for chat and agent workflows. For example, you can:\n\n- Try models that are not built into VS Code.\n- Use a provider your organization already has billing or governance set up for.\n- Connect to local models through providers such as Ollama or Foundry Local.\n- Pick different models for different tasks, such as quick Q&A, planning, or multi-step agent work.\n\nThe goal is to allow you to choose the right model and keep working.\n\n## What BYOK works with\n\nBYOK models are available for VS Code chat experiences, including agent workflows when the selected model supports the required capabilities.\n\nThere are a few important details to keep in mind:\n\n- BYOK models work\n**without** signing into a GitHub account and**without** a Copilot plan. You can add and use models entirely with your own API keys, including fully**offline scenarios with local models**. - BYOK applies to chat and utility tasks, not standard code completions.\n- Some AI features, such as semantic search, inline suggestions, and features that rely on embeddings, still require a GitHub account or Copilot support.\n- Usage for provider-backed BYOK models is billed directly by that provider and does not count against GitHub Copilot request quotas.\n- For Copilot Business and Enterprise, organization administrators can control BYOK availability through Copilot policy settings.\n\nIn other words, BYOK expands model choice in VS Code Chat, but it does not replace every Copilot-powered feature in the editor.\n\n## Getting started with BYOK\n\nThe easiest way to get started is through the **Language Models** editor.\n\nYou can open it from the Chat model picker by selecting the **Manage Language Models** gear icon, or you can run **Chat: Manage Language Models** from the Command Palette.\n\nThe Language Models editor shows the models available to you, grouped by provider. It also shows useful details like model capabilities, context size, billing information, and whether a model is visible in the picker.\n\nThis is also where you can keep the model picker focused. If you are testing several providers, you can hide models you do not use often and keep your day-to-day models easy to find.\n\n## Adding models from a built-in provider\n\nIf the provider you want is built into VS Code, setup is a few clicks.\n\n- Open\n**Chat: Manage Language Models**. - Select\n**Add Models**. - Choose a provider.\n- Enter a group name for the models. This is the label shown in the model picker and Language Models editor.\n- Enter the provider details, such as an API key, endpoint, deployment name, or other required configuration.\n- Select the model from the Chat model picker.\n\nDepending on the provider, VS Code might open a `chatLanguageModels.json`\n\nfile so you can finish configuring model details.\n\nFor example, a Mistral configuration specifies the endpoint URL, API type, and model capabilities:\n\n```\n[\n  {\n    \"name\": \"Mistral\",\n    \"vendor\": \"customendpoint\",\n    \"apiKey\": \"<your-mistral-api-key>\",\n    \"apiType\": \"chat-completions\",\n    \"models\": [\n      {\n        \"id\": \"mistral-medium-latest\",\n        \"name\": \"mistral medium\",\n        \"url\": \"https://api.mistral.ai/v1/chat/completions\",\n        \"toolCalling\": true,\n        \"vision\": true,\n        \"maxInputTokens\": 256000,\n        \"maxOutputTokens\": 16000\n      }\n    ]\n  }\n]\n```\n\nThe exact fields depend on the provider and model. The important part is that after the provider is configured, the model becomes available from the same picker you use for the rest of Chat. For more information, check out the [Language Model docs](https://code.visualstudio.com/docs/agent-customization/language-models#_add-a-model-from-a-built-in-provider).\n\n## Adding models from extensions\n\nVS Code also supports language model provider extensions. These extensions can contribute models directly into the Language Models editor and Chat model picker.\n\nTo find provider extensions:\n\n- Open the Extensions view.\n- Search for\n`@tag:language-models`\n\n. - Install the provider extension you want to use.\n- Follow the extension's setup instructions.\n- Select the model from the Chat model picker.\n\nThis extensibility is a big part of the BYOK story. Instead of every provider needing to be hard-coded into VS Code, extensions can bring new model providers into the editor as the ecosystem evolves.\n\n## Leveraging utility models\n\nVS Code also uses lightweight models in the background for small tasks like generating chat titles, commit messages, and rename suggestions. These default to built-in Copilot models and most users won't need to touch them. But if you're using BYOK without signing into a GitHub account, those defaults aren't available. VS Code will show a notification in the Chat view prompting you to configure them. Set chat.utilityModel and chat.utilitySmallModel to one of your BYOK models to keep those features working. A fast, inexpensive model works well here.\n\n## Choosing the right model\n\nOne of the best parts of BYOK is that you do not have to use one model for everything.\n\nFor everyday work, you might choose:\n\n- A fast model for quick questions, summaries, and small edits.\n- A reasoning model for planning, debugging, or complex refactors.\n- A local model when you want to experiment offline.\n- A provider-specific model when your team already has workflows around that provider.\n\nSimply choose which model you want to use in the model picker below the Chat box.\n\n## Try it out\n\nBYOK gives you more flexibility in VS Code without adding more tools to your workflow. You can keep using the built-in Copilot models, add models from providers you already use, experiment with local models, and choose the right model for each task from one place.\n\nTo learn more, check out the VS Code docs on [AI language models](https://code.visualstudio.com/docs/agent-customization/language-models), the VS Code blog post on [Expanding Model Choice in VS Code with Bring Your Own Key](https://code.visualstudio.com/blogs/2025/10/22/bring-your-own-key), and the GitHub changelog entry for [BYOK availability in VS Code](https://github.blog/changelog/2026-04-22-bring-your-own-language-model-key-in-vs-code-now-available/).\n\nWe also have a video for how to [Bring Your Own AI... No Sign-In Required!](https://www.youtube.com/watch?v=EB7dQv1ALCU).\n\nWe are continuing to improve model choice in VS Code, and your feedback helps shape what comes next. Try BYOK with your workflow and let us know what you think in the [VS Code repository](https://github.com/microsoft/vscode).\n\nHappy coding! 💙", "url": "https://wpnews.pro/news/use-your-own-language-model-key-in-vs-code", "canonical_source": "https://code.visualstudio.com/blogs/2026/06/18/byok-vscode", "published_at": "2026-06-18 00:00:00+00:00", "updated_at": "2026-06-18 13:56:20.522590+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-tools", "ai-agents"], "entities": ["Microsoft", "VS Code", "GitHub Copilot", "Azure", "Anthropic", "OpenAI", "Ollama", "Huggingface"], "alternates": {"html": "https://wpnews.pro/news/use-your-own-language-model-key-in-vs-code", "markdown": "https://wpnews.pro/news/use-your-own-language-model-key-in-vs-code.md", "text": "https://wpnews.pro/news/use-your-own-language-model-key-in-vs-code.txt", "jsonld": "https://wpnews.pro/news/use-your-own-language-model-key-in-vs-code.jsonld"}}