1
0
mirror of synced 2025-12-19 18:10:59 -05:00

October 28-30: GitHub Universe 2024 docs-internal megabranch (#52491)

Co-authored-by: isaacmbrown <isaacmbrown@github.com>
Co-authored-by: Hector Alfaro <hectorsector@github.com>
Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
Co-authored-by: Vanessa <vgrl@github.com>
Co-authored-by: Christopher Nguyen <91625426+nguyen-dows@users.noreply.github.com>
Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
Co-authored-by: David Staheli <1767415+davidstaheli@users.noreply.github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: sunbrye <sunbrye@github.com>
Co-authored-by: Tim Rogers <timrogers@github.com>
Co-authored-by: Felix Guntrip <stevecat@github.com>
Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com>
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
Co-authored-by: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com>
Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Jules Porter <jules-p@users.noreply.github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
Co-authored-by: Kate Studwell <katestud@github.com>
Co-authored-by: Katherine Oelsner <49968061+octokatherine@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Tim Rogers <me@timrogers.co.uk>
Co-authored-by: Arfon Smith <arfon@users.noreply.github.com>
This commit is contained in:
Joe Clark
2024-10-29 08:40:06 -07:00
committed by GitHub
parent f6715cea12
commit 75f3cce197
373 changed files with 4548 additions and 877 deletions

View File

@@ -7,5 +7,6 @@ versions:
ghec: '*'
children:
- /prototyping-with-ai-models
- /integrating-ai-models-into-your-development-workflow
- /responsible-use-of-github-models
---

View File

@@ -0,0 +1,64 @@
---
title: Integrating AI models into your development workflow
intro: 'Call AI models in the tools you use every day.'
versions:
feature: github-models
shortTitle: Integrate AI models
---
With {% data variables.product.prodname_github_models %} extensions, you can call specific AI models from both {% data variables.product.prodname_copilot_chat_short %} and {% data variables.product.prodname_cli %}. These extensions integrate directly into your development workflow, allowing you to prompt models without context switching.
## Using AI models in {% data variables.product.prodname_copilot_chat_short %}
If you have a {% data variables.product.prodname_copilot_short %} subscription, you can work with AI models in {% data variables.product.prodname_copilot_chat_short %} in two different ways:
* Using the {% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}. With this extension, you can ask for model recommendations based on certain criteria and chat with specific models. See "[Using the {% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}](#using-the-github-models-copilot-extension)."
* Using multiple model support in {% data variables.product.prodname_copilot_chat_short %}. With multi-model {% data variables.product.prodname_copilot_chat_short %}, you can choose a specific model to use for a conversation, then prompt {% data variables.product.prodname_copilot_chat_short %} as usual. See "[AUTOTITLE](/copilot/using-github-copilot/asking-github-copilot-questions-in-githubcom#ai-models-for-copilot-chat)" and "[AUTOTITLE](/copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide#ai-models-for-copilot-chat)."
### Using the {% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}
> [!NOTE] The {% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %} is in {% data variables.release-phases.public_preview %} and is subject to change.
1. Install the [{% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}](https://github.com/marketplace/models-github).
* If you have a {% data variables.product.prodname_copilot_individuals_short %} subscription, you can install the extension on your personal account.
* If you have access to {% data variables.product.prodname_copilot_short %} through a {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} subscription:
* An organization owner or enterprise owner needs to enable the {% data variables.product.prodname_copilot_extensions_short %} policy for your organization or enterprise.
* An organization owner needs to install the extension for your organization.
1. Open any implementation of {% data variables.product.prodname_copilot_chat_short %} that supports {% data variables.product.prodname_copilot_extensions %}. For a list of supported {% data variables.product.prodname_copilot_chat_short %} implementations, see "[AUTOTITLE](/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat#supported-clients-and-ides)."
1. In the chat window, type `@models YOUR-PROMPT`, then send your prompt. There are several use cases for the {% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}, including:
* Recommending a particular model based on context and criteria you provide. For example, you can ask for a low-cost OpenAI model that supports function calling.
* Executing prompts using a particular model. This is especially useful when you want to use a model that is not currently available in multi-model {% data variables.product.prodname_copilot_chat_short %}.
* Listing models currently available through {% data variables.product.prodname_github_models %}
## Using AI models from the command line
> [!NOTE] The {% data variables.product.prodname_github_models %} extension for {% data variables.product.prodname_cli %} is in {% data variables.release-phases.public_preview %} and is subject to change.
You can use the {% data variables.product.prodname_github_models %} extension for {% data variables.product.prodname_cli %} to prompt AI models from the command line, and even pipe in the output of a command as context.
### Prerequisites
To use the {% data variables.product.prodname_github_models %} CLI extension, you need to have {% data variables.product.prodname_cli %} installed. {% data reusables.cli.cli-installation %}
### Installing the extension
1. If you have not already authenticated to the {% data variables.product.prodname_cli %}, run the following command in your terminal.
```shell copy
gh auth login
```
1. To install the {% data variables.product.prodname_github_models %} extension, run the following command.
```shell copy
gh extension install https://github.com/github/gh-models
```
### Using the extension
To see a list of all available commands, run `gh models`.
There are a few key ways you can use the extension:
* **To ask a model multiple questions using a chat experience**, run `gh models run`. Select your model from the listed models, then send your prompts.
* **To ask a model a single question**, run `gh models run MODEL-NAME "QUESTION"` in your terminal. For example, to ask the `gpt-4o` model why the sky is blue, you can run `gh models run gpt-4o "why is the sky blue?"`.
* **To provide the output of a command as context when you call a model**, you can join a separate command and the call to the model with the pipe character (`|`). For example, to summarize the README file in the current directory using the `gpt-4o` model, you can run `cat README.md | gh models run gpt-4o "summarize this text"`.

View File

@@ -1,5 +1,6 @@
---
title: Prototyping with AI models
shortTitle: Prototype with AI models
intro: 'Find and experiment with AI models for free.'
versions:
feature: github-models
@@ -15,7 +16,7 @@ To find AI models, go to [{% data variables.product.prodname_marketplace %}](htt
To view details about a model, click on the model's name.
> [!NOTE] Access to OpenAI's `o1` models is in {% data variables.release-phases.public_preview %} and subject to change. To request access, join the [waitlist](https://github.com/o1-waitlist-signup).
{% data reusables.models.o1-models-preview-note %}
## Experimenting with AI models in the playground
@@ -29,6 +30,8 @@ To open the playground, go to [{% data variables.product.prodname_marketplace %}
To adjust parameters for the model, select the **Parameters** tab in the sidebar. To see code that corresponds to the parameters that you selected, switch from the **Chat** tab to the **Code** tab.
You can also compare two models at once. In the menu bar for your model, click {% octicon "plus" aria-hidden="true" %} **Compare**, then select a model for comparison using the **Model: MODEL-NAME** {% octicon "chevron-down" aria-hidden="true" %} dropdown menu in the second chat window. When you type a prompt in either chat window, the prompt will automatically be mirrored to the other window, and you can compare the responses from each model.
The playground is rate limited. See [Rate limits](#rate-limits) below.
## Experimenting with AI models using the API
@@ -39,7 +42,7 @@ The playground is rate limited. See [Rate limits](#rate-limits) below.
{% data variables.product.company_short %} provides free API usage so that you can experiment with AI models in your own application.
To learn how to use a model in your application, go to [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace/models), then click {% octicon "ai-model" aria-hidden="true" %} **Models** in the sidebar. Click on a model's name, then click {% octicon "code" aria-hidden="true" %} **Code**.
To learn how to use a model in your application, go to [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace/models), then click {% octicon "ai-model" aria-hidden="true" %} **Models** in the sidebar. Click on a model's name, then click {% octicon "command-palette" aria-hidden="true" %} **Playground**. In the menu bar at the top of your chat window, click {% octicon "code" aria-hidden="true" %} **Code**.
The steps to use each model are similar. In general, you will need to:
@@ -57,43 +60,44 @@ The steps to use each model are similar. In general, you will need to:
The free API usage is rate limited. See [Rate limits](#rate-limits) below.
{% ifversion github-models-cli %}
## Saving and sharing your playground experiments
## Experimenting with AI models using {% data variables.product.prodname_cli %}
You can save and share your progress in the playground with presets. Presets save:
* Your current state
* Your parameters
* Your chat history (optional)
>[!NOTE] The {% data variables.product.prodname_github_models %} CLI extension is in {% data variables.release-phases.public_preview %} and subject to change.
To create a preset for your current context, select the **Preset: PRESET-NAME** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click {% octicon "plus" aria-hidden="true" %} **Create new preset**. You need to name your preset, and you can also choose to provide a preset description, include your chat history, and allow your preset to be shared.
You can use {% data variables.product.prodname_github_models %} with the {% data variables.product.prodname_cli %} to experiment with AI models from the command line.
There are two ways to load a preset:
* Select the **Preset: PRESET-NAME** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click the preset you want to load.
* Open a shared preset URL
### Prerequisites
After you load a preset, you can edit, share, or delete the preset:
* To edit the preset, change the parameters and prompt the model. Once you are satisfied with your changes, select the **Preset: PRESET-NAME** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click {% octicon "pencil" aria-hidden="true" %} **Edit preset** and save your updates.
* To share the preset, select the **Preset: PRESET-NAME** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click {% octicon "share" aria-hidden="true" %} **Share preset** to get a shareable URL.
* To delete the preset, select the **Preset: PRESET-NAME** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click {% octicon "trash" aria-hidden="true" %} **Delete preset** and confirm the deletion.
To use the {% data variables.product.prodname_github_models %} CLI extension, you need to have {% data variables.product.prodname_cli %} installed. {% data reusables.cli.cli-installation %}
## Experimenting with AI models in {% data variables.product.prodname_vscode %}
### Installing the extension
> [!NOTE] The AI Toolkit extension for {% data variables.product.prodname_vscode %} is in {% data variables.release-phases.public_preview %} and is subject to change.
1. If you have not already authenticated to the {% data variables.product.prodname_cli %}, run the following command in your terminal.
If you prefer to experiment with AI models in your IDE, you can install the AI Toolkit extension for {% data variables.product.prodname_vscode %}, then test models with adjustable parameters and context.
```shell copy
gh auth login
```
1. In {% data variables.product.prodname_vscode %}, install the pre-release version of the [AI Toolkit for {% data variables.product.prodname_vscode %}](https://marketplace.visualstudio.com/items?itemName=ms-windows-ai-studio.windows-ai-studio).
1. To open the extension, click the AI Toolkit icon in the activity bar.
1. Authorize the AI Toolkit to connect to your {% data variables.product.prodname_dotcom %} account.
1. In the "My models" section of the AI Toolkit panel, click **Open Model Catalog**, then find a model to experiment with.
* To use a model hosted remotely through {% data variables.product.prodname_github_models %}, on the model card, click **Try in playground**.
* To download and use a model locally, on the model card, click **Download**. Once the download is complete, on the same model card, click **Load in playground**.
1. To install the {% data variables.product.prodname_github_models %} extension, run the following command.
```shell copy
gh extension install https://github.com/github/gh-models
```
### Using the extension
To see a list of all available commands, run `gh models help`. To run the extension in interactive mode, run `gh models run`. This will prompt you to select a model and then to enter a prompt. The extension will then return a response from the model.
For more information about what you can do with {% data variables.product.prodname_cli %}, see the [{% data variables.product.prodname_cli %} manual](https://cli.github.com/manual).
{% endif %}
1. In the sidebar, provide any context instructions and inference parameters for the model, then send a prompt.
## Going to production
The rate limits for the playground and free API usage are intended to help you experiment with models and develop your AI application. Once you are ready to bring your application to production, you can use a token from a paid Azure account instead of your {% data variables.product.company_short %} {% data variables.product.pat_generic %}. You don't need to change anything else in your code. For more information, see the [Azure AI](https://ai.azure.com/github/model/docs) documentation.
The rate limits for the playground and free API usage are intended to help you experiment with models and develop your AI application. Once you are ready to bring your application to production, you can use a token from a paid Azure account instead of your {% data variables.product.company_short %} {% data variables.product.pat_generic %}. You don't need to change anything else in your code.
For more information, see the [Azure AI](https://aka.ms/azureai/github-models) documentation.
## Rate limits