Problem
When using Amazon Bedrock with application inference profiles, the Bedrock region is determined by AWS_REGION / AWS_DEFAULT_REGION environment variables. In enterprise environments, teams commonly set AWS_REGION to one region (e.g. us-east-1) for general AWS CLI operations, while their Bedrock inference profiles live in a different region (e.g. us-west-2).
This forces users to override AWS_REGION specifically when launching pi, which creates friction when running AWS CLI commands from within pi sessions that need the original region.
Current Behavior
Region resolution in getConfiguredBedrockRegion():
options.region || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || undefined
The only way to set options.region is programmatically — there is no CLI flag or settings.json field exposed to users.
Proposed Solution
One or more of:
-
Parse region from ARN: If the model ID is an inference profile ARN (arn:aws:bedrock:<region>:<account>:application-inference-profile/...), extract and use the region from it automatically. This is the most ergonomic solution since the region is already embedded in the identifier.
-
Add a --region CLI flag: Allow pi --provider amazon-bedrock --region us-west-2 to set options.region directly.
-
Add a region field to settings.json: Allow persistent configuration:
{
"provider": "amazon-bedrock",
"region": "us-west-2"
}
-
Support a dedicated env var like AWS_BEDROCK_REGION that takes priority over AWS_REGION for Bedrock specifically.
Use Case
AWS_REGION=us-east-1 set globally for all AWS CLI tooling
- Bedrock inference profiles provisioned in
us-west-2
- Model configured as an inference profile ARN pointing to
us-west-2
Currently requires wrapping pi launch with AWS_REGION=us-west-2 pi, which then breaks AWS CLI commands run from within the pi session that expect us-east-1.
Problem
When using Amazon Bedrock with application inference profiles, the Bedrock region is determined by
AWS_REGION/AWS_DEFAULT_REGIONenvironment variables. In enterprise environments, teams commonly setAWS_REGIONto one region (e.g.us-east-1) for general AWS CLI operations, while their Bedrock inference profiles live in a different region (e.g.us-west-2).This forces users to override
AWS_REGIONspecifically when launching pi, which creates friction when running AWS CLI commands from within pi sessions that need the original region.Current Behavior
Region resolution in
getConfiguredBedrockRegion():The only way to set
options.regionis programmatically — there is no CLI flag or settings.json field exposed to users.Proposed Solution
One or more of:
Parse region from ARN: If the model ID is an inference profile ARN (
arn:aws:bedrock:<region>:<account>:application-inference-profile/...), extract and use the region from it automatically. This is the most ergonomic solution since the region is already embedded in the identifier.Add a
--regionCLI flag: Allowpi --provider amazon-bedrock --region us-west-2to setoptions.regiondirectly.Add a
regionfield to settings.json: Allow persistent configuration:{ "provider": "amazon-bedrock", "region": "us-west-2" }Support a dedicated env var like
AWS_BEDROCK_REGIONthat takes priority overAWS_REGIONfor Bedrock specifically.Use Case
AWS_REGION=us-east-1set globally for all AWS CLI toolingus-west-2us-west-2Currently requires wrapping pi launch with
AWS_REGION=us-west-2 pi, which then breaks AWS CLI commands run from within the pi session that expectus-east-1.