Add Bedrock Mantle with native IAM credentials and GPT/Claude routing - #35
Open
edwardsb wants to merge 5 commits into
Open
Add Bedrock Mantle with native IAM credentials and GPT/Claude routing#35edwardsb wants to merge 5 commits into
edwardsb wants to merge 5 commits into
Conversation
BYOK: pluggable model providers (Gemini, Anthropic, OpenAI, xAI)
PGBOT_AI_PROVIDER=bedrock (alias mantle) reuses ResponsesProvider with AWS_BEARER_TOKEN_BEDROCK, defaulting to openai.gpt-5.6-terra in AWS_REGION > AWS_DEFAULT_REGION > us-east-1. Reasoning detection handles the openai. prefix and gpt-6, omits temperature, and floors output at 32k tokens with store=false.
Add Bedrock Mantle with native IAM credentials and GPT/Claude routing
Contributor
Author
|
hey @alexshapalov , I work mostly in AWS and I am in the progress of standing up pgbot mcp server in https://github.com/obot-platform/obot using their MCP Gateway. I needed a way for pgbot to use AWS Bedrock via IAM. This is working in my environment, so let me know what you think. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
PGBOT_AI_PROVIDER=bedrock(aliasmantle) for AWS Bedrock Mantle, with bearer-token authentication or native IAM credentials from the AWS SDK credential chain, includingAWS_PROFILE.openai.*models through the existing Responses client andanthropic.*models through the Messages client.openai.gpt-5.6-terra. Region selection usesAWS_REGION, thenAWS_DEFAULT_REGION, then the SDK configuration for IAM authentication, thenus-east-1.PGBOT_AI_API_KEYorAWS_BEARER_TOKEN_BEDROCK; otherwise derives short-lived bearer tokens locally from AWS credentials. IAM authentication restricts requests to the configured regional Mantle HTTPS endpoint, and redirects are disabled.openai.model prefix for reasoning models, omits temperature for those models, and retains the upstream Responses token-budget floor andstore=falsebehavior.Validation:
go test ./...,go test -race ./...,go vet ./..., and a static CLI build. Tests cover Responses request shape, IAM profile credentials, token signing and expiry, endpoint restrictions, redirect handling, and GPT/Claude routing.