注意
The ability to bring your own keys (BYOK) to use custom models with GitHub Models for organizations on GitHub is in 公共预览版 and subject to change.
You can bring your own API keys (BYOK) to GitHub Models, and enable teams to use your preferred large language model (LLM) providers across tools like Prompts, Playground, and Models in Actions. For more information about GitHub Models, see About GitHub Models.
To learn about billing and pricing, see About billing for GitHub Models.
注意
Model support is currently limited to OpenAI and AzureAI.
Why bring your own API keys?
As an organization owner, you may have specific requirements for governance, data security, and compliance. By setting up your own API keys, you can:
- Governance and compliance: Choose LLM providers that comply with your organization's policies and regulatory requirements.
- Cost management: Align with your existing payment methods, contracts, credits, or negotiated rates, and avoid usage overages.
- Visibility and control: Manage which models your team can access, and monitor usage through your provider's existing dashboards and billing.
- Flexibility: Support custom or specialized models that your organization already uses.
Setting up your API keys to add custom models
重要
We highly recommend adhering to the principle of least privilege by assigning only the minimum necessary scopes to your API keys.
You must first add the relevant API keys for the organization. After that, your can specify or enable the custom models you wish to make available to users.
Adding API keys
- 在 GitHub 的右上角,选择个人资料照片,然后单击“ 你的组织”****。
- 在组织旁边,单击“设置”。
- In the "Code, planning, and automation" section of the sidebar, click Models dropdown. Then click Custom models. The "Custom Models" page displays the API keys and custom models added to the organization.
- Click Add API key.
- In the "Add the API key" dialog, provide details about your key. Name and API key are compulsory fields.
- Click Save.
Enabling custom models
- 在 GitHub 的右上角,选择个人资料照片,然后单击“ 你的组织”****。
- 在组织旁边,单击“设置”。
- In the "Code, planning, and automation" section of the sidebar, click the Models dropdown. Then click Development.
- Under "Models permissions", select All publishers to enable models added by API keys.
- If this option isn't available, you need to allow the use of the model in the organization. See 管理团队的模型使用情况.
- Optionally, select Only select models to create a custom list of enabled or disabled models. This allows you to control which models are available to your organization.
Next steps
Now that you've enabled your custom models in GitHub Models, learn how to:
-
Experiment with your custom model in the playground. See Experimenting with AI models in the playground.
-
Store prompts on GitHub so that you can iterate to fine-tune your prompts, and share them with stakeholders. See Storing prompts in GitHub repositories.
-
Launch your AI application. See Going to production.