Azure OpenAI 模型容量查询
capacity
跨区域和跨项目发现可用的 Azure OpenAI 模型容量。分析配额限制、比较可用性,并根据容量需求推荐最佳部署位置。适用场景:查找容量、检查配额、可以在哪里部署、容量发现、容量最佳区域、多项目容量搜索、配额分析、模型可用性、区域比较、检查 TPM 可用性。不适用场景:实际部署(发现后转交给预设或自定义技能)、配额提升申请(引导用户前往 Azure 门户)、列出现有部署。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 264
- Forks
- 225
01 前言 Front Matter
- name
- capacity
- license
- MIT
- metadata
- { "author": "Microsoft", "version": "1.0.0" }
- description
- 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.
02 资源文件 4
- 脚本scripts/discover_and_rank.ps14.6 KB
- 脚本scripts/discover_and_rank.sh4.5 KB
- 脚本scripts/query_capacity.ps13.0 KB
- 脚本scripts/query_capacity.sh2.9 KB
03 SKILL.md 正文
Capacity Discovery
Finds available Azure OpenAI model capacity across all accessible regions and projects. Recommends the best deployment location based on capacity requirements.
Quick Reference
| Property | Description |
|---|---|
| Purpose | Find where you can deploy a model with sufficient capacity |
| Scope | All regions and projects the user has access to |
| Output | Ranked table of regions/projects with available capacity |
| Action | Read-only analysis — does NOT deploy. Hands off to preset or customize |
| Authentication | Azure CLI (az login) |
When to Use This Skill
- ✅ User asks "where can I deploy gpt-4o?"
- ✅ User specifies a capacity target: "find a region with 10K TPM for gpt-4o"
- ✅ User wants to compare availability: "which regions have gpt-4o available?"
- ✅ User got a quota error and needs to find an alternative location
- ✅ User asks "best region and project for deploying model X"
After discovery → hand off to preset or customize for actual deployment.
Scripts
Pre-built scripts handle the complex REST API calls and data processing. Use these instead of constructing commands manually.
| Script | Purpose | Usage |
|---|---|---|
scripts/discover_and_rank.ps1 |
Full discovery: capacity + projects + ranking | Primary script for capacity discovery |
scripts/discover_and_rank.sh |
Same as above (bash) | Primary script for capacity discovery |
scripts/query_capacity.ps1 |
Raw capacity query (no project matching) | Quick capacity check or version listing |
scripts/query_capacity.sh |
Same as above (bash) | Quick capacity check or version listing |
Workflow
Phase 1: Validate Prerequisites
az account show --query "{Subscription:name, SubscriptionId:id}" --output table
Phase 2: Identify Model and Version
Extract model name from user prompt. If version is unknown, query available versions:
.\scripts\query_capacity.ps1 -ModelName <model-name>
./scripts/query_capacity.sh <model-name>
This lists available versions. Use the latest version unless user specifies otherwise.
Phase 3: Run Discovery
Run the full discovery script with model name, version, and minimum capacity target:
.\scripts\discover_and_rank.ps1 -ModelName <model-name> -ModelVersion <version> -MinCapacity <target>
./scripts/discover_and_rank.sh <model-name> <version> <min-capacity>
? 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.
Phase 3.5: Validate Subscription Quota
After 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.
# For each candidate region from discovery results:
$usageData = az cognitiveservices usage list --location <region> --subscription $SUBSCRIPTION_ID -o json 2>$null | ConvertFrom-Json
# Check quota for each SKU the model supports
# Quota names follow pattern: OpenAI.<SKU>.<model-name>
$usageEntry = $usageData | Where-Object { $_.name.value -eq "OpenAI.<SKU>.<model-name>" }
if ($usageEntry) {
$quotaAvailable = $usageEntry.limit - $usageEntry.currentValue
} else {
$quotaAvailable = 0 # No quota allocated
}
# For each candidate region from discovery results:
usage_json=$(az cognitiveservices usage list --location <region> --subscription "$SUBSCRIPTION_ID" -o json 2>/dev/null)
# Extract quota for specific SKU+model
quota_available=$(echo "$usage_json" | jq -r --arg name "OpenAI.<SKU>.<model-name>" \
'.[] | select(.name.value == $name) | .limit - .currentValue')
Annotate discovery results:
Add a "Quota Available" column to the ranked output from Phase 3:
| Region | Available Capacity | Meets Target | Projects | Quota Available |
|---|---|---|---|---|
| eastus2 | 120K TPM | ✅ | 3 | ✅ 80K |
| westus3 | 90K TPM | ✅ | 1 | ❌ 0 (at limit) |
| swedencentral | 100K TPM | ✅ | 0 | ✅ 100K |
Regions/SKUs where quotaAvailable = 0 should be marked with ❌ in the results. If no region has available quota, hand off to the quota skill for increase requests and troubleshooting.
Phase 4: Present Results and Hand Off
After the script outputs the ranked table (now annotated with quota info), present it to the user and ask:
- ? Quick deploy to top recommendation with defaults → route to preset
- ⚙️ Custom deploy with version/SKU/capacity/RAI selection → route to customize
- ? Check another model or capacity target → re-run Phase 2
- ❌ Cancel
Phase 5: Confirm Project Before Deploying
Before handing off to preset or customize, always confirm the target project with the user. See the Project Selection rules in the parent router.
If 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.
Error Handling
| Error | Cause | Resolution |
|---|---|---|
| "No capacity found" | Model not available or all at quota | Hand off to quota skill for increase requests and troubleshooting |
| Script auth error | az login expired |
Re-run az login |
| Empty version list | Model not in region catalog | Try a different region: ./scripts/query_capacity.sh <model> "" eastus |
| "No projects found" | No AI Services resources | Guide to project/create skill or Azure Portal |
Related Skills
04 同仓库更多 Skills
azure-advisor-cost-optimization
Analyze Azure Advisor Cost/IdleResources findings and prevalidate deletion safety, including Service Groups. WHEN: "find unused Azure resources", "what resources am I paying for but no longer using", "idle-resource savings", "historical idle-resource savings", "are these idle resources safe to delete". Generic Cost, other subcategories, and cross-category requests use azure-advisor.
Foundry IQ 知识库管理
foundry-iq
Foundry IQ 知识库。适用时机:让本地或 Blob 文档可被搜索;创建/诊断知识库;对不支持的连接器或多源知识库的创建/重新配置进行分类处理;将现有知识库连接到智能体(包括多源知识库);创建/复用 Search 服务;从现有知识库检索带引用的内容;无需品牌词。在查询/目标类问题前先阅读其流程说明。不适用:其他知识库提供商、存储库文件搜索、不涉及 Foundry IQ 知识库或连接器请求的经典 Azure AI Search 索引/查询/应用类工作、通用智能体创建。
Python 应用 Azure 部署
python-appservice-deploy
将 Python(Flask/Django/FastAPI)代码部署到 Azure App Service Linux。触发条件:"Flask App Service"、"Django App Service"、"FastAPI App Service"、"将 Python 部署到 App Service"。不适用:Container Apps、Functions、非 Python、Terraform/Bicep/IaC、完整基础设施——请使用 azure-prepare。
Azure OpenAI 快速部署
preset
通过分析所有可用区域的容量,智能地将 Azure OpenAI 模型部署到最优区域。自动优先检查当前区域,并在需要时显示备选方案。适用于:快速部署、最优区域、最佳区域、自动区域选择、快速配置、多区域容量检查、高可用部署、部署到最佳位置。不适用于:自定义 SKU 选择(使用 customize)、特定版本选择(使用 customize)、自定义容量配置(使用 customize)、PTU 部署(使用 customize)。
Azure OpenAI 自定义部署
customize
具有完全自定义控制能力的 Azure OpenAI 模型交互式引导部署流程。逐步选择模型版本、SKU(GlobalStandard/Standard/ProvisionedManaged)、容量、RAI 策略(内容过滤器)以及高级选项(动态配额、优先处理、溢出)。适用于:自定义部署、定制模型部署、选择版本、选择 SKU、设置容量、配置内容过滤器、RAI 策略、部署选项、详细部署、高级部署、PTU 部署、预置吞吐量。不适用于:快速部署到最优区域(使用 preset)。
Azure OpenAI 模型部署
deploy-model
统一的 Azure OpenAI 模型部署技能,具备基于意图的智能路由。支持快速预设部署、完全自定义部署(版本 / SKU / 容量 / RAI 策略),以及跨区域和跨项目的容量发现。适用场景:部署模型、部署 gpt、创建部署、模型部署、部署 openai 模型、设置模型、配置模型、查找容量、检查模型可用性、可以在哪里部署、模型最佳区域、容量分析。不适用场景:列出现有部署(使用 foundry_models_deployments_list MCP 工具)、删除部署、创建智能体(使用 agent/create)、创建项目(使用 project/create)。