Ability to use Free Models (0x credits) in Copilot CLI
Describe the feature or problem you'd like to solve
The Copilot CLI uses Sonnet 4 by default which incurs 1x cost / message.
Proposed solution
In the Copilot CLI, I wish we could select from a list of free models provided by GitHub Copilot eg. GPT-4.1, GPT-4o, GPT-5 mini, Grok Code Fast 1 etc. This would let us optimize our monthly quota. Thank you for considering.
Example prompts or workflows
No response
Additional context
No response
+1'd. This is definitely the reason I'm not using the cli for now. Sometimes I ask some very simple questions and I wouldn't want to use a premium request for that!
+1. Support adding free models rather than wasting premium request credits on simple tasks. This is crucial for our long-term use of Copilot CLI.
This is indeed very necessary for me to use the cli viably. I feel vscode has the best gh copilot experience right now but much of that should be ported to the cli, starting with more model availability
+1 , some task maybe just want to read, but wasting the premium
+1 maybe I can replace codecompanion.nvim with sidekick.nvim that use Copilot CLI.
+1
+1
👍
This really should be prioritized to include at least one 0x multiplier model, and set it as the default.
+1
Max priority👍🏻
this should be a priority, the tool currently forces the use of expensive models for very simple tasks.
+1
Yes please!
+1
Since it's using public API I believe you can achieve that by changing @github\copilot\index.js
There's a line
=["claude-sonnet-4.5","claude-sonnet-4","gpt-5"];
That can be replaced with:
=["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"];
Then go to your .copilot/config.json and a model of your choice:
{
"banner": "never",
"model": "grok-code-fast-1",
"render_markdown": true,
"screen_reader": false,
"theme": "auto"
}
Since it's using public API I believe you can achieve that by changing
@github\copilot\index.jsThere's a line
var Nk=["claude-sonnet-4.5","claude-sonnet-4","gpt-5"]; That can be replaced with:
var Nk=["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"]; Then go to your
.copilot/config.jsonand a model of your choice:{ "banner": "never", "model": "grok-code-fast-1", "render_markdown": true, "screen_reader": false, "theme": "auto" }
This is a hack man
Confirmed this works, but will probably break next time you update
Since it's using public API I believe you can achieve that by changing
@github\copilot\index.jsThere's a line
var Nk=["claude-sonnet-4.5","claude-sonnet-4","gpt-5"]; That can be replaced with:
var Nk=["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"]; Then go to your
.copilot/config.jsonand a model of your choice:{ "banner": "never", "model": "grok-code-fast-1", "render_markdown": true, "screen_reader": false, "theme": "auto" }
Cool, we can create a PR
Following up the workaround from @meregoodsamaritan , I'm pasting here the convenient bash command:
sed -i.bak 's/var Nk=\["claude-sonnet-4\.5","claude-sonnet-4","gpt-5"\];/var
Nk=["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"];/'
<global_node_modules>/@github/copilot/index.js
Or, you can simply ask GitHub Copilot CLI to do it for you:
- start
copilot - copy the content from @meregoodsamaritan above, and enter
- set the environment variable
COPILOT_MODEL:COPILOT_MODEL=grok-code-fast-1 copilot
Everything working fine on 0.0.338 but it'll definitely change in the later release.
Great job @meregoodsamaritan !
Cool, we can create a PR
It seems typescript code for copilot-cli is not publicly available, they seem to release just compiled .js, and this repo is just for gathering issues.
Any ideas what's the reliable source for all available models for copilot, to include them all?
In VS Code there's also Copilot SWE that has 0x - but I'm not sure what is its code name (copilot-swe?).
Since it's using public API I believe you can achieve that by changing
@github\copilot\index.jsThere's a line
var Nk=["claude-sonnet-4.5","claude-sonnet-4","gpt-5"];
That can be replaced with:
var Nk=["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"];
Then go to your
.copilot/config.jsonand a model of your choice:{ "banner": "never", "model": "grok-code-fast-1", "render_markdown": true, "screen_reader": false, "theme": "auto" }
for me it seems like it was var Ek instead of var Nk, so it does seem to change (possibly with every version update)
for me it seems like it was
var Ekinstead ofvar Nk, so it does seem to change (possibly with every version update)
Yeah, copilot updated today. I've removed var Nk= part from the message, since it should be unique match either way.
Any ideas what's the reliable source for all available models for copilot, to include them all?
Found it - there's models.json with full info about existing models. There are some additional models, but it seems they're either outdated or not for chat.
api url - https://api.individual.githubcopilot.com/models (requires access token) models.json - https://pastebin.com/VdVUfFsm
A feature request with many upvotes and very easy to do, and they won't do it? Classic case of conflict in their business model.
Even if they did add 0x models, I can guarantee it will be rate limited to hell.
A feature request with many upvotes and very easy to do, and they won't do it? Classic case of conflict in their business model.
Even if they did add 0x models, I can guarantee it will be rate limited to hell.
Maybe they're keeping it to announce it to the universe.
+1
Here's what I got working on fish shell which ignores the changing var
sudo sed -i.bak -E 's/(var [A-Za-z0-9_]+=)\["claude-sonnet-4\.5","claude-sonnet-4","gpt-5"\];/\1["gpt-4o","gpt-5","gpt-5-mini","grok-code-fast-1","o3-mini","o1","claude-3.5-sonnet","claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-sonnet-4","claude-sonnet-4.5","gemini-2.0-flash-001","gemini-2.5-pro","gpt-4.1","o4-mini"];/g' /usr/lib/node_modules/@github/copilot/index.js
I need it badly... I'm disappearing soon!
+1
Has anyone got any of the free models working successfully with this workaround? I've tried Grok Code Fast 1 so far and I get a load of errors when it tries to use the built in copilot-cli tools such as read_bash and str_replace_editor, it doesn't seem to know the correct parameters to run them. Other tools such as read_file work fine. Any free models actually work out the box or any workarounds for them?
str_replace_editor: edit the file at core/models/models.py.
Invalid inputs: old_str is required for str_replace
str_replace_editor: edit the file at core/models/models.py.
Missing required arguments for command insert: insert_line and new_str
It's very hit or miss with them working from what I can tell, I ended up switching over to opencode and just use my copilot through it instead and it seems to work better and I don't have to deal with workarounds.