Skip to main content
ChatCLI supports GitHub Models as a native provider, giving you access to models like GPT-4o, Llama 3.1, DeepSeek R1, Mistral, Phi-4 and more directly from the GitHub Models marketplace.

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

If you already use GitHub CLI (gh) or have GITHUB_TOKEN configured, the provider is detected automatically:
export GITHUB_TOKEN=ghp_your_token_here
# or
export GH_TOKEN=ghp_your_token_here
# or
export GITHUB_MODELS_TOKEN=ghp_your_token_here
Then select the provider:
chatcli --provider github_models --model gpt-4o
Or inside ChatCLI:
/switch --provider github_models --model gpt-4o

Option 2: Interactive Login

/auth login github-models
1

Generate a Personal Access Token (PAT)

Go to github.com/settings/tokens and create a token. No special scopes are required for model inference.
2

Paste the token in the terminal

ChatCLI will prompt for the token. Paste it and press Enter.
3

Provider available immediately

The GITHUB_MODELS provider appears in /switch without restarting.

Logout

/auth logout github-models

Available Models

Availability depends on your GitHub plan:

Free Tier

ModelPublisherContext Window
gpt-4oAzure OpenAI128K
gpt-4o-miniAzure OpenAI128K
Meta-Llama-3.1-405B-InstructMeta128K
Meta-Llama-3.1-8B-InstructMeta128K

With GitHub Copilot Pro (additional models)

ModelPublisherContext Window
DeepSeek-R1DeepSeek64K
Mistral-large-2411Mistral128K
Phi-4Microsoft16K
AI21-Jamba-1.5-LargeAI21256K
Cohere-command-r-plus-08-2024Cohere128K
The full list of models is at github.com/marketplace/models. Use /switch --model to see models available for your token.
Models not available for your plan return an unavailable_model error when you try to send a prompt. The /switch --model list includes both API models and catalog models — catalog models may not be available for your token.

Model Listing

ChatCLI combines two sources when listing models:
  1. API — models returned by the /models endpoint (actual token availability)
  2. Catalog — known marketplace models (may require a higher plan)
/switch --model
Models tagged with [api] were confirmed as available for your token.

Environment Variables

VariableDescriptionDefault
GITHUB_TOKENGitHub Personal Access Token (priority 1)-
GH_TOKENAlias for GitHub Token (priority 2)-
GITHUB_MODELS_TOKENDedicated token for GitHub Models (priority 3)-
GITHUB_MODELS_API_URLAPI URL overridehttps://models.inference.ai.azure.com/chat/completions
GITHUB_MODELS_MAX_TOKENSMax output tokens4096
GITHUB_MODELS_MODELDefault modelgpt-4o

Difference Between GitHub Models, Copilot and OpenAI

AspectGitHub ModelsGitHub CopilotOpenAI (API Key)
AuthGitHub PAT (ghp_...)Device Flow OAuthAPI Key (sk-...)
Endpointmodels.inference.ai.azure.comapi.githubcopilot.comapi.openai.com
ModelsGPT-4o, Llama, Mistral, DeepSeek…GPT-4o, Claude, GeminiAll OpenAI models
CostFree (with rate limits)Copilot subscriptionPay-per-use (billing)
Command/auth login github-models/auth login github-copilotOPENAI_API_KEY=sk-...
ProviderGITHUB_MODELSCOPILOTOPENAI
If you have a GitHub token but no paid OpenAI subscription, GITHUB_MODELS is the best option for free GPT-4o access.

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