Skip to content

AIFoundryModel strongly-typed model catalog fails on local, GPU-enhanced models. #11592

@karolz-ms

Description

@karolz-ms

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Seems like the strongly-typed model catalog does not handle CPU/GPU/NPU model variations when using Foundry Local.

Expected Behavior

No response

Steps To Reproduce

(the following steps need to be run on a machine with a GPU supported by Foundry Local, e.g. nVidia RTX series)

  1. Create an Aspire starter app and add reference to Aspire.Hosting.Azure.AIFoundry nuget package to application host.
  2. Install Foundry Local Aspire.Hosting.Azure.AIFoundry
  3. Download phi-4-mini model, e.g. using the CLI: foundry model download phi-4-mini
  4. Add the following to the app host code
var localFoundry = builder.AddAzureAIFoundry("foundry")
    .RunAsFoundryLocal();

_ = localFoundry.AddDeployment("chat", "phi-4-mini", "1", "Microsoft"); // this works
_ = localFoundry.AddDeployment("chat2", AIFoundryModel.Microsoft.Phi4MiniInstruct); // this does not
  1. Run the app

Expected

Both "model deployments" should work

Actual

chat2 sub-resource fails to start with the error:

Failed to start Phi-4-mini-instruct. Error: Model 'Phi-4-mini-instruct' was not found in the catalogue

This is because neither the model ID, nor the model alias match what the strongly typed model catalog contains:

> foundry cache ls
Models cached on device:
   Alias                         Model ID
💾 phi-4-mini                    Phi-4-mini-instruct-cuda-gpu

Exceptions (if any)

No response

.NET Version info

Aspire version 9.5.0-preview.1.25468.4
Dotnet 10.0.0-rc.1.25451.107

Anything else?

No response

Metadata

Metadata

Assignees

Labels

aiarea-integrationsIssues pertaining to Aspire Integrations packages

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions