GitHub LLM API 8 min read

GitHub Models Guide 2025: Try & Compare AI Models in GitHub

GitHub Models brings a model marketplace to the platform you already use every day. Test GPT-4o, Llama 3, Mistral, and more in the browser — then call them from code using your GitHub token.

What Is GitHub Models?

GitHub Models is a model marketplace built into GitHub and powered by Azure AI Foundry. It gives every GitHub user free access to a curated catalog of LLMs — without needing an Azure account, credit card, or separate API key setup. You test models in a browser playground, then call the same models from your code using a GitHub personal access token (PAT) as the API key.

The endpoint is OpenAI-compatible, so you can use the openai Python SDK or any HTTP client that speaks the OpenAI Chat Completions format.

Access URL

https://github.com/marketplace/models

See also: GitHub status page

Available Models

The catalog changes as Azure AI Foundry adds new models. As of mid-2025, available models include:

Model Provider Tier Context
gpt-4o OpenAI High 128k tokens
o3-mini OpenAI High 200k tokens
Meta-Llama-3.1-70B-Instruct Meta High 128k tokens
Mistral-large Mistral AI High 128k tokens
Phi-4 Microsoft Low 16k tokens
command-r-plus Cohere High 128k tokens
gemma-2-27b-it Google Low 8k tokens

Playground UI

Each model page on github.com/marketplace/models includes a playground with:

  • System prompt input — set context before the conversation starts.
  • Parameter sliders — temperature, max tokens, top-p, frequency penalty.
  • Side-by-side comparison — open two models in split view to compare outputs on the same prompt.
  • "View code" button — generates ready-to-run Python, JavaScript, or curl code for the current prompt and parameters.

Python SDK Quickstart

The API is OpenAI-compatible. Use your GitHub PAT as the API key and point the base URL at Azure AI's inference endpoint:

install

pip install openai

github_models_quickstart.py

import os
from openai import OpenAI

# Use your GitHub Personal Access Token (classic or fine-grained)
# Set GITHUB_TOKEN env var or paste directly
client = OpenAI(
    base_url="https://models.inference.ai.azure.com",
    api_key=os.environ["GITHUB_TOKEN"],
)

response = client.chat.completions.create(
    model="gpt-4o",           # any model from the catalog
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user",   "content": "Explain what a tensor is in 2 sentences."},
    ],
    temperature=0.7,
    max_tokens=256,
)

print(response.choices[0].message.content)

Switch to Llama 3 — only the model name changes

response = client.chat.completions.create(
    model="Meta-Llama-3.1-70B-Instruct",
    messages=[...],
)

Rate Limits & Going to Production

The free tier is for development and testing. Rate limits by tier:

Tier Req/min Req/day Tokens/day
Low (Phi-4, Mistral Small, Gemma) 15 150 50k
High (GPT-4o, Llama 3 70B, Mistral Large) 10 50 8k

For production, switch to an Azure AI Foundry endpoint. The code is identical — swap base_url and replace the GitHub token with an Azure API key. No model name changes needed.

Switching to Azure production

# Dev (GitHub Models)
client = OpenAI(
    base_url="https://models.inference.ai.azure.com",
    api_key=os.environ["GITHUB_TOKEN"],
)

# Production (Azure AI Foundry)
client = OpenAI(
    base_url="https://YOUR-ENDPOINT.openai.azure.com/",
    api_key=os.environ["AZURE_API_KEY"],
)

GitHub Models vs GitHub Copilot vs Azure OpenAI

Product What it does Pricing Best for
GitHub Models API access + playground for LLMs Free (rate-limited) Prototyping, model comparison
GitHub Copilot AI coding assistant in IDE/GitHub $10–$39/user/mo Code completion, PR reviews
Azure OpenAI Enterprise LLM API with SLA Pay-per-token Production apps at scale

See also: GitHub Copilot guide · OpenAI API guide · GPT-4o guide

Monitor Model API Uptime

GitHub Models, Azure OpenAI, and OpenAI all have separate status pages. Prismix aggregates them so you can see which inference provider is degraded at a glance.

Check LLM API Status →