Today we will explain how to use Ollama from a custom provider for GitHub Copilot.

The first thing we need to have is GitHub Copilot installed in our VS Code
And also Ollama installed (recommended in a remote environment).
Once all the necessary services are ready, we proceed with action.
We open VS Code and open the Github Copilot extension.
Click on select model (Set Auto or the currently selected model), appears below the chat.

Inside Other Models click on settings:

Now in Add Models > Custom Endpoint

And now we fill in what is asked for and this JSON:
"models": [ { "id": "", "name": "", "url": "", "toolCalling": true, "vision": true, "maxInputTokens": 128000, "maxOutputTokens": 16000 } ] }
It will ask for name and then an API key, the OLLAMA API key is:
ollama
For the URL we put baseURL + /chat/completions:
https://ourdomain_ollama.com/v1/chat/completions
Or if it’s on local:
http://localhost:11434/v1/chat/completions
To view the models that are installed:
https://ourdomain_ollama.com/api/tags
