Skip to main content
GitHub Models provides free access to premium AI models through GitHub’s infrastructure, perfect for developers already using GitHub.

Overview

GitHub Models offers rate-limited access to various state-of-the-art models:
  • Free access with your GitHub account
  • Multiple model providers (OpenAI, Meta, DeepSeek, and more)
  • Rate-limited but generous for development use
  • No separate subscription needed if you use GitHub
GitHub Models is free but rate-limited. For high-volume usage, consider direct API providers.

Available Models

GitHub provides access to various models:

OpenAI Models

  • gpt-4o ⭐ (default) - OpenAI’s flagship model

Meta Llama Models

  • Llama-3.3-70B-Instruct - Powerful open model

DeepSeek Models

  • DeepSeek-R1 - Reasoning-focused model
  • Deepseek-V3 - Advanced DeepSeek model

Other Models

  • Phi-4-mini-instruct - Microsoft’s efficient model
  • Codestral 25.01 - Mistral’s code model
  • Mistral Large 24.11 - Mistral’s largest model
Browse all available models at github.com/marketplace?type=models

Setup

1. Create a GitHub Personal Access Token (PAT)

You need a GitHub PAT to authenticate:
1

Go to GitHub Settings

2

Generate New Token

Click “Generate new token” → “Generate new token (classic)”
3

Configure Token

  • Give it a descriptive name (e.g., “GitWhisper”)
  • Set expiration (recommended: 90 days or No expiration)
  • Select scopes: repo (if private repos) or no scopes (for public use)
4

Generate and Copy

Click “Generate token” and copy the token immediately (you won’t see it again)
Store your PAT securely! It provides access to your GitHub account. Never commit it to a repository.

2. Configure GitWhisper

Save your GitHub PAT:
gitwhisper save-key --model github --key "ghp_..."
The key is stored securely in ~/.git_whisper.yaml

Usage

Basic Usage

Use GitHub Models with default model (gpt-4o):
# Use GitHub Models
gitwhisper commit --model github

# Shorthand
gw commit -m github

Specific Model

Choose a specific model:
# Use DeepSeek-R1 for reasoning
gitwhisper commit --model github --model-variant DeepSeek-R1

# Use Llama 3.3 70B
gitwhisper commit --model github --model-variant Llama-3.3-70B-Instruct

# Use Codestral for code
gitwhisper commit --model github --model-variant "Codestral 25.01"

Set as Default

Make GitHub Models your default:
# Set GitHub as default
gitwhisper set-defaults --model github

# Set specific variant as default
gitwhisper set-defaults --model github --model-variant DeepSeek-R1

Rate Limits

GitHub Models has rate limits that vary by model and your GitHub account type:
Typical limits for free GitHub accounts:
  • Requests per minute: 10-15
  • Requests per hour: 50-150
  • Tokens per request: Varies by model
Perfect for:
  • Individual development
  • Small projects
  • Testing and learning
Rate limits are subject to change and vary by model. Check GitHub Models documentation for current limits.

Model Comparison

ModelQualitySpeedBest For
gpt-4o⭐⭐⭐⭐⭐⭐⭐⭐⭐General purpose
Llama-3.3-70B⭐⭐⭐⭐⭐⭐⭐Open source preference
DeepSeek-R1⭐⭐⭐⭐⭐⭐⭐Reasoning tasks
Codestral⭐⭐⭐⭐⭐⭐⭐⭐Code-focused
Phi-4-mini⭐⭐⭐⭐⭐⭐⭐⭐Fast responses

Code Analysis

Use GitHub Models for code analysis:
# Analyze with default model
gitwhisper analyze --model github

# Use Codestral for code-focused analysis
gitwhisper analyze --model github --model-variant "Codestral 25.01"

# Use DeepSeek-R1 for reasoning
gitwhisper analyze --model github --model-variant DeepSeek-R1

Advantages

Free Access

No separate API subscription needed if you use GitHub

Multiple Models

Access various providers through one API

Easy Setup

Use your existing GitHub account

Regular Updates

GitHub adds new models regularly

Limitations

Rate Limits

Limited requests per hour - may not suit high-volume use

Model Availability

Some models may have waiting lists or limited access

No Guaranteed SLA

Free tier has no service level guarantees

Account Required

Need GitHub account and PAT

Troubleshooting

Error: Invalid authentication credentials
Solution: Verify your GitHub PAT:
  1. Check token hasn’t expired
  2. Ensure token has correct scopes
  3. Regenerate if necessary:
gitwhisper save-key --model github --key "ghp_NEW_TOKEN"
Error: Rate limit exceeded
Solution: You’ve hit the hourly limit. Either:
  1. Wait for limit reset (usually hourly)
  2. Use a different model temporarily:
gitwhisper commit --model free
  1. Upgrade to GitHub Pro for higher limits
Error: Model not found
Solution: Model may not be available or name is incorrect:
# List available variants
gitwhisper list-variants --model github

# Check GitHub Models marketplace
# https://github.com/marketplace?type=models
Error: Access denied
Solution: Some models may have access restrictions:
  • Check if model requires waitlist approval
  • Verify your GitHub account status
  • Try a different model

Comparison with Other Options

FeatureGitHub ModelsFree Model
SetupPAT requiredNone
QualityExcellentGood
Rate LimitsGenerous60/hour
Model ChoiceMultipleSingle
RequirementsGitHub accountNone

Best Practices

  1. Use appropriate models: Choose models based on your task
  2. Monitor rate limits: Keep track of your usage
  3. Secure your PAT: Never commit tokens to repositories
  4. Rotate tokens: Regularly update your PAT
  5. Have alternatives: Know how to switch models if limits hit

Example Workflow

# 1. Set up GitHub PAT (one time)
gitwhisper save-key --model github --key "ghp_..."

# 2. Set as default
gitwhisper set-defaults --model github

# 3. Use for daily commits
git add .
gitwhisper commit

# 4. Try different models for variety
gitwhisper commit --model-variant DeepSeek-R1

Next Steps

View All Models

Browse GitHub Models marketplace

GitHub Docs

Official GitHub Models documentation

Compare Models

See all GitWhisper model options

API Keys

Learn about API key management

Build docs developers (and LLMs) love