Azure AI Foundry
Azure AI Foundry 是一项基于云的服务,它提供对 OpenAI、Mistral AI 等模型的访问,并集成了 Microsoft Azure 平台的安全和企业功能。要开始使用,请在 Azure 门户中创建一个 Azure AI Foundry 资源。
信息
有关 OpenAI 模型设置的详细信息,请参阅Azure OpenAI Service 配置。
聊天模型
我们建议将 GPT-4o 配置为您的聊天模型。
- YAML
- JSON
config.yaml
models:
- name: GPT-4o
provider: azure
model: gpt-4o
apiBase: <YOUR_DEPLOYMENT_BASE>
apiKey: <YOUR_AZURE_API_KEY> # If you use subscription key, try using Azure gateway to rename it apiKey
env:
deployment: <YOUR_DEPLOYMENT_NAME>
apiType: azure-foundry # Or "azure-openai" if using OpenAI models
config.json
{
"models": [{
"title": "GPT-4o",
"provider": "azure",
"model": "gpt-4o",
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
"deployment": "<YOUR_DEPLOYMENT_NAME>",
"apiKey": "<YOUR_AZURE_API_KEY>", // If you use subscription key, try using Azure gateway to rename it apiKey
"apiType": "azure-foundry" // Or "azure-openai" if using OpenAI models
}]
}
自动补全模型
我们建议将 Codestral 配置为您的自动补全模型。如果您使用 Azure AI Foundry 部署 Codestral
- YAML
- JSON
config.yaml
models:
- name: Codestral
provider: mistral
model: codestral-latest
apiBase: https://<YOUR_MODEL_NAME>.<YOUR_REGION>.models.ai.azure.com/v1
apiKey: <YOUR_AZURE_API_KEY>
roles:
- autocomplete
config.json
{
"tabAutocompleteModel": {
"title": "Codestral",
"provider": "mistral",
"model": "codestral-latest",
"apiBase": "https://<YOUR_MODEL_NAME>.<YOUR_REGION>.models.ai.azure.com/v1",
"apiKey": "<YOUR_AZURE_API_KEY>"
}
}
Embedding 模型
我们建议将 text-embedding-3-large 配置为您的 Embedding 模型。
- YAML
- JSON
config.yaml
models:
- name: Text Embedding-3 Large
provider: azure
model: text-embedding-3-large
apiBase: <YOUR_DEPLOYMENT_BASE>
apiKey: <YOUR_AZURE_API_KEY>
env:
deployment: <YOUR_DEPLOYMENT_NAME>
apiType: azure
config.json
{
"embeddingsProvider": {
"provider": "azure",
"model": "text-embedding-3-large",
"apiBase": "<YOUR_DEPLOYMENT_BASE>",
"deployment": "<YOUR_DEPLOYMENT_NAME>",
"apiKey": "<YOUR_AZURE_API_KEY>",
"apiType": "azure-foundry" // Or "azure-openai" if using OpenAI models
}
}
重排序模型
Azure OpenAI 目前不提供任何重排序模型。
点击此处查看重排序模型列表。
隐私
如果您想使用 OpenAI 模型但担心隐私问题,可以使用 Azure OpenAI 服务,该服务符合 GDPR 和 HIPAA 标准。
获取访问权限
点击此处申请访问 Azure OpenAI 服务。响应时间通常在几天内。
Azure OpenAI Service 配置
Azure OpenAI Service 需要配置一些额外的参数,例如部署名称和 API 基本 URL。
要在 Azure AI Foundry 中找到此信息,首先选择您想要连接的模型。然后访问 Endpoint > Target URI。
例如,Target URI https://just-an-example.openai.azure.com/openai/deployments/gpt-4o-july/chat/completions?api-version=2023-03-15-preview
将映射到以下内容
- YAML
- JSON
config.yaml
models:
- name: GPT-4o Azure
model: gpt-4o
provider: azure
apiBase: https://just-an-example.openai.azure.com
apiKey: <YOUR_AZURE_API_KEY>
env:
apiVersion: 2023-03-15-preview
deployment: gpt-4o-july
apiType: azure-openai
config.json
{
"title": "GPT-4o Azure",
"model": "gpt-4o",
"provider": "azure",
"apiBase": "https://just-an-example.openai.azure.com",
"deployment": "gpt-4o-july",
"apiVersion": "2023-03-15-preview",
"apiKey": "<YOUR_AZURE_API_KEY>",
"apiType": "azure-openai"
}