Handy sidekick.nvim config for using custom models with copilot cli
GitHub Copilot CLI can work with custom models, but switching between these in an active session is not possible. This will hopefully be fixed soon, but in the meantime here's a decent-ish workaround I have in my Sidekick.nvim configuration.
I'm currently testing Regolo.ai to see if working with European LLM inference would be a valid substitute for GitHub Copilot business subscriptions. I've been using and rather liking the Copilot CLI integrated into my Neovim setup via Sidekick.
All in all, setting everything up has been pretty straightforward, but currently the CLI is a binary choice - either use a single custom model, or have access to all the enabled models from the Copilot model catalog.
The setup for custom (openai compatible) models is configured via environment variables:
export COPILOT_PROVIDER_BASE_URL=https://api.openai.com/v1
export COPILOT_PROVIDER_API_KEY=YOUR-OPENAI-API-KEY
copilot --model YOUR-MODEL-NAME
Where COPILOT_PROVIDER_BASE_URL is the thing that decides which mode you're running in.
Switching between modes and models then becomes a matter of manipulating those environment variables and restarting the client, which gets really boring really fast.
Luckily Sidekick provides a good workaround. The key is to configure different CLI tools:
- Set
COPILOT_PROVIDER_API_KEYsomewhere so it's available for nvim (e.g.~/.profileor use something more secure) - Add different models as custom tools in sidekick config. Here's the relevant part (vim.pack syntax):
require('sidekick').setup({
cli = {
tools = {
cop36 = {
cmd = { "copilot", "--model", "qwen3.6-27b" },
env = {
COPILOT_PROVIDER_BASE_URL = "https://api.regolo.ai/v1",
},
},
cop35 = {
cmd = { "copilot", "--model", "qwen3.5-122b" },
env = {
COPILOT_PROVIDER_BASE_URL = "https://api.regolo.ai/v1",
},
},
},
},
})
This adds cop35 and cop36 to the list of available tools, and all three (including the standard copilot experience) can be opened simultaneously. Then I can switch between those, delegating jobs to the different models as needs arise.
So then a basic workflow for me looks like:
as1<enter>opens a vertical tab for tool 1 (alphabetically, cop35)as2<enter>opens the normal CLI as wellaa1toggles the view 1,aa2view 2 etc. meaning I can easily hide/show/jump to different contexts
Of course all of this will become irrelevant if Copilot CLI ever allows to use custom providers side by side with the standard catalog or even the standard /models endpoint to allow selection from your custom catalog.
In the meantime, though, this allows me to continue testing the power of the open models and European inference. Timely, since the most common response from Copilot in the past few days has been "transient server error, retrying..."
Thoughts, comments? Send me an email!