fix(llm): make LLMReranker work with Claude Opus 5.5 on Bedrock via call_kwargs - #278
Merged
Merged
Conversation
…all_kwargs
LLMReranker hardcoded temperature=0 on every LLM call. Claude Opus 4.7
and newer (including Opus 5.5) accept only the default temperature of 1,
so the reranker failed on Bedrock with a ValidationException and on
LiteLLM with UnsupportedParamsError. Add a call_kwargs argument,
defaulting to {"temperature": 0}, so callers can pass {} for those models.
Collaborator
|
Hi @kimnamu, |
# Conflicts: # CHANGELOG.md
Contributor
Author
|
Hi @zxqfd555 , I've done. Thank you for supporting great open source :) |
zxqfd555
approved these changes
Sep 23, 2026
Collaborator
|
Thank you, merged! |
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.
Thanks for taking a look, and for the Bedrock wrappers this builds on (#170, #248).
LLMRerankernow takescall_kwargs. The default stays{"temperature": 0};call_kwargs={}lets the reranker run on Claude Opus 5.5 on Bedrock, which accepts only the defaulttemperatureof 1 and rejects the reranker'stemperature=0.This is a small, self-contained bug fix and non-breaking: existing callers get the same kwargs as before.
CHANGELOG.mdhas an entry under[Unreleased].Related issue(s) / prior discussion
Fixes #277
Context
LLMReranker(llm, ...), live us-east-1BedrockChat("us.anthropic.claude-opus-5-5"),call_kwargs={}ValidationException: temperature is deprecated, no way to drop it[{'score': 5.0}]BedrockChat("global.anthropic.claude-opus-5-5"),call_kwargs={}[{'score': 5.0}]LiteLLMChat("bedrock/us.anthropic.claude-opus-5-5"),call_kwargs={}UnsupportedParamsError: ... does not support temperature=0[{'score': 5.0}]BedrockChat("us.anthropic.claude-opus-5"),call_kwargs={}ValidationException[{'score': 5.0}]llm, nocall_kwargstemperature=0temperature=0[{'score': 5.0}]LLMRerankerarguments, return typeThe hardcoded
dict(temperature=0)in__call__(rerankers.py:119-127) becomesself.call_kwargs, named afterHFPipelineChat(call_kwargs=...). Plus one test and the CHANGELOG line. The default is kept rather than picked per model, since that would need a model list in the chat wrappers.How has this been tested?
Run on the pathway 0.33.0 wheel with the changed files copied over it (the llm xpack files are byte-identical to
main):black24,isortandflake8pass on the changed files;mypyreports nothing inrerankers.py.New test against the old source, and the live runs
With only
rerankers.pyreverted:With the change:
4 passed, 1 warning.Live, same wheel with this change applied:
Eight documents through Opus 5.5 with
call_kwargs={}, both profiles:rows: 8 scores: [5.0, 4.0, 4.0, 2.0, 1.0, 1.0, 1.0, 1.0].Why the default stays
{"temperature": 0}: in one of two runs, Sonnet 4.5 withcall_kwargs={}wrapped its answer in a json code fence and the parse failed (ValueError: Expected a json response, gotfollowed by the fence); withtemperature=0it scored in both runs.Where the docstring's "accept only the default
temperature, such as Claude Opus 4.7 and newer" comes from, Bedrock Converse withinferenceConfig.temperature:References: Claude Opus 5.5 announcement, migration guide, models overview