*** Update 2026-09-10: This post is updated for the Sept. build of VS 2026 (18.10.0). ***
The model picker for GitHub Copilot in Visual Studio 2026 would not let me add Ollama running on another machine on my local network. It only allowed http://localhost:11434 or a URL that started with https. Even after configuring https:// to work with ollama and successfully testing that with curl in Powershell I got Status 502: (Bad Gateway) when I tried to use the model in Copilot chat.
I needed it to permit me to save and use local IP addresses or “.local” Active Directory DNS-resolved addresses. On my network Ollama (port 11434) and oMLX (port 8000) run on dedicated machines. I run Visual Studio and SSMS on other computers and need to connect to locally hosted models over the LAN.
This can be done with a work-around. Visual Studio validates to see if Ollama is installed on your development machine, which I don’t want. Here is a sample configuration you can edit:
[
{
“Name”: “ollama”,
“IsApiKeyAvailable”: false,
“Models”: [
{
“ProviderName”: “ollama”,
“IsCustom”: true,
“IsSelected”: true,
“CustomURL”: “http://[your ip address]:8000/v1”,
“Id”: “qwen3.6:35b”,
“DisplayName”: “qwen3.6:35b (Qwen3.6 35B)”,
“IsToolCallingEnabled”: true,
“IsVisionEnabled”: false,
“MaxInputTokens”: 262144,
“MaxOutputTokens”: 8192
},
{
“ProviderName”: “ollama”,
“IsCustom”: true,
“IsSelected”: true,
“CustomURL”: “http://[your ip address]:8000/v1”,
“Id”: “qwen3.8:27b”,
“DisplayName”: “qwen3.8:27b (Qwen3.8 27B)”,
“IsToolCallingEnabled”: true,
“IsVisionEnabled”: false,
“MaxInputTokens”: 262144,
“MaxOutputTokens”: 8192
}
],
“Endpoint”: 10,
“IsEnabled”: true
}
]
Save the file as: C:\Users\[YourWindowsLogin]\AppData\Local\Microsoft\VisualStudio\Copilot\BringYourOwnModel\ConfiguredBringYourOwnModel_v2.json
Close and reopen Visual Studio 2026 or SSMS 22.10.0 and the local model will be available. They both use the same configuration file.
In Visual Studio you MUST select “Agent (Preview)” or the local models will be disabled. You may have to enable “Allow custom agents to be used as sub-agents (Preview)” in the Copilot Chat settings in SSMS.

This is not a problem for VS Code, but was necessary as of mid-July, 2026, in order to use locally hosted models on a different computer on the LAN in GitHub Copilot in the VS 2026 IDE or SSMS.
There’s an entry in the Microsoft Developer Community about this here.
