Choose model in Copilot provider using Util.AI.Ask
Using Util.AI.Ask I can select a specific model:
var model = AIModel.FindByID("gpt-4.1-mini") ?? AIModel.DefaultChatModel;
var aiOptions = new AIRequestOptions
{
Model = model,
BypassCache = true,
MaxTokens = 150,
SystemPrompt = "You are a concise technical summariser."
};
var response = await Util.AI.Ask("Some prompt", aiOptions)
.GetResponseAsync(ScriptCancelToken);
string summary = response.Text.Trim();
This great, but is there a way to specify GitHub Copilot as a provider and then pick one of the models from there?
I see that I can select the right provider, with this:
var copilotProvider = AIProvider.All.FirstOrDefault(p => p.ID == "Copilot"); copilotProvider.Models.Dump();
but the output only reports a single 'not connected' model - is there a way around this?

Best Answer
-
It was likely after an update where the CLI version changed. As soon as you use an AI feature from the GUI, it will ask if you want to restore the Copilot packages, which should also enable Util.AI.Ask.
Answers
-
Not sure what the difference is, but this works for me and shows me the same three models I see in the Settings page.
Using LP 9.8.8 and copilot is just the standard linked to my github.com account.
-
Thank you for checking. Today, of course, it does populate the Copilot models as well. I'm pretty sure I was on 9.8.8 when I ran this yesterday (and am now).
I have two providers (Azure.OpenAI and Copilot) and I toggled the Agent and Chat model drop down in settings (for Copilot). All three Tasks were on automatic.
So not sure what changed but it's working now:

-
Ah that makes sense. I was curious enough to take a screenshot because I've only seen updating on opening queries before (I think)....so that's answered two questions in one
Thank you.
-
Curious: will you still be using Copilot after June 1?
-
Probably, but I'll see how this goes.
I'm not currently firing off multiple parallel agents, so I'm guessing my overall token usage will be ok. I'm more concerned with the usage limits, which I can see being a pretty frustrating experience if you hit them in mid-session.
There seems to be a general service-tightening across most of the providers so my assumption is that none of them are going to get materially out of line with each other.....but I guess we'll see.

