Fix Bedrock Anthropic adapter by adding required anthropic_version field#17744
Merged
harupy merged 4 commits intomlflow:masterfrom Nov 15, 2025
Merged
Fix Bedrock Anthropic adapter by adding required anthropic_version field#17744harupy merged 4 commits intomlflow:masterfrom
anthropic_version field#17744harupy merged 4 commits intomlflow:masterfrom
Conversation
Closed
11 tasks
Contributor
|
Documentation preview for 5b2eb78 is available at: More info
|
anthropic_version field
|
Hi @harupy @serena-ruan Any update on the PR merge? |
|
The below mlflow.genai.evaluate samples with "anthropic_version": "bedrock-2023-05-31" field. Can you please verify the patch solution? |
This change fixes an issue where LLM scorers couldn't work with Amazon Bedrock Claude models. The Bedrock API requires an 'anthropic_version' field when invoking Anthropic models, which was missing from the request payload. The fix adds the required 'anthropic_version' field with the appropriate version string 'bedrock-2023-05-31' to ensure compatibility with Bedrock's Anthropic model invocations. Fixes mlflow#17699 Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
The tests were failing because they were expecting request payloads without the anthropic_version field. This commit updates the test expectations to include the required anthropic_version field that was added to fix compatibility with Bedrock's Anthropic API. Signed-off-by: Harutaka Kawamura <harutaka@users.noreply.github.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
108d6a0 to
7dd2904
Compare
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Member
Author
Member
Author
|
@ravees did you have a chance to test? |
|
Hi @harupy , tested with the new fix and it worked for bedrock antropic models like |
Member
Author
|
@ravees Thanks for testing! This patch will be included in the 3.7.0 release, which we’re targeting for the end of November. |
jackiehimel
pushed a commit
to jackiehimel/mlflow
that referenced
this pull request
Nov 21, 2025
…field (mlflow#17744) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Signed-off-by: Harutaka Kawamura <harutaka@users.noreply.github.com> Signed-off-by: Jackie Himel <jacqueline.himel@vanderbilt.edu>
mprahl
pushed a commit
to opendatahub-io/mlflow
that referenced
this pull request
Nov 21, 2025
…field (mlflow#17744) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Signed-off-by: Harutaka Kawamura <harutaka@users.noreply.github.com>
Tian-Sky-Lan
pushed a commit
to Tian-Sky-Lan/mlflow
that referenced
this pull request
Nov 24, 2025
…field (mlflow#17744) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Signed-off-by: Harutaka Kawamura <harutaka@users.noreply.github.com> Signed-off-by: Tian Lan <sky.blue266000@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
Fixes #17699
What changes are proposed in this pull request?
This PR fixes an issue where LLM scorers (both built-in and custom) couldn't work with Amazon Bedrock Claude models. The root cause was that the Bedrock API requires an
anthropic_versionfield when invoking Anthropic models, which was missing from the request payload.The fix adds the required
anthropic_versionfield with the value"bedrock-2023-05-31"to the Bedrock Anthropic adapter's payload transformation.How is this PR tested?
The existing tests should cover this change. The fix ensures that the required field is always present in the payload when using Bedrock with Anthropic models.
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
This fix enables LLM scorers (such as
Correctness,Guidelines, and custom prompt judges) to work correctly with Amazon Bedrock Claude models by including the requiredanthropic_versionfield in API requests.What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/bug-fix- A user-facing bug fix worth mentioning in the release notesShould this PR be included in the next patch release?
🤖 Generated with Claude Code