Skip to content

opensite-ai/opensite-skills / amazon-bedrock

amazon-bedrock

Flagged

Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore (including the Harness managed agent loop). Applies when invoking models, setting up Knowledge Bases, creating agents, applying guardrails, deploying to AgentCore, migrating/porting/converting a Bedrock Agent (including inline agents) to an AgentCore Harness, troubleshooting Bedrock errors (ThrottlingException, AccessDeniedException), or choosing Bedrock models (Claude, Llama, Nova, Titan). Also for prompt caching, quota and throttling diagnosis, cost tracking, migrating between Claude model generations, chunking strategies, and Bedrock model selection. Covers AgentCore Payments (x402, microtransactions, Payment Manager, Connector, Instrument, Coinbase CDP, Stripe Privy, paid endpoints, agent payments). NOT for custom model training, Rekognition, or Comprehend. For SageMaker model discovery, customization, or endpoints, use aws-ai-ml.

FileKindSize
.aws-skill-metadataother18 B
SKILL.mdskill md34.1 KB
assets/kb_shim.py.tmplother3.4 KB
assets/lambda_shim.py.tmplother8.0 KB
assets/tool_schema.json.tmplother389 B
references/agentcore-credentials-and-security.mdmarkdown6.5 KB
references/agentcore-gateway.mdmarkdown7.0 KB
references/agentcore-harness.mdmarkdown22.0 KB
references/agentcore-memory-observability.mdmarkdown5.6 KB
references/agentcore-payments-setup-script.mdmarkdown12.3 KB
references/agentcore-payments-wiring.mdmarkdown12.1 KB
references/agentcore-payments.mdmarkdown19.5 KB
references/agentcore-registry-evaluations.mdmarkdown6.8 KB
references/agentcore-runtime-container-build.mdmarkdown10.4 KB
references/agentcore-runtime.mdmarkdown7.6 KB
references/agents-and-action-groups.mdmarkdown16.5 KB
references/bedrock-agents-to-agentcore-harness/cli.mdmarkdown2.0 KB
references/bedrock-agents-to-agentcore-harness/deploy.mdmarkdown12.0 KB
references/bedrock-agents-to-agentcore-harness/discovery.mdmarkdown3.9 KB
references/bedrock-agents-to-agentcore-harness/eligibility.mdmarkdown3.3 KB
references/bedrock-agents-to-agentcore-harness/mapping.mdmarkdown8.9 KB
references/cost-tracking.mdmarkdown4.5 KB
references/guardrails.mdmarkdown14.7 KB
references/knowledge-bases-decision-guide.mdmarkdown2.8 KB
references/knowledge-bases-retrieval.mdmarkdown8.3 KB
references/knowledge-bases-setup.mdmarkdown17.9 KB
references/managed-knowledge-bases-retrieval.mdmarkdown8.1 KB
references/managed-knowledge-bases-setup.mdmarkdown12.7 KB
references/migrate-bedrock-agents-to-agentcore-harness.mdmarkdown11.5 KB
references/model-invocation.mdmarkdown11.0 KB
references/model-migration.mdmarkdown4.3 KB
references/model-selection-guide.mdmarkdown7.4 KB
references/prompt-caching.mdmarkdown5.5 KB
references/prompt-engineering-by-model.mdmarkdown7.9 KB
references/quota-health.mdmarkdown4.3 KB
references/sdk-converse-api-python.mdmarkdown6.3 KB
references/sdk-converse-api-typescript.mdmarkdown6.5 KB
scripts/fetch_bedrock_agent.pyscript14.1 KB

references/quota-health.md

View on GitHub
# Bedrock Quota Health Check

Monitor and manage Bedrock model quotas to prevent throttling. Bedrock enforces per-model, per-region token quotas (TPM/TPD); some models also have a requests-per-minute (RPM) quota, but not all (e.g., Claude Opus 4.7/4.8 have no RPM quota and are governed solely by token-based quotas).

## Table of Contents
- [How Quota Reservation Works](#how-quota-reservation-works)
- [Audit Workflow](#audit-workflow)
- [CloudWatch Metrics](#cloudwatch-metrics)
- [When You're Being Throttled](#when-youre-being-throttled)
- [Quota Increase Requests](#quota-increase-requests)

## How Quota Reservation Works

Bedrock reserves TPM quota at request start based on: `Total input tokens + maxTokens` (i.e., `InputTokenCount + CacheWriteInputTokens + maxTokens`). If `maxTokens` is unset, it defaults to the model's maximum (up to 64K–128K), reserving far more quota than needed.

**Example (Claude Sonnet, 2M TPM quota):**
- `maxTokens=1000`, 500 input tokens: reserves 1,500 → ~1,333 concurrent requests
- `maxTokens` unset (defaults to 64K): reserves ~64,500 → ~31 concurrent requests

This is the most common cause of unexpected `ThrottlingException`. Always set `maxTokens` explicitly.

Cache read tokens (`CacheReadInputTokens`) are NOT counted toward your TPM quota at all — they don't contribute to the reservation calculation. Prompt caching therefore effectively increases your usable TPM capacity. At settlement, consumption is `InputTokenCount + CacheWriteInputTokens + (OutputTokenCount × burndown rate)`.

## Audit Workflow

### 1. Check Current Quotas

```bash
aws service-quotas list-service-quotas --service-code bedrock --region <REGION> --profile <PROFILE> --query "Quotas[?contains(QuotaName, 'tokens per minute')].{Name:QuotaName, Value:Value}" --output table
```

### 2. Check Recent Usage vs Limits

Run the quota health script:

```bash
python3 scripts/check-quota-health.py --region <REGION> --profile <PROFILE>
```

The script compares current quota limits against peak CloudWatch metrics over the last 24 hours and flags models approaching their limits.

### 3. Assess maxTokens Impact

Review application code for Bedrock calls without explicit `maxTokens`. Each unset call wastes quota proportional to the model's max output tokens.

## CloudWatch Metrics

Key metrics in the `AWS/Bedrock` namespace (dimension: `ModelId`):

| Metric | What It Tells You |
|--------|------------------|
| `Invocations` | RPM usage — compare against RPM quota |
| `InvocationThrottles` | Throttled requests — any value > 0 needs attention |
| `InputTokenCount` | Input token consumption per request |
| `OutputTokenCount` | Actual output tokens — use to right-size `maxTokens` |
| `InvocationLatency` | Latency distribution — spikes may correlate with throttling |

**Sample CloudWatch Logs Insights query** (requires model invocation logging enabled):

```
fields @timestamp, @message
| filter modelId like /claude/
| stats count() as requests, sum(inputTokenCount) as totalInput, sum(outputTokenCount) as totalOutput by bin(1m)
| sort @timestamp desc
```

## When You're Being Throttled

Decision table for resolving `ThrottlingException`:

| Situation | Action |
|-----------|--------|
| `maxTokens` not explicitly set | Set it to expected output length — biggest single impact |
| Traffic is bursty | Use cross-region inference profiles (`us.`, `eu.`, `global.` prefix) to distribute across regions |
| Steady-state traffic exceeds quota | Request a quota increase (see below) |
| Latency-sensitive workload | Use `priority` service tier for preferential processing |
| Non-time-critical workload | Use `flex` service tier (may queue during peak, lower cost) |
| Consistent high-volume | Request quota increase + use cross-region inference for headroom |

## Quota Increase Requests

```bash
aws service-quotas request-service-quota-increase --service-code bedrock --quota-code <QUOTA_CODE> --desired-value <VALUE> --region <REGION> --profile <PROFILE>
```

To find the quota code for a specific model:

```bash
aws service-quotas list-service-quotas --service-code bedrock --region <REGION> --profile <PROFILE> --query "Quotas[?contains(QuotaName, '<MODEL_NAME>')].{Code:QuotaCode, Name:QuotaName, Value:Value}"
```

Quota increases are reviewed by AWS — plan 1–3 business days. For urgent production needs, open an AWS Support case.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall