Microsoft just showed how to run a proper agentic coding model on your own PC and plug it straight into GitHub Copilot. The model is Alibaba’s Qwen3.8-27B, served locally by Foundry Local, with no Azure account and no per-token bill.
The guide landed on Microsoft’s Foundry blog on 5 November 2026, together with Foundry Local CLI 0.13.0. The catch is hardware: you need an NVIDIA card with 24 GB of VRAM or more.
Below you get everything in one place: specs, benchmarks, the exact commands, how to connect the Copilot app and VS Code, which GPUs work, how it compares with Ollama and LM Studio, fixes for common errors, and an honest look at the limits.
- What: Microsoft’s Foundry Local now serves a tuned 4-bit Qwen3.8-27B (about 18 GB) as a local, OpenAI-compatible endpoint that GitHub Copilot can use through Bring Your Own Key (BYOK).
- Hardware: NVIDIA GPU with 24 GB+ VRAM for up to 64K context; 32 GB+ for the full 262K. CUDA 12 and cuDNN 9 installed separately.
- Setup:
winget install Microsoft.FoundryLocal, thenfoundry model load qwen3.8-27b, then paste the address fromfoundry server statusinto Copilot. - Scores (Qwen model card, vendor-reported): Terminal Bench 2.1 73.0, SWE-bench Pro 61.7.
- Speed: Microsoft says it beat llama.cpp at every prompt length on an RTX 5090 and DGX Spark, with the gap widening past 131K tokens. No independent numbers yet.
- Not yet: Mac and AMD GPU support (planned). 16 GB cards are not officially supported.
- Cost: free. Model licence is Apache 2.0; Foundry Local is in public preview.
What Microsoft Announced
The post is called “Bring Agentic Coding On-Device with Foundry Local”. It was written by Baiju Meswani, Emma Ning and Tianlei Wu from the Microsoft Foundry team.
Foundry Local is Microsoft’s free runtime for running AI models on your own machine. It is built on ONNX Runtime (onnxruntime-genai) and exposes an OpenAI-style API on localhost, so any tool that speaks that API can use it.
What is new is a coding-grade model tuned for it. Microsoft calls Qwen3.8-27B its “primary optimization target” and lists the work it did:
- INT4 weights plus KV-cache quantization, so the model fits in about 18 GB.
- Speculative decoding (named “DFlash2” in the post) to speed up generation.
- CUDA graph fusions and kernel tuning, including for the SM121 architecture used by DGX Spark.
- Prefix caching and continuous batching, which help when an agent sends the same long context again and again.
- Embedding memory sharing and CPU offloading to stretch VRAM.
The recipe is public in Microsoft’s olive-recipes GitHub repo under Qwen-Qwen3.8-27B/cuda, so you can see how the model was converted.
Note: Qwen3.8-27B itself is not new. Alibaba released it in August 2026. The news is that Microsoft now ships an optimised build and an official path into GitHub Copilot.
Qwen3.8-27B Specs and Benchmarks
| Spec | Qwen3.8-27B |
|---|---|
| Maker | Alibaba Qwen team |
| Type | Dense 27B model (not MoE), hybrid Gated DeltaNet + Gated Attention, 64 layers |
| Inputs | Text, image and video in; text out |
| Context | 262,144 tokens native; up to 1M with YaRN scaling |
| Thinking | On by default; can be turned off per request |
| Licence | Apache 2.0 (commercial use allowed) |
| Foundry Local build | 4-bit, about 18 GB |
| CLI alias | qwen3.8-27b |
Here are the coding and agent benchmarks from the Qwen model card. These are vendor-reported and were not run inside Copilot.
| Benchmark | Qwen3.8-27B | Qwen3.6-27B | Claude Opus 4.6 (Max) |
|---|---|---|---|
| Terminal Bench 2.1 | 73.0 | 63.4 | 78.2 |
| SWE-bench Pro | 61.7 | 53.5 | n/a |
| NL2Repo-Bench | 42.3 | 36.2 | 47.6 |
| DeepSWE 1.1 | 42.2 | 13.3 | n/a |
| LiveCodeBench v6 | 90.3 | 83.9 | n/a |
So a 27B model that fits on one gaming card lands within a few points of a top cloud model on terminal tasks. Windows Forum notes that some of these runs used a Claude Code style harness, so results inside Copilot may differ.
How fast is it?
Microsoft compared Foundry Local with llama.cpp on an RTX 5090 (32 GB) and a DGX Spark (128 GB unified memory), using prompts built from real GitHub issues. It says Foundry Local generated faster at every prompt length tested, and that the lead grew beyond 131K tokens.
The post shows the numbers only in charts. One developer write-up reads them as roughly 1.5 to 1.9 times llama.cpp on the 5090. Microsoft has not published the llama.cpp version or settings, so treat this as a vendor claim until someone replicates it.
Which GPU Do You Need?
Microsoft’s own wording is clear: an NVIDIA GPU with at least 24 GB of VRAM. Here is what that means in practice.
| Your GPU | Works? | Max context (Microsoft guidance) |
|---|---|---|
| RTX 3090 / 3090 Ti / 4090 (24 GB) | Yes | Up to 64K |
| RTX 5090 (32 GB) | Yes, test machine | Full 262K |
| NVIDIA DGX Spark (128 GB) | Yes, test machine | Full 262K |
| RTX PRO / workstation cards with 32 GB+ | Should work (NVIDIA, enough VRAM) | Full 262K |
| 16 GB cards (RTX 5080, 5070 Ti, 4080) | Not supported officially | Use a GGUF build instead |
| AMD Radeon, Intel Arc | No (AMD planned) | n/a |
| Apple Silicon Mac | No for this path (planned) | n/a |
Tip: On a 16 GB card you can still run this model with a smaller GGUF quant in Ollama or LM Studio. Our guide to running Qwen3.8-27B on a 16 GB GPU has the exact files and settings.
Other requirements:
- Windows 11 on x64 (Microsoft’s steps use WinGet). ARM64 builds need CUDA 13.
- CUDA 12 and cuDNN 9 on x64, with their DLL folders on your PATH. Foundry Local does not install them.
- Foundry Local CLI 0.13.0 or newer (public preview, released 2 November 2026).
- Disk: about 18 GB for the model, plus room for CUDA.
Not sure what your card has? See how to check GPU VRAM and usage. Shopping for one? Our best GPU for local LLMs list and the RTX 5090 vs RTX 5080 for AI comparison cover prices.
Step by Step: Install Foundry Local and Load the Model
Plan for about 30 to 60 minutes, most of it downloading CUDA and the model. Open a new PowerShell window for each step that changes PATH.
- Check your GPU and driver. Run
nvidia-smi. You should see your card name and at least 24 GB under memory. If the command is missing, install the latest NVIDIA driver and reboot. - Install CUDA 12 and cuDNN 9. Use NVIDIA’s installers, then make sure both DLL folders are on your system PATH. Check with
nvcc --versionandwhere.exe cudnn64_*.dll. - Install Foundry Local. Run
winget install Microsoft.FoundryLocal. If you already have it, runwinget upgrade Microsoft.FoundryLocal. - Confirm the version. Run
foundry --version. It must show 0.13.0 or higher. - Restart the service if needed. If Foundry Local was already running before you changed PATH, run
foundry server restartfrom a fresh terminal. - Find the model ID. Run
foundry model list. Microsoft uses the aliasqwen3.8-27b; one third-party guide showsqwen3-8-27b, so use whatever your catalog prints. - Download and load it. Run
foundry model load qwen3.8-27b. The first run downloads about 18 GB. Watchnvidia-smi: VRAM use should jump. If it does not, the runtime fell back to CPU (see Troubleshooting). - Get your endpoint. Run
foundry server status. Copy the address it prints, which looks likehttp://127.0.0.1:PORT/v1. The port is picked on your machine, so do not copy one from a guide.
Warning: Close Ollama, LM Studio, ComfyUI and games before loading. Another app holding 6 to 8 GB of VRAM is the most common reason the load fails on a 24 GB card.
Test the Local Endpoint
Before touching Copilot, make sure the server answers. Replace PORT with your number from foundry server status.
List the loaded models:
curl.exe http://127.0.0.1:PORT/v1/models
Send a quick chat request from PowerShell:
$body = @{
model = "qwen3.8-27b"
messages = @(@{ role = "user"; content = "Write a Python function that reverses a string. Code only." })
max_tokens = 800
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "http://127.0.0.1:PORT/v1/chat/completions" -Method Post -ContentType "application/json" -Body $body
Thinking mode spends tokens before it answers, so keep max_tokens generous. If the reply is empty or cut off, raise it.
The Qwen team recommends these sampling settings if your client lets you set them:
| Mode | temperature | top_p | top_k | presence_penalty |
|---|---|---|---|---|
| Thinking (default) | 1.0 | 0.95 | 20 | 0.0 |
| Non-thinking | 0.7 | 0.80 | 20 | 1.5 |
Connect GitHub Copilot (App and VS Code)
GitHub calls this local BYOK. Per GitHub’s docs it works in VS Code, JetBrains IDEs, Xcode, Copilot CLI, the GitHub Copilot app and the Copilot SDK, and it does not depend on the Copilot API.
In the GitHub Copilot app (Microsoft’s documented path)
- Open Settings in the GitHub Copilot app and go to Model providers.
- Choose Add provider and select Foundry Local.
- Paste your endpoint from
foundry server statusinto Base URL. - Open Browse Catalog, search for Qwen3.8-27B and add it.
- Pick the model. Set the provider to Foundry Local and choose Qwen3.8-27B in the model picker.
In VS Code
Microsoft’s post only documents the Copilot app. In VS Code the flow is similar, but menu names change between Copilot Chat builds:
- Open Copilot Chat and click the model picker, then Manage Models.
- Add a provider. Pick Foundry Local if your build lists it, or an OpenAI-compatible provider if not.
- Enter the endpoint including
/v1. If a key is required, any placeholder such aslocalworks, because the local server does not check it. - Select Qwen3.8-27B in agent mode and give it a real task on an open file.
Watch nvidia-smi -l 1 while it works. GPU use should spike, which proves the request is running locally.
Note: On Copilot Business and Enterprise, an organisation policy can switch off local BYOK in IDEs. If you see no provider option, ask your admin. Local BYOK is described as usable without a Copilot subscription.
If you want other agent front ends for the same local model, our Cline, Continue and Roo Code in VS Code guide works with any OpenAI-compatible endpoint, and GitHub Copilot in Xcode covers the Mac side of Copilot.
Foundry Local vs Ollama vs LM Studio vs llama.cpp
| Foundry Local | Ollama | LM Studio | llama.cpp | |
|---|---|---|---|---|
| Engine | ONNX Runtime GenAI (CUDA) | llama.cpp-based (GGUF) | llama.cpp / MLX | Native GGUF |
| Qwen3.8-27B build | Microsoft-tuned 4-bit, ~18 GB | Community GGUF quants | Community GGUF / MLX | Any GGUF quant |
| Min VRAM for this model | 24 GB NVIDIA | ~16 GB with smaller quants | ~16 GB with smaller quants | ~16 GB, or CPU offload |
| AMD / Mac | Not yet (planned) | Yes | Yes | Yes |
| Copilot integration | Named provider in the Copilot app | Via BYOK / OpenAI-compatible | Via OpenAI-compatible | Via OpenAI-compatible |
| Speed claim | Faster than llama.cpp (Microsoft) | Similar to llama.cpp | Similar to llama.cpp | Baseline |
| Best for | 24 GB+ NVIDIA on Windows, long contexts | Easiest all-rounder | GUI users, Macs | Max control, odd hardware |
Pick Foundry Local if you have a 24 GB+ NVIDIA card on Windows and work with big repos, where its long-context speed should matter most. Pick Ollama or LM Studio for smaller cards, Macs or AMD. Our Ollama vs LM Studio vs llama.cpp guide goes deeper, and best Ollama models by VRAM lists alternatives.
Compared with cloud agents such as Claude Code or Cursor, you trade some reasoning power for privacy and zero running cost. Our Cursor vs Windsurf vs Claude Code vs Cline comparison covers that side.
Privacy: What Stays on Your PC
- Stays local: the prompts and code sent to the model, and the model’s replies. GitHub’s BYOK docs say requests go from the client straight to your chosen provider.
- May still use the network: Copilot sign-in, extensions, some tool calls, and features such as inline completions that may still use GitHub’s own models.
- Microsoft side: the model catalog and Foundry Local telemetry are run by Microsoft.
A simple test: disconnect from the internet and check that agent chat with Qwen3.8-27B still answers. If you need a strict air gap, confirm every Copilot feature you use with your security team.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
foundry is not recognized |
Terminal opened before install | Open a new terminal; reinstall with WinGet if needed |
Model missing from foundry model list |
CLI older than 0.13.0 | winget upgrade Microsoft.FoundryLocal, then a new terminal |
| Very slow replies, GPU idle | CUDA or cuDNN not found, CPU fallback | Check CUDA 12 / cuDNN 9 DLLs are on PATH, then foundry server restart |
| Out of memory on load | Other apps using VRAM | Close Ollama, LM Studio, games; check nvidia-smi |
| Out of memory mid-task | Context above ~64K on a 24 GB card | Attach fewer files, split the task, or use a 32 GB card. See our CUDA out of memory fix |
| Copilot cannot connect | Port changed or missing /v1 |
Re-run foundry server status, test with curl, re-paste |
| No Foundry Local option in Copilot | Old client or org policy | Update the app or extension; ask your admin about BYOK |
| Answers cut off or empty | Thinking used the token limit | Raise max_tokens or turn thinking off |
| Model gone after reboot | Service restarted | Run foundry model load qwen3.8-27b again (a logon task can automate it) |
Limits, Licence and Open Questions
- Licence: Qwen3.8-27B is Apache 2.0, so commercial use is fine. Foundry Local is a free Microsoft preview.
- NVIDIA only for now: Microsoft says more devices, including Macs and AMD GPUs, are on the roadmap, with no date.
- Weaker than the best cloud models: Microsoft itself says local models have “limited reasoning capabilities” and suggests a hybrid setup, local for routine work and cloud for hard problems.
- Multi-GPU: the post does not say whether Foundry Local can split this model across two cards, so do not count on two 16 GB GPUs working.
- Unverified speed: no tokens-per-second figures in text and no llama.cpp settings, so wait for independent tests.
- Preview software: menus, model IDs and ports may change between builds.
My Take
This is the first time a big vendor has given ordinary developers an official, tuned path from “local model” to “agent inside Copilot”. That matters more than the benchmark numbers.
A 73 on Terminal Bench 2.1 from a model that fits on an RTX 4090 is genuinely useful for refactors, tests and repo chores. For gnarly architecture work I would still reach for a cloud model, exactly as Microsoft suggests.
The 24 GB floor is the real limit. If you own a 3090, 4090 or 5090, try it today. If you are on a 16 GB card, stay with a GGUF build in Ollama or LM Studio until Microsoft adds smaller variants.
FAQ
Is Foundry Local free?
Yes. Foundry Local is a free Microsoft runtime in public preview, it needs no Azure subscription, and there is no per-token charge.
Do I need a paid GitHub Copilot plan?
GitHub’s docs describe local BYOK as usable without a Copilot subscription. On Business or Enterprise plans, your admin can disable it with a policy.
Can I run it on a 16 GB GPU like the RTX 5080?
Not with Microsoft’s build, which needs 24 GB. You can run smaller GGUF quants of Qwen3.8-27B on 16 GB through Ollama, LM Studio or llama.cpp.
Does it work on a Mac or an AMD GPU?
Not yet. Microsoft lists Macs and AMD GPUs as planned, without a date.
Is my code sent to GitHub or Microsoft?
Prompts to the local model stay on your machine. Sign-in, extensions and some other Copilot features can still use the network.
What context length can I use?
Up to about 64K tokens on a 24 GB card and the model’s full 262K on cards with 32 GB or more, per Microsoft.
How good is Qwen3.8-27B at coding?
Qwen reports 73.0 on Terminal Bench 2.1 and 61.7 on SWE-bench Pro, a few points behind Claude Opus 4.6 on terminal tasks. These are vendor numbers, not Copilot tests.
Sources
- Microsoft Foundry Blog: “Bring Agentic Coding On-Device with Foundry Local” (5 Nov 2026), devblogs.microsoft.com/foundry/foundry-local-agentic-coding-qwen3-8-27b/
- Qwen3.8-27B model card, huggingface.co/Qwen/Qwen3.8-27B
- GitHub Docs: Bring your own key (BYOK), docs.github.com/en/copilot/concepts/models/bring-your-own-key
- Foundry Local releases, github.com/microsoft/foundry-local/releases
- Windows Forum: “Run Qwen3.8-27B Locally with GitHub Copilot and Foundry Local on Windows” (CUDA/cuDNN versions, troubleshooting)
- Tech Insider: step-by-step Foundry Local + Copilot setup (model ID, PowerShell tests)
- AI Weekly alert, 6 Nov 2026: “Microsoft Foundry Local runs Qwen3.8-27B on-device for Copilot”



