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/model-selection-guide.md

View on GitHub
# Model Selection Guide

## Table of Contents
- Model ID Formats
- Model Access Provisioning
- Selection Criteria
- Embedding Models for Knowledge Bases
- Pricing Models

## Model ID Formats

Agents consistently get these wrong. Four patterns:

| Access Type | Format | Example Pattern |
|------------|--------|---------|
| On-demand (single region) | `provider.model-name-version` | `anthropic.claude-<model>-<date>-v<N>:0` |
| Cross-region (system-defined) | `geographic-prefix.provider.model-name-version` | `us.anthropic.claude-<model>-<date>-v<N>:0` |
| Application inference profile | ARN | `arn:aws:bedrock:<region>:<account-id>:inference-profile/<id>` |
| Provisioned throughput | ARN | `arn:aws:bedrock:<region>:<account-id>:provisioned-model/<id>` |

Always look up current model IDs: `aws bedrock list-foundation-models --region <region>` and `aws bedrock list-inference-profiles --region <region>`, or refer to the latest [Bedrock supported models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html).

**Critical**: Some models do not support on-demand invocation with base model IDs and require an inference profile ID instead. Before using a model, check `aws bedrock list-inference-profiles --region <region>` — if an inference profile exists for the model, use the inference profile ID. If you get `ValidationException: on-demand throughput isn't supported`, switch to the inference profile ID.

## Model Access Provisioning

Most serverless models are automatically available without manual enablement. Use IAM policies and SCPs to control which models can be used.

**What still requires action:**
- **Anthropic models**: Enabled by default but require a one-time usage form submission before first use (via Bedrock console playground or `PutUseCaseForModelAccess` API). For AWS Organizations, submitting via API at the management account level extends approval to child accounts.
- **Third-party Marketplace models**: A subset of models require AWS Marketplace subscription, which is created automatically on first invocation if the caller has `aws-marketplace:Subscribe` permission.
- **EULAs**: Some models still require EULA acceptance. Review EULAs at the [model card in Model Catalog](https://console.aws.amazon.com/bedrock/) or the [Bedrock third-party model terms](https://aws.amazon.com/legal/bedrock/third-party-models/).

**Access control**: Use IAM policies (`bedrock:InvokeModel` scoped to specific resource ARNs) and SCPs to control which models can be used. Use `bedrock:ListFoundationModels` for listing models and `bedrock:GetFoundationModel` for getting details about a specific model. The IAM Resource ARN format depends on the model ID type:
- Inference profile ID → `arn:aws:bedrock:<region>:<account-id>:inference-profile/<profile-id>`
- Base model ID → `arn:aws:bedrock:<region>::foundation-model/<model-id>`
- These are different ARN formats and are not interchangeable. See [Bedrock IAM resource types](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonbedrock.html#amazonbedrock-resources-for-iam-policies)
- For least-privilege policies scoped to specific inference profiles, you MUST include BOTH the inference profile ARN (`arn:aws:bedrock:<region>:<account-id>:inference-profile/<profile-id>`) AND the foundation model ARN with a wildcard region (`arn:aws:bedrock:*::foundation-model/<model-id>`), because the request may be routed to any region in the profile — otherwise `bedrock:InvokeModel` calls fail with `AccessDeniedException`. See [Prerequisites for inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-prereq.html)

**INVALID_PAYMENT_INSTRUMENT error:**
Some AWS accounts (especially Organizations with European billing/SEPA) get this error when subscribing to Marketplace models. This is an account billing issue, not a Bedrock issue.
- Workaround: temporarily set a VISA/credit card as default payment method
- Alternative: per AWS re:Post user reports, adding USD payment profiles in the organization management account (Billing → Payment Preferences → Payment profiles) for service providers ending with "- Marketplace" may resolve the issue
- Contact AWS Support if the issue persists

## Selection Criteria

List models with capabilities: `aws bedrock list-foundation-models --region <region>`

Quick defaults (verify current availability — new models are added frequently, check `aws bedrock list-foundation-models --region <region>` or the [Bedrock supported models page](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html)):
- **General purpose / reasoning**: Claude Sonnet
- **Fast + cheap**: Claude Haiku or Nova Micro
- **Open-source / fine-tuning on Bedrock**: Llama. For fine-tuning or hosting an open-weight model on SageMaker, use the `aws-ai-ml` skill.
- **Multilingual**: Cohere Command or Claude
- **Code generation**: Claude Sonnet or Llama

Decision framework — choose based on:

| Criterion | What to Check |
|-----------|--------------|
| Reasoning depth | Claude Opus/Sonnet for complex tasks, Haiku/Nova for simple |
| Cost sensitivity | Nova Micro or Haiku for lowest cost; batch inference for discounted bulk processing |
| Multimodal needs | Nova Pro/Lite for text + image + video; Claude Sonnet for text + image |
| Open-source requirement | Llama (Bedrock fine-tuning available). For other open-weight models, use SageMaker JumpStart through the `aws-ai-ml` skill |
| Latency sensitivity | Haiku or Nova Micro for fastest inference |
| Context window | Check: `aws bedrock get-foundation-model --model-identifier <model-id>` |

## Embedding Models for Knowledge Bases

This is a non-obvious choice that affects KB quality. The table below shows common options — additional embedding models (including multimodal embeddings) are available. Check `aws bedrock list-foundation-models --by-output-modality EMBEDDING --region <region>` for the current list.

| Model | Dimensions | Best For |
|-------|-----------|----------|
| Titan Embeddings V2 | 1024 (configurable) | Default choice, good multilingual support |
| Cohere Embed | 1024 | Strong multilingual, 100+ languages |

**Critical**: The embedding model dimensions MUST match the vector store index dimensions. Mismatched dimensions cause ingestion failure.

Refer to the latest AWS documentation on Bedrock embedding models for current options.

## Pricing Models

| Model | Description | When to Use |
|-------|-------------|-------------|
| On-demand | Pay per input/output token | Default, unpredictable traffic |
| Batch inference | Discounted async processing | Bulk processing, not real-time |
| Provisioned throughput | Reserved capacity, predictable pricing | High-volume, predictable workloads |
| Cross-region inference | Broader availability via geographic routing (uses on-demand pricing). Geographic profiles (`us.`, `eu.`, `apac.`) stay within their geography; `global.` profiles route across all commercial regions | Traffic distribution; use geographic profiles when data residency matters |
| Service tiers (on-demand) | Priority (fastest, premium price) / Standard (default) / Flex (discounted, may queue) | Match latency and cost to workload needs |
| Reserved tier | Dedicated capacity reservation (1 or 3 month commitment, 99.5% uptime target) | Mission-critical apps that cannot tolerate downtime |

Refer to the latest AWS documentation on Bedrock pricing for current rates and discount percentages. Pricing changes without notice — do not hardcode pricing assumptions.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated 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