Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build and deploy AI applications on Azure AI Foundry using Microsoft's model catalog and AI services
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
models/deploy-model/capacity/SKILL.md
1---2name: capacity3description: "Discovers available Azure OpenAI model capacity across regions and projects. Analyzes quota limits, compares availability, and recommends optimal deployment locations based on capacity requirements. USE FOR: find capacity, check quota, where can I deploy, capacity discovery, best region for capacity, multi-project capacity search, quota analysis, model availability, region comparison, check TPM availability. DO NOT USE FOR: actual deployment (hand off to preset or customize after discovery), quota increase requests (direct user to Azure Portal), listing existing deployments."4license: MIT5metadata:6author: Microsoft7version: "1.0.0"8---910# Capacity Discovery1112Finds available Azure OpenAI model capacity across all accessible regions and projects. Recommends the best deployment location based on capacity requirements.1314## Quick Reference1516| Property | Description |17|----------|-------------|18| **Purpose** | Find where you can deploy a model with sufficient capacity |19| **Scope** | All regions and projects the user has access to |20| **Output** | Ranked table of regions/projects with available capacity |21| **Action** | Read-only analysis — does NOT deploy. Hands off to preset or customize |22| **Authentication** | Azure CLI (`az login`) |2324## When to Use This Skill2526- ✅ User asks "where can I deploy gpt-4o?"27- ✅ User specifies a capacity target: "find a region with 10K TPM for gpt-4o"28- ✅ User wants to compare availability: "which regions have gpt-4o available?"29- ✅ User got a quota error and needs to find an alternative location30- ✅ User asks "best region and project for deploying model X"3132**After discovery → hand off to [preset](../preset/SKILL.md) or [customize](../customize/SKILL.md) for actual deployment.**3334## Scripts3536Pre-built scripts handle the complex REST API calls and data processing. Use these instead of constructing commands manually.3738| Script | Purpose | Usage |39|--------|---------|-------|40| `scripts/discover_and_rank.ps1` | Full discovery: capacity + projects + ranking | Primary script for capacity discovery |41| `scripts/discover_and_rank.sh` | Same as above (bash) | Primary script for capacity discovery |42| `scripts/query_capacity.ps1` | Raw capacity query (no project matching) | Quick capacity check or version listing |43| `scripts/query_capacity.sh` | Same as above (bash) | Quick capacity check or version listing |4445## Workflow4647### Phase 1: Validate Prerequisites4849```bash50az account show --query "{Subscription:name, SubscriptionId:id}" --output table51```5253### Phase 2: Identify Model and Version5455Extract model name from user prompt. If version is unknown, query available versions:5657```powershell58.\scripts\query_capacity.ps1 -ModelName <model-name>59```60```bash61./scripts/query_capacity.sh <model-name>62```6364This lists available versions. Use the latest version unless user specifies otherwise.6566### Phase 3: Run Discovery6768Run the full discovery script with model name, version, and minimum capacity target:6970```powershell71.\scripts\discover_and_rank.ps1 -ModelName <model-name> -ModelVersion <version> -MinCapacity <target>72```73```bash74./scripts/discover_and_rank.sh <model-name> <version> <min-capacity>75```7677> 💡 The script automatically queries capacity across ALL regions, cross-references with the user's existing projects, and outputs a ranked table sorted by: meets target → project count → available capacity.7879### Phase 3.5: Validate Subscription Quota8081After discovery identifies candidate regions, validate that the user's subscription actually has available quota in each region. Model capacity (from Phase 3) shows what the platform can support, but subscription quota limits what this specific user can deploy.8283```powershell84# For each candidate region from discovery results:85$usageData = az cognitiveservices usage list --location <region> --subscription $SUBSCRIPTION_ID -o json 2>$null | ConvertFrom-Json8687# Check quota for each SKU the model supports88# Quota names follow pattern: OpenAI.<SKU>.<model-name>89$usageEntry = $usageData | Where-Object { $_.name.value -eq "OpenAI.<SKU>.<model-name>" }9091if ($usageEntry) {92$quotaAvailable = $usageEntry.limit - $usageEntry.currentValue93} else {94$quotaAvailable = 0 # No quota allocated95}96```97```bash98# For each candidate region from discovery results:99usage_json=$(az cognitiveservices usage list --location <region> --subscription "$SUBSCRIPTION_ID" -o json 2>/dev/null)100101# Extract quota for specific SKU+model102quota_available=$(echo "$usage_json" | jq -r --arg name "OpenAI.<SKU>.<model-name>" \103'.[] | select(.name.value == $name) | .limit - .currentValue')104```105106**Annotate discovery results:**107108Add a "Quota Available" column to the ranked output from Phase 3:109110| Region | Available Capacity | Meets Target | Projects | Quota Available |111|--------|-------------------|--------------|----------|-----------------|112| eastus2 | 120K TPM | ✅ | 3 | ✅ 80K |113| westus3 | 90K TPM | ✅ | 1 | ❌ 0 (at limit) |114| swedencentral | 100K TPM | ✅ | 0 | ✅ 100K |115116Regions/SKUs where `quotaAvailable = 0` should be marked with ❌ in the results. If no region has available quota, hand off to the [quota skill](../../../quota/quota.md) for increase requests and troubleshooting.117118### Phase 4: Present Results and Hand Off119120After the script outputs the ranked table (now annotated with quota info), present it to the user and ask:1211221. 🚀 **Quick deploy** to top recommendation with defaults → route to [preset](../preset/SKILL.md)1232. ⚙️ **Custom deploy** with version/SKU/capacity/RAI selection → route to [customize](../customize/SKILL.md)1243. 📊 **Check another model** or capacity target → re-run Phase 21254. ❌ Cancel126127### Phase 5: Confirm Project Before Deploying128129Before handing off to preset or customize, **always confirm the target project** with the user. See the [Project Selection](../SKILL.md#project-selection-all-modes) rules in the parent router.130131If the discovery table shows a sample project for the chosen region, suggest it as the default. Otherwise, query projects in that region and let the user pick.132133## Error Handling134135| Error | Cause | Resolution |136|-------|-------|------------|137| "No capacity found" | Model not available or all at quota | Hand off to [quota skill](../../../quota/quota.md) for increase requests and troubleshooting |138| Script auth error | `az login` expired | Re-run `az login` |139| Empty version list | Model not in region catalog | Try a different region: `./scripts/query_capacity.sh <model> "" eastus` |140| "No projects found" | No AI Services resources | Guide to `project/create` skill or Azure Portal |141142## Related Skills143144- **[preset](../preset/SKILL.md)** — Quick deployment after capacity discovery145- **[customize](../customize/SKILL.md)** — Custom deployment after capacity discovery146- **[quota](../../../quota/quota.md)** — For quota viewing, increase requests, and troubleshooting quota errors, defer to this skill instead of duplicating guidance147