Skip to content

[AI Manager] Add az aimanager model commands - #10217

Open
gloriahxr wants to merge 2 commits into
Azure:mainfrom
gloriahxr:gloriahxr-aimanager-model-commands
Open

[AI Manager] Add az aimanager model commands#10217
gloriahxr wants to merge 2 commits into
Azure:mainfrom
gloriahxr:gloriahxr-aimanager-model-commands

Conversation

@gloriahxr

@gloriahxr gloriahxr commented Aug 14, 2026

Copy link
Copy Markdown

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️aimanager
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd aimanager model sub group aimanager model added

Add the new az aimanager model command group, mapping to the AIModels operations of the Microsoft.ContainerService aiModels resource at api-version 2026-05-02-preview.

Command Endpoint
az aimanager model show -l <location> -n <model> GET .../locations/{location}/aiModels/{modelName}
az aimanager model list -l <location> GET .../locations/{location}/aiModels
az aimanager model calculate-cost -l <location> -n <model> POST .../locations/{location}/aiModels/{modelName}/calculateCost

calculate-cost posts an empty request body to /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/aiModels/{modelName}/calculateCost and returns the ranked list of GPU SKU pricing plans (feasibility, per-replica hourly cost, max available replicas, estimated relative performance). No Azure or Kubernetes resources are provisioned.

AI models are read-only, region-scoped catalog entries, so this group only exposes read/action commands - there is no create/update/delete, no --resource-group, and no --no-wait. az aimanager model list is the intended way to discover the opaque model name used by --model-resource-id on az aimanager namespace modeldeployment add.

Table transformers are included for list and calculate-cost:

$ az aimanager model calculate-cost -l eastus2 -n 9806f0c862fdd920 -o table
VmSize                    Feasible    VmsPerReplica    VmHourlyPrice    TotalHourlyPrice    MaxAvailableReplicas    Quantization
------------------------  ----------  ---------------  ---------------  ------------------  ----------------------  --------------
Standard_NC24ads_A100_v4  True        1                3.67             3.67                4                       fp8

The vendored SDK already contained AIModelsOperations and the CalculateCostRequest/CalculateCostResponse models, so no SDK regeneration was needed. Extension version bumped 1.2.0 -> 1.2.1b1 with a matching HISTORY.rst entry.

Testing

  • New test_aimodel.py unit tests covering show/list/calculate-cost plumbing (including that calculate-cost sends an empty CalculateCostRequest body) and the new name validator.
  • New test_aimodel_scenario.py mocked scenario test exercising all three commands end-to-end through the CLI parser, following the existing test_modeldeployment_scenario.py pattern.
  • azdev style (flake8) clean and pylint 10.00/10 against the repo configs; existing aimanager tests unaffected.

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aimanager model show | list | calculate-cost

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

gloriahxr and others added 2 commits August 14, 2026 00:36
Add the 'az aimanager model' command group backed by the AIModels operations
of the vendored 2026-05-02-preview SDK:

* az aimanager model show -l <location> -n <model>
* az aimanager model list -l <location>
* az aimanager model calculate-cost -l <location> -n <model>

'calculate-cost' posts to
/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/aiModels/{modelName}/calculateCost
and returns the ranked GPU SKU pricing plans. Table transformers are provided
for 'list' and 'calculate-cost'.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 14, 2026 08:00
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi gloriahxr,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@gloriahxr

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants