Amazon Bedrock
Clawdia can use Amazon Bedrock models via pi‑ai’s Bedrock Converse streaming provider. Bedrock auth uses the AWS SDK default credential chain, not an API key.What pi‑ai supports
- Provider:
amazon-bedrock - API:
bedrock-converse-stream - Auth: AWS credentials (env vars, shared config, or instance role)
- Region:
AWS_REGIONorAWS_DEFAULT_REGION(default:us-east-1)
Automatic model discovery
If AWS credentials are detected, Clawdia can automatically discover Bedrock models that support streaming and text output. Discovery usesbedrock:ListFoundationModels and is cached (default: 1 hour).
Config options live under models.bedrockDiscovery:
enableddefaults totruewhen AWS credentials are present.regiondefaults toAWS_REGIONorAWS_DEFAULT_REGION, thenus-east-1.providerFiltermatches Bedrock provider names (for exampleanthropic).refreshIntervalis seconds; set to0to disable caching.defaultContextWindow(default:32000) anddefaultMaxTokens(default:4096) are used for discovered models (override if you know your model limits).
Setup (manual)
- Ensure AWS credentials are available on the gateway host:
- Add a Bedrock provider and model to your config (no
apiKeyrequired):
EC2 Instance Roles
When running Clawdia on an EC2 instance with an IAM role attached, the AWS SDK will automatically use the instance metadata service (IMDS) for authentication. However, Clawdia’s credential detection currently only checks for environment variables, not IMDS credentials. Workaround: SetAWS_PROFILE=default to signal that AWS credentials are
available. The actual authentication still uses the instance role via IMDS.
bedrock:InvokeModelbedrock:InvokeModelWithResponseStreambedrock:ListFoundationModels(for automatic discovery)
AmazonBedrockFullAccess.
Quick setup:
Notes
- Bedrock requires model access enabled in your AWS account/region.
- Automatic discovery needs the
bedrock:ListFoundationModelspermission. - If you use profiles, set
AWS_PROFILEon the gateway host. - Clawdia surfaces the credential source in this order:
AWS_BEARER_TOKEN_BEDROCK, thenAWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEY, thenAWS_PROFILE, then the default AWS SDK chain. - Reasoning support depends on the model; check the Bedrock model card for current capabilities.
- If you prefer a managed key flow, you can also place an OpenAI‑compatible proxy in front of Bedrock and configure it as an OpenAI provider instead.
