posit-dev / posit-dev/chatlas

Bedrock providers ignore AWS_ENDPOINT_URL_BEDROCK_RUNTIME env var

Open Beginner friendly
#415 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triage:done Priority: Low
Dominant language
Python
Stars
176
Forks
28
Avg merge
18h 42m
Merged PRs (30d)
16

Description

Summary

ChatBedrockAnthropic/ChatAWSBedrock (chatlas/_provider_bedrock.py) and the Converse-based provider (chatlas/_provider_bedrock_converse.py) both compute base_url from the AWS region whenever no explicit base_url is passed:

# _provider_bedrock.py / _provider_bedrock_converse.py
resolved_base_url = base_url or bedrock_base_url("converse", aws_region)  # or "messages"/"responses"

This bypasses botocore's native support for AWS_ENDPOINT_URL_BEDROCK_RUNTIME (and the generic AWS_ENDPOINT_URL), which is the standard way to point AWS SDKs at a custom Bedrock runtime endpoint (e.g. VPC endpoints, proxies, local testing, FIPS endpoints, or region-specific overrides not covered by the built-in formula).

ellmer just added this: chat_aws_bedrock() now defaults base_url from AWS_ENDPOINT_URL_BEDROCK_RUNTIME (tidyverse/ellmer#1104). The corresponding Anthropic-direct case, ANTHROPIC_BASE_URL, is already handled for free in chatlas since the anthropic Python SDK reads that env var internally -- no action needed there.

Expected fix

In _provider_bedrock.py and _provider_bedrock_converse.py, when base_url is not explicitly passed, check os.environ.get("AWS_ENDPOINT_URL_BEDROCK_RUNTIME") before falling back to the computed bedrock_base_url(...) formula.

References

  • ellmer PR: tidyverse/ellmer#1104
  • chatlas: chatlas/_provider_bedrock.py, chatlas/_provider_bedrock_converse.py (resolved_base_url = base_url or bedrock_base_url(...))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in chatlas/_provider_bedrock.py and chatlas/_provider_bedrock_converse.py at the documented resolved_base_url fallback. Check how the AWS_ENDPOINT_URL_BEDROCK_RUNTIME environment variable should take precedence when base_url is omitted, while preserving the computed Bedrock URL fallback. Done means both provider paths honor the environment variable and existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.