Skip to content

Repo sync #39600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ---------------------------------------------------------------
# To update the sha:
# https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250725-133358-gd7fe7b016 AS base
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250730-174526-g48ad667e7 AS base

# Install curl for Node install and determining the early access branch
# Install git for cloning docs-early-access & translations repos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ redirect_from:

{% data reusables.rai.code-scanning.copilot-autofix-note %}

{% data variables.copilot.copilot_autofix_short %} generates potential fixes that are relevant to the existing source code and translates the description and location of an alert into code changes that may fix the alert. {% data variables.copilot.copilot_autofix_short %} uses internal {% data variables.product.prodname_copilot %} APIs interfacing with the large language model {% data variables.copilot.copilot_gpt_4o %} from OpenAI, which has sufficient generative capabilities to produce both suggested fixes in code and explanatory text for those fixes.
{% data variables.copilot.copilot_autofix_short %} generates potential fixes that are relevant to the existing source code and translates the description and location of an alert into code changes that may fix the alert. {% data variables.copilot.copilot_autofix_short %} uses internal {% data variables.product.prodname_copilot %} APIs interfacing with the large language model {% data variables.copilot.copilot_gpt_41 %} from OpenAI, which has sufficient generative capabilities to produce both suggested fixes in code and explanatory text for those fixes.

{% data variables.copilot.copilot_autofix_short %} is allowed by default and enabled for every repository using {% data variables.product.prodname_codeql %}, but you can choose to opt out and disable {% data variables.copilot.copilot_autofix_short %}. To learn how to disable {% data variables.copilot.copilot_autofix_short %} at the enterprise, organization and repository levels, see [AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/disabling-autofix-for-code-scanning).

Expand Down
4 changes: 4 additions & 0 deletions content/github-models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ versions:
fpt: '*'
ghes: '*'
ghec: '*'
introLinks:
overview: /github-models/about-github-models
quickstart: /github-models/quickstart
children:
- /about-github-models
- /quickstart
- /use-github-models
- /github-models-at-scale
- /responsible-use-of-github-models
Expand Down
199 changes: 199 additions & 0 deletions content/github-models/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
---
title: Quickstart for GitHub Models
intro: 'Run your first model with {% data variables.product.prodname_github_models %} in minutes.'
allowTitleToDifferFromFilename: true
redirect_from:
- /models/quickstart
versions:
fpt: '*'
ghec: '*'
type: quick_start
topics:
- GitHub Models
shortTitle: Quickstart
---

## Introduction

{% data variables.product.prodname_github_models %} is an AI inference API from {% data variables.product.prodname_dotcom %} that lets you run AI models using just your {% data variables.product.prodname_dotcom %} credentials. You can choose from many different models—including from OpenAI, Meta, and DeepSeek—and use them in scripts, apps, or even {% data variables.product.prodname_actions %}, with no separate authentication process.

This guide helps you try out models quickly in the playground, then shows you how to run your first model via API or workflow.

## Step 1: Try models in the playground

1. Go to **[https://github.com/marketplace/models](https://github.com/marketplace/models)**.

1. In the playground, select at least one model from the dropdown menu.
1. Test out different prompts using the **Chat** view, and compare responses from different models.
1. Use the **Parameters** view to customize the parameters for the models you are testing, then see how they impact responses.

> [!NOTE]
> The playground works out of the box if you're signed in to {% data variables.product.prodname_dotcom %}. It uses your {% data variables.product.prodname_dotcom %} account for access—no setup or API keys required.
## Step 2: Make an API call

For full details on available fields, headers, and request formats, see the [API reference for {% data variables.product.prodname_github_models %}](/free-pro-team@latest/rest/models/inference?apiVersion=2022-11-28).

To call models programmatically, you’ll need:

* A {% data variables.product.prodname_dotcom %} account.
* A {% data variables.product.pat_generic %} (PAT) with the `models` scope, which you can create [in settings](https://github.com/settings/tokens).

1. Run the following `curl` command, replacing `YOUR_GITHUB_PAT` with your token.

```bash copy
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer YOUR_GITHUB_PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/json" \
https://models.github.ai/inference/chat/completions \
-d '{"model":"openai/gpt-4.1","messages":[{"role":"user","content":"What is the capital of France?"}]}'
```

1. You’ll receive a response like this:

```json
{
"choices": [
{
"message": {
"role": "assistant",
"content": "The capital of France is **Paris**."
}
}
],
...other fields omitted
}
```

1. To try other models, change the value of the `model` field in the JSON payload to one from the [marketplace](https://github.com/marketplace/models).

## Step 3: Run models in GitHub Actions

1. In your repository, create a workflow file at `.github/workflows/models-demo.yml`.

1. Paste the following workflow into the file you just created.

```yaml
name: GitHub Models Demo
on: [push]
permissions:
contents: read
models: read
jobs:
summarize-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: {% data reusables.actions.action-checkout %}
- name: Summarize the repository README
run: |
SUMMARY_INPUT=$(head -c 4000 README.md)
PROMPT="Summarize this repository in one sentence. Here is the README:\n$SUMMARY_INPUT"
PAYLOAD=$(jq -n --arg prompt "$PROMPT" '{
model: "openai/gpt-4.1",
messages: [
{role: "user", content: $prompt}
]
}')
RESPONSE=$(curl -sL \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/json" \
https://models.github.ai/inference/chat/completions \
-d "$PAYLOAD")
echo "$RESPONSE" | jq -r '.choices[0].message.content'
```

> [!NOTE]
> Workflows that call {% data variables.product.prodname_github_models %} must include `models: read` in the permissions block. {% data variables.product.prodname_dotcom %}-hosted runners provide a `GITHUB_TOKEN` automatically.

1. Commit and push to trigger the workflow.

This example shows how to send a prompt to a model and use the response in your continuous integration (CI) workflows. For more advanced use cases, such as summarizing issues, detecting missing reproduction steps for bug reports, or responding to pull requests, see [AUTOTITLE](/github-models/use-github-models/integrating-ai-models-into-your-development-workflow).

## Step 4: Save your first prompt file

{% data variables.product.prodname_github_models %} supports reusable prompts defined in `.prompt.yml` files. Once you add this file to your repository, it will appear in the Models page of your repository and can be run directly in the Prompt Editor and evaluation tooling. Learn more about [AUTOTITLE](/github-models/use-github-models/storing-prompts-in-github-repositories).

1. In your repository, create a file named `summarize.prompt.yml`. You can save it in any directory.

1. Paste the following example prompt into the file you just created.

```yaml
name: One-line summary
description: Ask the model to summarize a paragraph in one sentence.
messages:
- role: user
content: 'Summarize the following text in one sentence: {{input}}'
model: openai/gpt-4o
```

1. Commit and push the file to your repository.

1. Go to the **Models** tab in your repository.

1. In the navigation menu, click **{% octicon "note" aria-hidden="true" aria-label="none" %} Prompts**, then click on the prompt file.

1. The prompt will open in the prompt editor. Click **Run**. A right-hand sidebar will appear asking you to enter input text. Enter any input text, then click **Run** again in the bottom right corner to test it out.

> [!NOTE]
> The prompt editor doesn’t automatically pass repository content into prompts. You provide the input manually.

## Step 5: Set up your first evaluation

Evaluations help you measure how different models respond to the same inputs so you can choose the best one for your use case.

1. Go back to the `summarize.prompt.yml` file you created in the previous step.

1. Update the file to match the following example.

```yaml
name: One-line summary
description: Ask the model to summarize a paragraph in one sentence.
messages:
- role: user
content: 'Summarize the following text in one sentence: {{input}}'
model: openai/gpt-4o
testData:
- input: >-
The museum opened a new dinosaur exhibit this weekend. Families from all
over the city came to see the life-sized fossils and interactive displays.
expected: >-
The museum's new dinosaur exhibit attracted many families with its fossils
and interactive displays.
- input: >-
Lucy baked cookies for the school fundraiser. She spent the entire evening
in the kitchen to make sure there were enough for everyone.
expected: Lucy baked cookies all evening to support the school fundraiser.
evaluators:
- name: Similarity
uses: github/similarity
```
1. Commit and push the file to your repository.
1. In your repository, click the **Models** tab. Then click **{% octicon "note" aria-hidden="true" aria-label="none" %} Prompts** and reopen the same prompt in the prompt editor.
1. In the top left-hand corner, you can toggle the view from **Edit** to **Compare**. Click **Compare**.
1. Your evaluation will be set up automatically. Click **Run** to see results.
> [!TIP]
> By clicking **Add prompt**, you can run the same prompt with different models or change the prompt wording to get inference responses with multiple variations at once, see evaluations, and view them side by side to make data-driven model decisions.
## Next steps
* [AUTOTITLE](/github-models/about-github-models).
* [Browse the model catalog](https://github.com/marketplace?type=models)
* [AUTOTITLE](/github-models/use-github-models/storing-prompts-in-github-repositories)
* [AUTOTITLE](/github-models/use-github-models/evaluating-ai-models)
* [AUTOTITLE](/github-models/use-github-models/integrating-ai-models-into-your-development-workflow#using-ai-models-with-github-actions)
18 changes: 18 additions & 0 deletions src/graphql/data/fpt/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
[
{
"schemaChanges": [
{
"title": "The GraphQL schema includes these changes:",
"changes": [
"<p>Enum value 'BLOCKED_BY_REMOVED_EVENT<code>was added to enum</code>IssueTimelineItemsItemType'</p>",
"<p>Enum value 'BLOCKING_ADDED_EVENT<code>was added to enum</code>IssueTimelineItemsItemType'</p>",
"<p>Enum value 'BLOCKING_REMOVED_EVENT<code>was added to enum</code>IssueTimelineItemsItemType'</p>",
"<p>Enum value 'BLOCKED_BY_REMOVED_EVENT<code>was added to enum</code>PullRequestTimelineItemsItemType'</p>",
"<p>Enum value 'BLOCKING_ADDED_EVENT<code>was added to enum</code>PullRequestTimelineItemsItemType'</p>",
"<p>Enum value 'BLOCKING_REMOVED_EVENT<code>was added to enum</code>PullRequestTimelineItemsItemType'</p>"
]
}
],
"previewChanges": [],
"upcomingChanges": [],
"date": "2025-07-31"
},
{
"schemaChanges": [
{
Expand Down
30 changes: 30 additions & 0 deletions src/graphql/data/fpt/schema.docs.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -20311,6 +20311,21 @@ enum IssueTimelineItemsItemType {
"""
BLOCKED_BY_ADDED_EVENT

"""
Represents a 'blocked_by_removed' event on a given issue.
"""
BLOCKED_BY_REMOVED_EVENT

"""
Represents a 'blocking_added' event on a given issue.
"""
BLOCKING_ADDED_EVENT

"""
Represents a 'blocking_removed' event on a given issue.
"""
BLOCKING_REMOVED_EVENT

"""
Represents a 'closed' event on any `Closable`.
"""
Expand Down Expand Up @@ -42960,6 +42975,21 @@ enum PullRequestTimelineItemsItemType {
"""
BLOCKED_BY_ADDED_EVENT

"""
Represents a 'blocked_by_removed' event on a given issue.
"""
BLOCKED_BY_REMOVED_EVENT

"""
Represents a 'blocking_added' event on a given issue.
"""
BLOCKING_ADDED_EVENT

"""
Represents a 'blocking_removed' event on a given issue.
"""
BLOCKING_REMOVED_EVENT

"""
Represents a 'closed' event on any `Closable`.
"""
Expand Down
24 changes: 24 additions & 0 deletions src/graphql/data/fpt/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -89627,6 +89627,18 @@
"name": "BLOCKED_BY_ADDED_EVENT",
"description": "<p>Represents a<code>blocked_by_added</code>event on a given issue.</p>"
},
{
"name": "BLOCKED_BY_REMOVED_EVENT",
"description": "<p>Represents a<code>blocked_by_removed</code>event on a given issue.</p>"
},
{
"name": "BLOCKING_ADDED_EVENT",
"description": "<p>Represents a<code>blocking_added</code>event on a given issue.</p>"
},
{
"name": "BLOCKING_REMOVED_EVENT",
"description": "<p>Represents a<code>blocking_removed</code>event on a given issue.</p>"
},
{
"name": "CLOSED_EVENT",
"description": "<p>Represents a<code>closed</code>event on any <code>Closable</code>.</p>"
Expand Down Expand Up @@ -91758,6 +91770,18 @@
"name": "BLOCKED_BY_ADDED_EVENT",
"description": "<p>Represents a<code>blocked_by_added</code>event on a given issue.</p>"
},
{
"name": "BLOCKED_BY_REMOVED_EVENT",
"description": "<p>Represents a<code>blocked_by_removed</code>event on a given issue.</p>"
},
{
"name": "BLOCKING_ADDED_EVENT",
"description": "<p>Represents a<code>blocking_added</code>event on a given issue.</p>"
},
{
"name": "BLOCKING_REMOVED_EVENT",
"description": "<p>Represents a<code>blocking_removed</code>event on a given issue.</p>"
},
{
"name": "CLOSED_EVENT",
"description": "<p>Represents a<code>closed</code>event on any <code>Closable</code>.</p>"
Expand Down
30 changes: 30 additions & 0 deletions src/graphql/data/ghec/schema.docs.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -20311,6 +20311,21 @@ enum IssueTimelineItemsItemType {
"""
BLOCKED_BY_ADDED_EVENT

"""
Represents a 'blocked_by_removed' event on a given issue.
"""
BLOCKED_BY_REMOVED_EVENT

"""
Represents a 'blocking_added' event on a given issue.
"""
BLOCKING_ADDED_EVENT

"""
Represents a 'blocking_removed' event on a given issue.
"""
BLOCKING_REMOVED_EVENT

"""
Represents a 'closed' event on any `Closable`.
"""
Expand Down Expand Up @@ -42960,6 +42975,21 @@ enum PullRequestTimelineItemsItemType {
"""
BLOCKED_BY_ADDED_EVENT

"""
Represents a 'blocked_by_removed' event on a given issue.
"""
BLOCKED_BY_REMOVED_EVENT

"""
Represents a 'blocking_added' event on a given issue.
"""
BLOCKING_ADDED_EVENT

"""
Represents a 'blocking_removed' event on a given issue.
"""
BLOCKING_REMOVED_EVENT

"""
Represents a 'closed' event on any `Closable`.
"""
Expand Down
Loading
Loading