bedrock_skill
- Python
976
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill itsmostafa/aws-agent-skills --skill bedrock- model-invocation.md13.0 KB
- SKILL.md10.6 KB
Overview
This skill provides an interface to AWS Bedrock foundation models for building generative AI applications. It exposes patterns for text generation, streaming responses, embeddings, conversation state, model listing, and model access management. Use it to integrate Claude, Titan, Llama, Mistral, and Stable Diffusion models through a unified API and boto3/CLI examples.
How this skill works
The skill wraps Bedrock Runtime and control-plane operations to invoke models synchronously or with streaming, create embeddings, and manage multi-turn conversations with history. It demonstrates common CLI and boto3 calls, handling model IDs, content types, and request/response JSON bodies. It also covers model discovery, access requests, and error handling patterns like retries and exponential backoff.
When to use it
- Building text-generation features (summaries, Q&A, code generation).
- Creating embeddings for retrieval-augmented generation (RAG) pipelines.
- Streaming long-form outputs to improve user experience.
- Managing model access, listing available models, or requesting EULA acceptance.
- Optimizing inference cost and throughput for production workloads.
Best practices
- Choose the smallest model that meets quality needs to reduce cost and latency.
- Set max_tokens and cache repeated responses to limit spend.
- Use streaming for long responses and provisioned throughput for high-volume steady traffic.
- Apply least-privilege IAM, enable VPC endpoints, and audit invocations with CloudTrail.
- Implement exponential backoff and retries for ModelNotReady and throttling errors.
Example use cases
- Invoke Claude to generate technical explanations or developer docs.
- Produce 1024-dimension embeddings with Titan for semantic search and RAG.
- Stream model output to a chat UI for progressive display of long answers.
- Maintain conversation history for a multi-turn assistant with system prompts.
- Automate model discovery and access checks before running inference jobs.
FAQ
Use on-demand for variable or unpredictable workloads and provisioned throughput when you need consistent low latency at scale and can commit to hourly capacity.
What causes AccessDeniedException and how to fix it?
AccessDenied usually means the model isn't enabled for your account, the region is wrong, or IAM lacks bedrock:InvokeModel permissions. Verify model access in the console and update IAM policies with least-privilege ARNs.