Skip to content

Pass max_tokens as an int on the litellm judge backend - #1378

Open
gyanu2507 wants to merge 1 commit into
huggingface:mainfrom
gyanu2507:fix/litellm-judge-max-tokens-int
Open

Pass max_tokens as an int on the litellm judge backend#1378
gyanu2507 wants to merge 1 commit into
huggingface:mainfrom
gyanu2507:fix/litellm-judge-max-tokens-int

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Sep 4, 2026

Copy link
Copy Markdown

Fixes #1296

JudgeLM.__call_litellm set kwargs["max_tokens"] = (max_new_tokens,). JSON serialization turns that into [64], which a spec-compliant OpenAI-compatible server rejects. After retries the error text was returned as the judge response and scored.

Pass the integer. Test spies on litellm.completion and checks max_tokens is 64.

A trailing comma turned the cap into a one-element tuple, so OpenAI-compatible
servers returned 400 and the error string was scored as a judgment.
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] LLM judge silently scores API error strings: litellm backend sends max_tokens as a list, provider returns 400

1 participant