A multi-provider LLM-as-a-Judge consensus panel with chained criteria for concept matching validation.
Project description
llm-judge-panel
A flexible, concurrent framework for evaluating concept matching in text datasets, using an LLM-as-a-Judge voting consensus. Chain multiple model providers and evaluate text rows across custom voting criteria simultaneously.
Features
- Two-stage Workflow: Run Stage 1 (Concept Verification) and Stage 2 (Candidate Matching) independently or combined.
- Parallel Multi-Criteria Evaluation: Evaluate your custom voting rules (e.g., strict and majority agreements) simultaneously in a single run.
- Granular Outputs: View aggregated execution metrics instantly and export row-level details directly to JSON, dictionaries, or pandas.
- Async Execution with Live Progress Tracking: Leverages
asyncioto execute judge pools concurrently, with real-time progress tracking.
Installation
It's simple!
pip install llm-judge-panel
Getting Started
1. Configure Environment Variables
Store your respective API keys in your environment variables, namely for the LLM provider(s) you would like to use. We currently support OpenAI, Anthropic, Google Gemini, and Together AI.
export OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
export GEMINI_KEY="your-key"
export TOGETHER_API_KEY="your-key"
2. Define Your Concept
"Concepts" are a quantity of interest. These can be anything!
from llm_judge_panel import Concept
skill_concept = Concept(
name="skill",
definition="The ability to perform a specific task and apply knowledge in a work context."
)
3. Define the Voting Criterion
Decide how you would like to resolve the individual LLM votes. You can choose one or multiple (current strict/unanimous, majority, and at_least_m).
from llm_judge_panel import VotingCriterion
evaluation_strategies = {
"strict": VotingCriterion(rule="strict"),
"majority": VotingCriterion(rule="majority")
}
4. Set Up the Panel and Run!
A panel consists of one or more LLM judges. Instantiate the panel with something like the following, and run on your data:
from llm_judge_panel import Panel
from llm_judge_panel.providers import *
async with Panel(criteria=evaluation_strategies) as panel:
panel.add_judge(OpenAIProvider("gpt-4o-mini"))
panel.add_judge(AnthropicProvider("claude-sonnet-4-5"))
# tuples of the form (extracted sentence, match candidate)
dataset = [
("Seeking an expert in distributed Go microservices.", "Go language"),
("...", "...")
]
run_result = await panel.judge_full_pipeline(skill_concept, dataset)
df = run_result.to_dataframe()
df.to_csv("results.csv", index=False)
Optional: Separate Stages
The function judge_full_pipeline runs both Stage 1 and 2 validation in order. If you would like only to run on of these, do the following:
# setup as before
run_result = await panel.judge_stage1(skill_concept, LIST_OF_LABELED_TEXT_TUPLES) # i.e., (TEXT, 1/0)
# OR
run_result = await panel.judge_stage2(skill_concept, LIST_OF_TUPLES) # i.e., like the above example
Contributing
For more providers or more flexible functionality, feel free to open up an issue!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_judge_panel-0.1.0.tar.gz.
File metadata
- Download URL: llm_judge_panel-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02db9036592d841f6b18462c0d81574de523d1968f4e4fc52dd63ce2fde4178
|
|
| MD5 |
68fdb0fb699c9870ce89c8b69b86f88a
|
|
| BLAKE2b-256 |
42feb2f0ba1c3519dfb1b16af917c30aa0c26485be0b0586531bdb32af2e3672
|
File details
Details for the file llm_judge_panel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_judge_panel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7042648448871d28ef6aa5689545c1c87983fcfd05ae1a712475e4798d618e19
|
|
| MD5 |
af8f38378211caf8fafc5e795332d342
|
|
| BLAKE2b-256 |
1d0ae3d427479ada84ca617a5e3e0a70d37fe74e1839420d43aaa8b845fa7fd8
|