posit-dev / posit-dev/chatlas

`ChatBedrock()` mantle APIs: default model isn't served, and cross-region prefix isn't stripped from requests

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When porting #345 to ellmer in https://github.com/tidyverse/ellmer/pull/1101/, I found an edge case; 🤖 summary below:

Two related problems with model ids on the messages and responses APIs.

ChatBedrock(api="messages") with no model uses DEFAULT_MODEL (us.anthropic.claude-sonnet-4-6), but mantle's Anthropic endpoint doesn't serve Sonnet 4.6, with or without the prefix. list_models() on that endpoint currently returns only claude-fable-5, claude-haiku-4-5, claude-opus-4-7, claude-opus-4-8, claude-opus-5, and claude-sonnet-5.

import chatlas as ctl

ctl.ChatBedrock(api="messages").chat("Say hi")
#> 404: The model 'us.anthropic.claude-sonnet-4-6' does not exist

Separately, CROSS_REGION_PREFIX is only stripped for the MODEL_APIS lookup, not from the model id in the request. Converse needs the prefix but mantle rejects it, so a prefixed id that routes to mantle 404s:

ctl.ChatBedrock(model="us.openai.gpt-5.4").chat("Say hi")
#> 404: The model 'us.openai.gpt-5.4' does not exist

ellmer handles both by defaulting per API and stripping the prefix from the request when the API is messages or responses (aws_strip_region_prefix() in R/provider-aws.R).

Tested against chatlas main (0.22.1.dev5).

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 at ChatBedrock's model defaulting and request construction for the messages, responses, and Converse APIs, then compare the behavior with list_models(). Use the two reproductions in the issue to verify that the appropriate mantle models are selected and that prefixed model IDs work for both API paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.