Why GitHub Models?
No extra cost
Use models with your existing GitHub token. Free tier includes GPT-4o, Llama 3.1 405B/8B.
Model variety
Access models from OpenAI, Meta, Mistral, DeepSeek, Microsoft, Cohere and others.
Zero configuration
If you already have
GITHUB_TOKEN set (e.g. GitHub CLI), it works automatically.Compatible API
Uses OpenAI-compatible API at
models.inference.ai.azure.com.Setup
Option 1: Environment Variable (Recommended)
If you already use GitHub CLI (gh) or have GITHUB_TOKEN configured, the provider is detected automatically:
Option 2: Interactive Login
Generate a Personal Access Token (PAT)
Go to github.com/settings/tokens and create a token. No special scopes are required for model inference.
Logout
Available Models
Availability depends on your GitHub plan:Free Tier
| Model | Publisher | Context Window |
|---|---|---|
gpt-4o | Azure OpenAI | 128K |
gpt-4o-mini | Azure OpenAI | 128K |
Meta-Llama-3.1-405B-Instruct | Meta | 128K |
Meta-Llama-3.1-8B-Instruct | Meta | 128K |
With GitHub Copilot Pro (additional models)
| Model | Publisher | Context Window |
|---|---|---|
DeepSeek-R1 | DeepSeek | 64K |
Mistral-large-2411 | Mistral | 128K |
Phi-4 | Microsoft | 16K |
AI21-Jamba-1.5-Large | AI21 | 256K |
Cohere-command-r-plus-08-2024 | Cohere | 128K |
The full list of models is at github.com/marketplace/models. Use
/switch --model to see models available for your token.Model Listing
ChatCLI combines two sources when listing models:- API — models returned by the
/modelsendpoint (actual token availability) - Catalog — known marketplace models (may require a higher plan)
[api] were confirmed as available for your token.
Environment Variables
| Variable | Description | Default |
|---|---|---|
GITHUB_TOKEN | GitHub Personal Access Token (priority 1) | - |
GH_TOKEN | Alias for GitHub Token (priority 2) | - |
GITHUB_MODELS_TOKEN | Dedicated token for GitHub Models (priority 3) | - |
GITHUB_MODELS_API_URL | API URL override | https://models.inference.ai.azure.com/chat/completions |
GITHUB_MODELS_MAX_TOKENS | Max output tokens | 4096 |
GITHUB_MODELS_MODEL | Default model | gpt-4o |
Difference Between GitHub Models, Copilot and OpenAI
| Aspect | GitHub Models | GitHub Copilot | OpenAI (API Key) |
|---|---|---|---|
| Auth | GitHub PAT (ghp_...) | Device Flow OAuth | API Key (sk-...) |
| Endpoint | models.inference.ai.azure.com | api.githubcopilot.com | api.openai.com |
| Models | GPT-4o, Llama, Mistral, DeepSeek… | GPT-4o, Claude, Gemini | All OpenAI models |
| Cost | Free (with rate limits) | Copilot subscription | Pay-per-use (billing) |
| Command | /auth login github-models | /auth login github-copilot | OPENAI_API_KEY=sk-... |
| Provider | GITHUB_MODELS | COPILOT | OPENAI |
Next Steps
OAuth Authentication
Other authentication methods (Anthropic, OpenAI Codex, Copilot)
Provider Fallback
Configure automatic failover between providers
Supported Models
Full model list by provider
Coder Mode
Use GitHub Models in engineering mode