Official Website • Documentation • Releases • Discord
NEW: Subscribe to our mailing list for updates and news!
Welcome to IndoxJudge! This repository provides a comprehensive suite of evaluation metrics for assessing the performance and quality of large language models (LLMs). Whether you're a researcher, developer, or enthusiast, this toolkit offers essential tools to measure various aspects of LLMs, including knowledge retention, bias, toxicity, and more.
Overview
IndoxJudge is designed to provide a standardized and extensible framework for evaluating LLMs. With a focus on accuracy, fairness, and relevancy, this toolkit supports a wide range of evaluation metrics and is continuously updated to include the latest advancements in the field.
Features
- Comprehensive Metrics: Evaluate LLMs across multiple dimensions, including accuracy, bias, toxicity, and contextual relevancy.
- RAG Evaluation: Includes specialized metrics for evaluating retrieval-augmented generation (RAG) models.
- Safety Evaluation: Assess the safety of model outputs, focusing on toxicity, bias, and ethical considerations.
- Extensible Framework: Easily integrate new metrics or customize existing ones to suit specific needs.
- User-Friendly Interface: Intuitive and easy-to-use interface for seamless evaluation.
- Continuous Updates: Regular updates to incorporate new metrics and improvements.
Supported Models
Every judge runs through IndoxHub, the gateway that fronts 200+ models across 14 providers behind one key and one wire format. Get your key at indoxhub.com.
from indoxJudge.models import IndoxHub
llm = IndoxHub(model="openai/gpt-4o-mini") # or anthropic/claude-sonnet-4,
# google/gemini-2.0-flash, mistralai/mistral-large, ...
Set INDOXHUB_API_KEY in your environment and the key is picked up for you; set
INDOXHUB_BASE_URL to point at a self-hosted or staging gateway. Browse the model list at
api.indoxhub.com.
Changing the judge is a string change. That is why there is one provider here instead of seven — a per-vendor client is a per-vendor set of failure modes to maintain, and the gateway already speaks to all of them.
Metrics
IndoxJudge ships 60 metrics. Each name links to its page; docs/metrics has them all, one folder per group.
General quality
- GEval: Rubric-driven judge over coherence, relevance, accuracy, fluency and more.
- AnswerRelevancy: Is the answer relevant to the question?
- KnowledgeRetention: Does the model keep facts consistent across a conversation?
- Hallucination: Finds statements the given context does not support.
- Toxicity: Toxic content in the output.
- Bias: Biased opinions in the output.
- BertScore: Embedding similarity to one or more reference answers. Needs
[models]. - BLEU: n-gram precision against reference answers. Needs
[nlp]. - Rouge: n-gram overlap against reference answers. Needs
[nlp]. - METEOR: Reference match that credits stems and synonyms. Needs
[nlp]. - Gruen: Grammaticality, redundancy and focus of generated text. Needs
[models].
Retrieval (RAG)
- Faithfulness: Are the answer's claims backed by the retrieved context?
- ContextualRelevancy: Is each retrieved context relevant to the query?
- ContextualPrecision: Are useful contexts ranked above unhelpful ones?
- ContextualRecall: How much of the expected answer does the retrieved context support?
- ContextNoiseSensitivity: Does the model repeat wrong claims from the context? Higher is worse.
- ResponseGroundedness: Two judges check the answer is supported by what was retrieved.
Agents
- ToolCorrectness: Called the expected tools, optionally in order. No judge call.
- ToolPermission: Called only the tools it was allowed to. No judge call.
- ArgumentCorrectness: Passed the right values to its tools.
- TaskCompletion: Accomplished what the user came for.
- TopicAdherence: Stayed inside its scope, by precision, recall or F1.
- PlanQuality: Was the plan sound, judged before anyone followed it?
- PlanAdherence: Did the agent do what its plan said?
- StepEfficiency: Work done beyond what the task needed. No judge call.
- AgentLoopDetection: Stuck repeating steps or cycling. No judge call.
Conversations
- PerTurn: Runs any single-turn metric across every turn of a conversation.
- ConversationCompleteness: Did the thread, as a whole, give the user what they came for?
- RoleAdherence: Did the assistant hold its persona for the whole conversation?
Define your own
- CriteriaJudge: Score anything you can state as a sentence. No code.
- DecisionGraph: A rubric as a decision tree; the score comes with the path that made it.
- PromptAlignment: Share of the prompt's instructions the output followed.
- PairwiseComparison: Head-to-head: which answer is better on a criterion you name?
Format (no judge call)
- ExactMatch: Equals one of the accepted answers.
- PatternMatch: Matches a regular expression.
- JsonCorrectness: Valid JSON, optionally checked against a pydantic schema.
Safety
- SafetyToxicity: Harmful, offensive or inappropriate content.
- ToxicityDiscriminative: Classifies toxic content across one or many texts.
- Harmfulness: Content that could cause harm.
- Fairness: Biased, stereotyped or discriminatory content.
- StereotypeBias: Social, cultural, gender and racial stereotypes.
- MachineEthics: Ethical implications of the output.
- Misinformation: False or misleading claims.
- Privacy: Disclosure of personal or sensitive data.
- PIILeakage: Lists the personally identifying information an output exposes.
- NonAdvice: Regulated medical, legal or financial advice.
- AdversarialRobustness: Holds up under adversarial input.
- OutOfDistributionRobustness: Handles inputs unlike what it was trained on.
- RobustnessToAdversarialDemonstrations: Resists misleading few-shot examples.
Summarization
- Conciseness: Redundancy, wordiness and length.
- FactualConsistency: Does the summary agree with its source?
- InformationCoverage: Does the summary cover the source's key information?
- Relevance: Does the summary stay relevant to its source?
- StructureQuality: Coherence and logical flow of the summary.
- SummaryGEval: Grammatical and linguistic quality.
- SummaryToxicity: Toxicity, across several aspects.
- SummaryBertScore: Embedding similarity to a reference summary. Needs
[models]. - SummaryBleu: BLEU against a reference summary. Needs
[nlp]. - SummaryRouge: ROUGE against a reference summary. Needs
[nlp]. - SummaryMeteor: METEOR against a reference summary. Needs
[nlp].
Pipelines
Evaluators bundle metrics for a job and add weighting, scoring and charts:
- Evaluator: runs any list of metrics you choose.
- LLMEvaluator: general answer quality.
- RagEvaluator: retrieval ranking, coverage and grounding.
- SafetyEvaluator: the safety metrics above.
- SummaryEvaluator: the summarization metrics above.
- EvaluationAnalyzer: compares several models' results side by side.
LLMEvaluator, RagEvaluator and SummaryEvaluator include local metrics, so install [models] for them. Charts and the dashboard need [graph].
Installation
IndoxJudge needs Python 3.12 or newer. The base install runs every judge metric through IndoxHub; add an extra for the metrics that run on your machine:
pip install indoxJudge # every judge metric: agents, retrieval, safety, conversations, custom
pip install "indoxJudge[nlp]" # + BLEU, METEOR, Rouge and their summary versions
pip install "indoxJudge[models]" # + BertScore, Gruen, SummaryBertScore (torch, transformers)
pip install "indoxJudge[summarization]" # every summarization metric (nlp + models)
pip install "indoxJudge[graph]" # + charts and the dashboard (dash, plotly, pandas)
pip install "indoxJudge[all]" # everything
A metric whose extra is missing raises an error naming the pip install command to run.
From source
git clone https://github.com/nematiai/indoxJudge.git
cd indoxJudge
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[all]"
For development (tests, lint, notebooks), add the dev group (needs pip 25.1+, or use uv sync):
pip install -e ".[all]" --group dev
pytest
Or run the tests in Docker, with nothing installed on your machine:
echo "TORCH_BACKEND=cpu" > .env # or e.g. cu128 for a GPU; add INDOXHUB_API_KEY to call a judge
make build
make test # everything; `make test-fast` skips the model downloads
Usage
To use IndoxJudge, load your API key, select the model, and choose the evaluation metrics. Here's an example demonstrating how to evaluate a model's response for faithfulness:
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Import IndoxJudge and supported models
from indoxJudge.pipelines import Evaluator
from indoxJudge.models import IndoxHub
from indoxJudge.metrics import Faithfulness
# Initialize the model with your API key
model = IndoxHub(model="openai/gpt-4o-mini")
# Define your query and retrieval context
query = "What are the benefits of a Mediterranean diet?"
retrieval_context = [
"The Mediterranean diet emphasizes eating primarily plant-based foods, such as fruits and vegetables, whole grains, legumes, and nuts. It also includes moderate amounts of fish and poultry, and low consumption of red meat. Olive oil is the main source of fat, providing monounsaturated fats which are beneficial for heart health.",
"Research has shown that the Mediterranean diet can reduce the risk of heart disease, stroke, and type 2 diabetes. It is also associated with improved cognitive function and a lower risk of Alzheimer's disease. The diet's high content of fiber, antioxidants, and healthy fats contributes to its numerous health benefits.",
"A Mediterranean diet has been linked to a longer lifespan and a reduced risk of chronic diseases. It promotes healthy aging and weight management due to its emphasis on whole, unprocessed foods and balanced nutrition."
]
# Obtain the model's response
response = "The Mediterranean diet is known for its health benefits, including reducing the risk of heart disease, stroke, and diabetes. It encourages the consumption of fruits, vegetables, whole grains, nuts, and olive oil, while limiting red meat. Additionally, this diet has been associated with better cognitive function and a reduced risk of Alzheimer's disease, promoting longevity and overall well-being."
# Initialize the Faithfulness metric
faithfulness_metrics = Faithfulness(llm_response=response, retrieval_context=retrieval_context)
# Create an evaluator with the selected metrics
evaluator = Evaluator(metrics=[faithfulness_metrics], model=model)
# Evaluate the response
faithfulness_result = evaluator.judge()
# Output the evaluation result
print(faithfulness_result)
Running metrics concurrently
Metrics do not depend on each other, so the only thing serialising them is the wait on the provider.
Every evaluator also exposes ajudge(), which runs them at once:
import asyncio
from indoxJudge.pipelines import SafetyEvaluator
evaluator = SafetyEvaluator(model=model, input="Some sentence to check.")
results = asyncio.run(evaluator.ajudge())
ajudge() returns exactly what judge() returns. On a ten-metric suite at 0.3s per call this is
3.1s -> 0.6s. At most INDOXJUDGE_MAX_CONCURRENCY calls are in flight at a time (default 8); set the
environment variable, or pass max_concurrency= when you build the evaluator, to stay inside your
provider's rate limit.
An individual metric can be awaited on its own with await metric.a_measure().
Evaluating a whole dataset
One sample at a time is the exception; a suite is the normal case. Load samples from csv or jsonl, hand the runner a factory that turns a sample into metrics, and get per-sample results plus the means:
from indoxJudge.dataset import EvaluationDataset
from indoxJudge.metrics import AnswerRelevancy, Faithfulness
from indoxJudge.runner import DatasetRunner
dataset = EvaluationDataset.from_jsonl("evals.jsonl")
def build_metrics(sample):
return [
Faithfulness(llm_response=sample.llm_response, retrieval_context=sample.joined_context()),
AnswerRelevancy(query=sample.query, llm_response=sample.llm_response),
]
runner = DatasetRunner(model=llm, build_metrics=build_metrics)
runner.run(dataset) # or asyncio.run(runner.arun(dataset))
print(runner.mean_score) # 0.78
print(runner.per_metric_means()) # {"Faithfulness": 0.81, "AnswerRelevancy": 0.75}
runner.to_jsonl("results.jsonl")
You supply the factory rather than naming metrics, because only you know what your samples can
support - a dataset without ground_truth cannot feed ContextualRecall, and nothing here guesses.
Under arun() the samples overlap as well as the metrics within each one; a sample that raises is
recorded as an error and the rest of the run continues.
List fields survive the csv round trip: they are stored JSON-encoded in the cell, which is the one thing a naive csv writer gets wrong.
Caching judge replies
While you are iterating on a prompt or a metric, the same judge calls get paid for again on every
run. Set INDOXJUDGE_CACHE=1 and identical calls are served from a local SQLite file instead:
export INDOXJUDGE_CACHE=1
export INDOXJUDGE_CACHE_PATH=~/.cache/indoxjudge/prompts.db # optional
A reply is only reused for the same model, temperature and max_tokens — your API key is never part
of the key. evaluator.usage() reports input_tokens, output_tokens and cached_calls, so you
can see what the run actually cost.
Caching is off by default and should stay off for a run whose numbers you intend to trust. A cached judge is a deterministic judge, and replaying yesterday's verdict would hide the change an evaluation exists to catch.
Example Output
{
"faithfulness": {
"claims": [
"The Mediterranean diet is known for its health benefits.",
"The Mediterranean diet reduces the risk of heart disease.",
"The Mediterranean diet reduces the risk of stroke.",
"The Mediterranean diet reduces the risk of diabetes.",
"The Mediterranean diet encourages the consumption of fruits.",
"The Mediterranean diet encourages the consumption of vegetables.",
"The Mediterranean diet encourages the consumption of whole grains.",
"The Mediterranean diet encourages the consumption of nuts.",
"The Mediterranean diet encourages the consumption of olive oil.",
"The Mediterranean diet limits red meat consumption.",
"The Mediterranean diet is associated with better cognitive function.",
"The Mediterranean diet is associated with a reduced risk of Alzheimer's disease.",
"The Mediterranean diet promotes longevity.",
"The Mediterranean diet promotes overall well-being."
],
"truths": [
"The Mediterranean diet is known for its health benefits.",
"The Mediterranean diet reduces the risk of heart disease, stroke, and diabetes.",
"The Mediterranean diet encourages the consumption of fruits, vegetables, whole grains, nuts, and olive oil.",
"The Mediterranean diet limits red meat consumption.",
"The Mediterranean diet has been associated with better cognitive function.",
"The Mediterranean diet has been associated with a reduced risk of Alzheimer's disease.",
"The Mediterranean diet promotes longevity and overall well-being."
],
"reason": "The score is 1.0 because the 'actual output' aligns perfectly with the information presented in the 'retrieval context', showcasing the health benefits, disease risk reduction, cognitive function improvement, and overall well-being promotion of the Mediterranean diet."
}
}
Roadmap
We have an exciting roadmap planned for IndoxJudge:
| Plan |
|---|
| Integration of additional metrics such as Diversity and Coherence. |
| Introduction of a graphical user interface (GUI) for easier evaluation. |
| Expansion of the toolkit to support evaluation in multiple languages. |
| Release of a benchmarking suite for standardizing LLM evaluations. |
Contributing
We welcome contributions from the community! If you'd like to contribute, please fork the repository and create a pull request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a new branch from
production(git checkout -b feature-branch) - Make your change and run
pytest - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-branch) - Open a pull request against
production
Metadata
Release files for indoxJudge 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| indoxjudge-0.3.0.tar.gz | 156.0 kB | Without provenance | Details for indoxjudge-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| indoxjudge-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for indoxjudge-0.3.0-py3-none-any.whl |
Total release size: 372.6 kB
Release files / indoxjudge-0.3.0.tar.gz
| Download URL | indoxjudge-0.3.0.tar.gz |
|---|---|
| Size | 156.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a680ab6a1d43b9536246c8553c1ec66329924b8d9112f72d66947f0b565d96a
|
|
BLAKE2b-256 checksum How to use checksums |
03de4a14330a94f9fefbed50613c8a79c071a2ad1af686ef3c2e9cf27b826db7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / indoxjudge-0.3.0-py3-none-any.whl
| Download URL | indoxjudge-0.3.0-py3-none-any.whl |
|---|---|
| Size | 216.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d50708a302fad3b491bd0726486d11333058a95c2e1a71b3b01db22d57d61bec
|
|
BLAKE2b-256 checksum How to use checksums |
aad31866346004fc9bca2b84a81b11ca0b14ebe2a99ba35aa2f28bbde6bfb8d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for indoxJudge 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.