Skip to content

Conversation

0x-fang
Copy link
Contributor

@0x-fang 0x-fang commented Aug 1, 2025

Description

This PR fixes the issue when running a agent using tools with application inference profile of Claude Sonnet 3.7 as input. Note that using regional inference profile is working well, and only application inference profile (AIP) will not return any tools use information.

Root Cause

Langchain needs to identify the model id of the foundation model but fails to detect the foundation model from the input AIP ARN (e.g., arn:aws:bedrock:us-east-1:111111484058:application-inference-profile/c3myu2h6fllr), while regional inference profile contains the foundation model name us.anthropic.claude-3-7-sonnet-20250219-v1:0 and can be easily used to identify the base model id. Therefore, regional inference profile is working well while AIP is not.

Solution

To identify the foundation model used in AIP, we need to call Bedrock get_inference_profile control plane API, and parse the model id from the response.

Issue

#535

Copy link
Collaborator

@michaelnchin michaelnchin left a comment

Choose a reason for hiding this comment

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

Thanks @0x-fang !

@michaelnchin michaelnchin merged commit bce4ed8 into langchain-ai:main Aug 5, 2025
12 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.

Bug: Bedrock Application Inference ARN breaks Claude Sonnet tools usage (regional inference works)
2 participants