feat(evals): pin judge calls to the low inference class - #6730
Merged
theomonnom merged 3 commits intoAug 6, 2026
Merged
Conversation
Judging is batch load: an eval suite fans out many judgments at once, they run after the conversation they grade, and nobody is waiting on the verdict. So they should not compete with live traffic for gateway capacity. judge_chat_kwargs() returns the chat() kwargs for a judgment, pinning the low class when the judge runs on a LiveKit Inference model and staying empty for a plugin LLM, which has no class to set. Applied at both judge call sites: - evals/judge.py _evaluate_with_llm, used by every built-in judge (accuracy, task_completion, handoff, tool_use, safety, relevancy, coherence, conciseness) through JudgeGroup - voice/run_result.py ChatMessageAssert.judge, the test assertion judge It overrides the class the judge LLM was configured with, so an eval cannot claim priority capacity, matching how a text simulation behaves. The agent under test is deliberately left alone: it is the thing being measured, and its latency should stay representative of production.
chenghao-mou
approved these changes
Aug 6, 2026
It is an internal helper, not part of the evals API. The leading underscore survives the cross-module import into voice/run_result, which matches how _JobContextVar is imported into ipc/.
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.
Follow-up to #6721, same rationale applied to judges. Judging is batch load: an eval suite fans out many judgments at once, they run after the conversation they grade, and nobody is waiting on the verdict. They should not compete with live traffic for gateway capacity.
How
_judge_chat_kwargs()returns thechat()kwargs for a judgment call:Applied at both judge call sites:
evals/judge.py::_evaluate_with_llm, which every built-in judge goes through:accuracy,task_completion,handoff,tool_use,safety,relevancy,coherence,conciseness, whether reached viaJudgeGroupor by calling a judge directlyvoice/run_result.py::ChatMessageAssert.judge, the test-assertion judgeIt overrides the class the judge LLM was configured with, so an eval cannot claim priority capacity, matching how a text simulation behaves in #6721. The
isinstanceguard keeps it empty for a plugin LLM, which has no LiveKit Inference class to set; the existingtest_judge.pysuite runs its judges on a plainllm.LLMsubclass, so that branch is already covered.What is deliberately not changed
The agent under test. It is the thing being measured, and its latency should stay representative of production, so an eval only demotes the grading calls, not the conversation being graded.
lowstays out of the publicInferenceClassliteral. The kwargs helper returnsdict[str, Any], so nothing here needs the literal widened while the gateway still maps anything that is notprioritytostandard.Note on the gateway side
As in #6721: the gateway recognizes only
standardandpriorityonX-LiveKit-Inference-Prioritytoday, solowis currently equivalent tostandard. This is a no-op on billing and scheduling until a low tier lands gateway-side; the immediate effect is that evals can no longer requestpriority.Testing
make type-checkclean (629 source files),make lintand format check cleanuv run pytest --unit: 1415 passed, identical to the baselineJudgeGroup+accuracy_judgelowJudgeGroup+task_completion_judgeprioritylowaccuracy_judge(llm=...)called directlyprioritylowChatMessageAssert.judgeprioritylow