Skip to content

Route gemma models to mantle in bedrock#340

Merged
Erin McNulty (erin2722) merged 2 commits into
mainfrom
fix-gemma-mantle-bedrock
Jul 10, 2026
Merged

Route gemma models to mantle in bedrock#340
Erin McNulty (erin2722) merged 2 commits into
mainfrom
fix-gemma-mantle-bedrock

Conversation

@erin2722

Copy link
Copy Markdown
Contributor

Bedrock introduced new gemma models that only route to mantle (https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-google-gemma-4-e2b.html), so we need to add them to our mantle-only list.

If this starts becoming more of an issue we can add it to the model config 🤕 but for now this is fine I think

Manually validated that this invokes e2e, we already have e2e mantle testing so I think that is sufficient.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7300af23a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

// `bedrock-runtime`: xAI/Grok (`xai.`) and Google Gemma 4 (`google.gemma`).
fn is_bedrock_mantle_only_model(model: &str) -> bool {
model.starts_with("xai.")
model.starts_with("xai.") || model.starts_with("google.gemma")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit mantle-only matching to Gemma 4

When an AWS-managed Bedrock endpoint is used with existing Gemma 3 IDs such as google.gemma-3-27b-it, this broad prefix now sends Chat Completions through mantle_openai_url, which hard-codes /openai/v1/chat/completions. AWS documents Gemma 3's mantle base as /v1, while the /openai/v1 mantle base is called out for Gemma 4/xAI, so this regresses Gemma 3 routing even though the change is meant for the new Gemma 4 family; narrow this to google.gemma-4- or model the per-family path difference.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine, because all of the gemma 3 models also support mantle: https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards-google.html

also it looks like we are missing gemma 3 models from the model_list anyways, I'll seperately fix that

@erin2722 Erin McNulty (erin2722) Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually good grief this is cursed. they support mantle but a different mantle endpoint, so its actually better for them to stay on runtime .... i'll just fix this so its not a problem when I fix the model lsit

@erin2722 Erin McNulty (erin2722) merged commit e243cad into main Jul 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants