phys-npps-members-l AT lists.bnl.gov
Subject: ALL NPPS Members
List archive
[[Phys-npps-members-l] ] How to Use GitHub Sonnet Models in Aider
- From: "Ye, Shuwei" <yesw AT bnl.gov>
- To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>, Torre Wenaus <wenaus AT gmail.com>
- Subject: [[Phys-npps-members-l] ] How to Use GitHub Sonnet Models in Aider
- Date: Tue, 29 Jul 2025 15:25:23 +0000
Dear all,
Due to the difference on API and the URL between OpenAI-compatible models and Sonnet models, we can use the
Copilot Sonnet models directly in Aider.
The API wrapper copilot-api can hep us.
$ source /cvmfs/atlas.sdcc.bnl.gov/users/yesw/singularity/alma9-x86/modern-linuxtools/setupMe.sh
$ copilot-api start -c
[...]
➜ Listening on: http://130.199.48.146:4141/
Then on another terinal, run
$ export ANTHROPIC_BASE_URL=http://130.199.48.146:4141 && aider --no-git --anthropic-api-key dummy --model anthropic/claude-sonnet-4
Please note that
-
Use your own URL in the env variable ANTHROPIC_BASE_URL as shown, and remove the trailing '/'.
-
And remember to enable X11 forward (required by xsel in the wrapper) in ssh if connected to a remote host
With the help from this API wrapper, all Copilot models can be used in Claude Code CLI. Claude Code has also been included the modern-linuxtools.
Cheers,
--Shuwei
From: Ye, Shuwei <yesw AT bnl.gov>
Sent: Wednesday, July 16, 2025 1:31 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: Re: How to Use GitHub AI Models in Aider
Sent: Wednesday, July 16, 2025 1:31 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: Re: How to Use GitHub AI Models in Aider
Dear all,
There are two types of AI models provided by GitHub:
-
Copilot AI models: https://api.githubcopilot.com
-
Market AI models: https://models.github.ai/inference
The command
gh models list
prints the list of market AI models. The available market models are identical between free Copilot subscription and Copilot Pro subscription.
To list the Copilot AI models, you can run:
$ curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${OAUTH_TOKEN}" \
https://api.githubcopilot.com/models | jq -r '.data[].id'
gpt-3.5-turbo
gpt-3.5-turbo-0613
gpt-4o-mini
gpt-4o-mini-2024-07-18
gpt-4
gpt-4-0613
gpt-4.1
gpt-4o
gpt-4o-2024-11-20
gpt-4o-2024-05-13
gpt-4-o-preview
gpt-4o-2024-08-06
o3-mini
o3-mini-2025-01-31
o3-mini-paygo
text-embedding-ada-002
text-embedding-3-small
text-embedding-3-small-inference
claude-3.5-sonnet
claude-3.7-sonnet
claude-3.7-sonnet-thought
claude-sonnet-4
gemini-2.0-flash-001
gpt-4.1-2025-04-14
The following 3 models is only available in Copilot Pro:
-
claude-3.7-sonnet
-
claude-3.7-sonnet-thought
-
claude-sonnet-4
Aider can also make use of the Copilot AI models. But the Claude models in the list do
not work properly in the same way in Aider as the other models. I am working to find out a solution.
Cheers,
--Shuwei
From: Ye, Shuwei <yesw AT bnl.gov>
Sent: Wednesday, June 18, 2025 1:59 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: How to Use GitHub AI Models in Aider
Sent: Wednesday, June 18, 2025 1:59 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: How to Use GitHub AI Models in Aider
Hi all,
As promised, here’s a brief explanation of how to use the GitHub AI Models in Aider:
Step-1: Installation of GitHub CLI.
You can find the installation instruction at
https://github.com/cli/cli#installation
As a non-root user in Linux, you can install it as follows:
wget https://github.com/cli/cli/releases/download/v2.74.2/gh_2.74.2_linux_amd64.tar.gz
gtar xfz gh_2.74.2_linux_amd64.tar.gz
cp -p gh_2.74.2_linux_amd64/bin/gh ~/.local/bin/
Step-2: Authentication of GitHub and Installation of the extension gh-models
Just run the following to authenticate your GitHub account and install the extension
gh-models:
gh auth login
gh ext install github/gh-models
gh models list
Step-3: GitHub Authentication Token and Aider Configuration
In order to access the GitHub AI models, the oauth_token is needed, which can be found in the file ~/.config/gh/hosts.yml. The token can also be displayed via the command:
gh config get -h github.com oauth_token
Then add the following to the Aider configuration file ~/.aider.conf.yml
openai-api-base: https://models.github.ai/inference
openai-api-key: your GitHub oauth_token here
Step-4: Use the GitHub AI Models in Aider
To use the model gpt-4.1, you can run
aider --model openai/openai/gpt-4.1
To use the model deepseek-r1-0528, run:
aider --model openai/deepseek/deepseek-r1-0528
Cheers,
--Shuwei
From: Ye, Shuwei <yesw AT bnl.gov>
Sent: Thursday, June 12, 2025 2:07 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: Re: [[Phys-npps-members-l] ] GitHub Models
Sent: Thursday, June 12, 2025 2:07 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>; Torre Wenaus <wenaus AT gmail.com>
Subject: Re: [[Phys-npps-members-l] ] GitHub Models
Hi all,
I just figured out how to use the 59 GitHub AI models in Aider. I'll share the instructions with you all soon.
Cheers,
--Shuwei
From: phys-npps-members-l-request AT lists.bnl.gov <phys-npps-members-l-request AT lists.bnl.gov> on behalf of Torre Wenaus <wenaus AT gmail.com>
Sent: Tuesday, June 10, 2025 12:06 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>
Subject: [[Phys-npps-members-l] ] GitHub Models
Sent: Tuesday, June 10, 2025 12:06 PM
To: NPPS members <Phys-npps-members-l AT lists.bnl.gov>
Subject: [[Phys-npps-members-l] ] GitHub Models
Hi all,
I just discovered GitHub Models, looks like you can prototype AI apps with various LLMs 'for free' in some cases. Anyone looked at it?
I see I can enable it for the BNLNPPS organization, selectively for models I specify. There are free ones in the list like many varieties of llama and deepseek.
Torre
--
-- Torre Wenaus, BNL NPPS Group Leader, ATLAS and ePIC experiments
-- BNL 510A 1-222 | 631-681-7892
-
Re: [[Phys-npps-members-l] ] How to Use GitHub AI Models in Aider,
Ye, Shuwei, 07/16/2025
- [[Phys-npps-members-l] ] How to Use GitHub Sonnet Models in Aider, Ye, Shuwei, 07/29/2025
Archive powered by MHonArc 2.6.24.