AI integrations compatibility matrix
यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।
Aspire provides several AI hosting and client integrations that enable you to work with different AI services and platforms. This article is a compatibility reference showing which client integrations work with which hosting integrations, along with the recommended pairings and AppHost API examples.
Compatibility matrix
Section titled “Compatibility matrix”The following table shows the compatibility between Aspire AI hosting and client integrations:
| Hosting Integration | Aspire.OpenAI | Aspire.Azure.AI.OpenAI | Aspire.Azure.AI.Inference |
|---|---|---|---|
Aspire.Hosting.Foundry | ❌ No | ⚠️ Partial | ✅ Yes (preferred) |
Aspire.Hosting.Azure.CognitiveServices | ❌ No | ✅ Yes (preferred) | ❌ No |
Aspire.Hosting.OpenAI | ✅ Yes (preferred) | ✅ Yes | ❌ No |
Aspire.Hosting.GitHub.Models | ⚠️ Partial | ❌ No | ✅ Yes (preferred) |
Recommended pairings
Section titled “Recommended pairings”In general, use Aspire.Azure.AI.Inference to connect to Azure hosted models, or Aspire.OpenAI to connect directly to OpenAI.
Microsoft Foundry
Section titled “Microsoft Foundry”For Microsoft Foundry resources, use the Aspire.Azure.AI.Inference client integration. This provides the best compatibility with the diverse range of models available through Microsoft Foundry. For more information, see Microsoft Foundry integration.
Hosting integration
Section titled “Hosting integration”The Aspire.Hosting.Foundry package provides the hosting integration. In your app host project:
var builder = DistributedApplication.CreateBuilder(args);
var foundry = builder.AddFoundry("foundry");
builder.AddProject<Projects.ExampleProject>() .WithReference(foundry);import { function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder } from './.modules/aspire.js';
const const builder: IDistributedApplicationBuilder
builder = await function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder();
const const foundry: FoundryResource
foundry = await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addFoundry(name: string): FoundryResource
Adds a Microsoft Foundry resource to the distributed application model.
addFoundry("foundry");
await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addNodeApp(name: string, appDirectory: string, scriptPath: string): NodeAppResource
Adds a Node.js application resource
addNodeApp("api", "./api", "index.js") .ExecutableResource.withReference(source: EndpointReference | string | uri, options?: { connectionName?: string; optional?: boolean; name?: string;} | undefined): NodeAppResource (+2 overloads)
Adds a reference to another resource
withReference(const foundry: FoundryResource
foundry);Client integration
Section titled “Client integration”The Aspire.Azure.AI.Inference package provides the client integration. In your service project:
builder.AddAzureChatCompletionsClient("foundry");Azure Cognitive Services (Azure OpenAI)
Section titled “Azure Cognitive Services (Azure OpenAI)”For Azure OpenAI resources, use the Aspire.Azure.AI.OpenAI client integration for full Azure-specific features and authentication support. For more information, see Azure OpenAI integration.
Hosting integration
Section titled “Hosting integration”The Aspire.Hosting.Azure.CognitiveServices package provides the hosting integration. In your app host project:
var builder = DistributedApplication.CreateBuilder(args);
var openai = builder.AddAzureOpenAI("openai");
builder.AddProject<Projects.ExampleProject>() .WithReference(openai);import { function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder } from './.modules/aspire.js';
const const builder: IDistributedApplicationBuilder
builder = await function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder();
const const openai: AzureOpenAIResource
openai = await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addAzureOpenAI(name: string): AzureOpenAIResource
Adds an Azure OpenAI resource
addAzureOpenAI("openai");
await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addNodeApp(name: string, appDirectory: string, scriptPath: string): NodeAppResource
Adds a Node.js application resource
addNodeApp("api", "./api", "index.js") .ExecutableResource.withReference(source: EndpointReference | string | uri, options?: { connectionName?: string; optional?: boolean; name?: string;} | undefined): NodeAppResource (+2 overloads)
Adds a reference to another resource
withReference(const openai: AzureOpenAIResource
openai);Client integration
Section titled “Client integration”The Aspire.Azure.AI.OpenAI package provides the client integration. In your service project:
builder.AddAzureOpenAIClient("openai");Direct OpenAI
Section titled “Direct OpenAI”For direct OpenAI API access, use the Aspire.OpenAI client integration. For more information, see Aspire OpenAI integration (Preview).
Hosting integration
Section titled “Hosting integration”The Aspire.Hosting.OpenAI package provides the hosting integration. In your app host project:
var builder = DistributedApplication.CreateBuilder(args);
var openai = builder.AddOpenAI("openai");
builder.AddProject<Projects.ExampleProject>() .WithReference(openai);import { function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder } from './.modules/aspire.js';
const const builder: IDistributedApplicationBuilder
builder = await function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder();
const const openai: OpenAIResource
openai = await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addOpenAI(name: string): OpenAIResource
Adds an OpenAI resource to the distributed application model.
addOpenAI("openai");
await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addNodeApp(name: string, appDirectory: string, scriptPath: string): NodeAppResource
Adds a Node.js application resource
addNodeApp("api", "./api", "index.js") .ExecutableResource.withReference(source: EndpointReference | string | uri, options?: { connectionName?: string; optional?: boolean; name?: string;} | undefined): NodeAppResource (+2 overloads)
Adds a reference to another resource
withReference(const openai: OpenAIResource
openai);Client integration
Section titled “Client integration”The Aspire.OpenAI package provides the client integration. In your service project:
builder.AddOpenAIClient("openai");GitHub Models
Section titled “GitHub Models”For GitHub Models, use the Aspire.Azure.AI.Inference client integration for the best compatibility with the GitHub Models API. For more information, see Aspire GitHub Models integration (Preview).
Hosting integration
Section titled “Hosting integration”The Aspire.Hosting.GitHub.Models package provides the hosting integration. In your app host project:
var builder = DistributedApplication.CreateBuilder(args);
var chat = builder.AddGitHubModel("chat", "openai/gpt-4o-mini");
builder.AddProject<Projects.ExampleProject>() .WithReference(chat);import { function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder } from './.modules/aspire.js';
const const builder: IDistributedApplicationBuilder
builder = await function createBuilder(): IDistributedApplicationBuilder
Creates a new distributed application builder
createBuilder();
const const chat: GitHubModelResource
chat = await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addGitHubModel(name: string, model: GitHubModelName, options?: { organization?: string | ParameterResource;}): GitHubModelResource (+1 overload)
Adds a GitHub Model resource to the distributed application model.
addGitHubModel("chat", "openai/gpt-4o-mini");Error ts(2769) ―
await const builder: IDistributedApplicationBuilder
builder.IDistributedApplicationBuilder.addNodeApp(name: string, appDirectory: string, scriptPath: string): NodeAppResource
Adds a Node.js application resource
addNodeApp("api", "./api", "index.js") .ExecutableResource.withReference(source: EndpointReference | string | uri, options?: { connectionName?: string; optional?: boolean; name?: string;} | undefined): NodeAppResource (+2 overloads)
Adds a reference to another resource
withReference(const chat: GitHubModelResource
chat);Client integration
Section titled “Client integration”The Aspire.Azure.AI.Inference package provides the client integration. In your service project:
builder.AddAzureChatCompletionsClient("chat");Connection string formats
Section titled “Connection string formats”Understanding how hosting and client integrations communicate through connection strings can help you troubleshoot connectivity issues and understand the underlying mechanics.
Each hosting integration generates connection strings in different formats that are consumed by the client integrations.
Hosting integration connection strings
Section titled “Hosting integration connection strings”Aspire.Hosting.Foundry
Section titled “Aspire.Hosting.Foundry”Azure:
Endpoint={Endpoint};EndpointAIInference={EndpointAIInference}modelsFoundry Local:
Endpoint={EmulatorServiceUri};Key={ApiKey}Deployment:
{Parent};Deployment={DeploymentName}Aspire.Hosting.Azure.CognitiveServices
Section titled “Aspire.Hosting.Azure.CognitiveServices”Deployment:
{ConnectionString};Deployment={DeploymentName}Aspire.Hosting.OpenAI
Section titled “Aspire.Hosting.OpenAI”Endpoint={Endpoint};Key={Key};Model={Model}Aspire.Hosting.GitHub.Models
Section titled “Aspire.Hosting.GitHub.Models”Endpoint=https://models.github.ai/inference;Key={Key};Model={ModelName}Client integration connection string requirements
Section titled “Client integration connection string requirements”Aspire.OpenAI
Section titled “Aspire.OpenAI”Expects connection strings in the format:
Endpoint={Endpoint};Key={Key};Deployment={Deployment};Model={Model}Uses either Deployment or Model (in that order). Deployment is set by Aspire.Hosting.Azure.CognitiveServices while Model is set by Aspire.Hosting.OpenAI.
Aspire.Azure.AI.OpenAI
Section titled “Aspire.Azure.AI.OpenAI”Expects connection strings in the format:
Endpoint={Endpoint};Key={Key};Deployment={Deployment};Model={Model}Uses either Deployment or Model (in that order). Deployment is set by Aspire.Hosting.Azure.CognitiveServices while Model is set by Aspire.Hosting.OpenAI.
This integration is a superset of Aspire.OpenAI and supports TokenCredential and Azure-specific features.
Aspire.Azure.AI.Inference
Section titled “Aspire.Azure.AI.Inference”Expects connection strings in the format:
Endpoint={Endpoint};EndpointAIInference={EndpointAIInference};Key={Key};Deployment={DeploymentName};Model={ModelName}Uses either Deployment or Model (in that order). Deployment is set by Aspire.Hosting.Azure.CognitiveServices while Model is set by Aspire.Hosting.GitHub.Models.
Uses EndpointAIInference if available, otherwise Endpoint.