# Quota Throttle Expert

> Diagnose AOAI deployment TPM exhaustion behind Foundry hosted agents — pull capacity vs utilization, identify burst patterns, recommend scale-up or PTU migration.

- **Type:** Skill
- **Install:** `agentstack add skill-aiappsgbb-awesome-gbb-quota-throttle-expert`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [aiappsgbb](https://agentstack.voostack.com/s/aiappsgbb)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [aiappsgbb](https://github.com/aiappsgbb)
- **Source:** https://github.com/aiappsgbb/awesome-gbb/tree/main/skills/azure-sre-agent/references/plugins/gbb-foundry/skills/quota_throttle_expert

## Install

```sh
agentstack add skill-aiappsgbb-awesome-gbb-quota-throttle-expert
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# quota_throttle_expert

## When to use

- A user reports 429s from a Foundry hosted agent's underlying model
- App Insights shows `Quota exceeded` / `OperationLimitExceeded` for a deployment
- A scheduled task flags TPM utilization > 80% for a deployment

## Investigation flow

1. **Identify the deployment**:
   ```bash
   az cognitiveservices account deployment show \
     --name  --resource-group  \
     --deployment-name  -o json
   ```
   Capture `sku.capacity` (TPM in thousands), `sku.name` (e.g. `Standard`, `GlobalStandard`, `ProvisionedManaged`).

2. **Pull TPM utilization** for the deployment over the failing window
   from App Insights (assumes `foundry-observability` is wired):
   ```kql
   customMetrics
   | where timestamp > ago(2h)
   | where name == "gen_ai.client.token.usage"
   | where customDimensions["gen_ai.system"] == "az.ai.openai"
   | where customDimensions["gen_ai.response.model"] == ""
   | summarize sum(valueSum) by bin(timestamp, 1m)
   | order by timestamp asc
   ```

3. **Compare against the deployment's capacity**:
   - `sku.capacity` of 100 → 100k TPM
   - Multiply by 60 → 6M tokens/minute capacity
   - Identify peak minutes vs limit

4. **Classify the throttle**:

   | Pattern | Cause | Recommendation |
   |---|---|---|
   | Sustained peak > 80% capacity | Workload outgrew baseline | Increase `sku.capacity` |
   | Spiky peaks 200%+ for 1-2 min, calm baseline | Burst pattern | Consider PTU (Provisioned Managed) for predictable burst headroom |
   | One client dominates | Single noisy neighbor | Add per-spoke rate-limit at Citadel APIM gateway (hand off to `apim_throttle_expert`) |
   | Region cap hit (Standard SKU) | Regional quota | Request quota increase via portal or migrate to `GlobalStandard` |

5. **Cross-check** with Azure Monitor's `TokenTransaction` metric (if the
   user has the `Microsoft.CognitiveServices/accounts` resource in the
   monitored RG).

6. **Output**: peak TPM, capacity, % utilization, classification, ONE recommended action with the exact CLI command (do NOT execute — review mode).

## Tools

- `RunAzCliReadCommands`
- `QueryAppInsightsByAppId`

## Safety

- Never modify the deployment SKU — `sku.capacity` changes are reviewed by the human (cost impact)
- Never read AOAI account keys

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [aiappsgbb](https://github.com/aiappsgbb)
- **Source:** [aiappsgbb/awesome-gbb](https://github.com/aiappsgbb/awesome-gbb)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-aiappsgbb-awesome-gbb-quota-throttle-expert
- Seller: https://agentstack.voostack.com/s/aiappsgbb
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
