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.
Judge settings
Every setting has a default that suits a judge, and every one can be changed for the model you use:
| Setting | Default | Change it when |
|---|---|---|
temperature |
0.2 |
You want more varied verdicts (e.g. 1.0 with GEval(samples=...)), or the model rejects it: temperature=None leaves it out of the request |
max_tokens |
2048 |
Long replies get cut off (raise it), or the model wants another name for it: max_tokens=None, max_completion_tokens=4096 |
timeout |
120 seconds |
Slow models or long prompts |
max_retries |
3 |
Rate limits, timeouts and server errors are retried this many times with back-off; 0 turns retries off |
| any other keyword | not sent | Model-specific options pass straight through: top_p=, seed=, reasoning_effort=, ... |
IndoxHub(model="openai/gpt-4o-mini") # defaults
IndoxHub(model="anthropic/claude-sonnet-4", temperature=None) # leaves temperature out
IndoxHub(model="openai/o4-mini", temperature=None, max_tokens=None,
max_completion_tokens=4096, reasoning_effort="low")
A bad setting fails at once with a ValueError naming it. A call that fails at the model raises
JudgeError (from indoxJudge.models.errors import JudgeError) with the model, the cause and what to
change, for example:
Judge 'openai/o4-mini' at https://api.indoxhub.com/v1: it rejects temperature=0.2: pass temperature=None
to leave it out, or a value it accepts. (400: Unsupported value: 'temperature' does not support 0.2)
The same happens for a rejected key (401), a model the key cannot use (403), an unknown model (404),
rate limits or credits (429, after the retries), gateway failures (5xx), timeouts, an unreachable
gateway, and a reply cut off at max_tokens. Inside an evaluator the error is recorded under the
metric's name, {"error": "..."}, and the other metrics still run.
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)
General benchmark
tests/benchmark/general/ holds 10 public-domain passages (NASA, NCI, EPA, NIST, NPS, FWS, USGS,
NWS, USDA Forest Service). Each comes with a question, a reference answer, a good and a bad answer and
a two-turn conversation in input/, and every General metric's scores for both answers in output/.
Every metric scores the good answer above the bad one on 10 of 10 texts, except GRUEN on 9 of 10: it
rates fluency, not facts. The judge was Claude Opus through script/local_judge.py. This is a smoke
test and a regression guard, not a measure of agreement with human judgment. Re-run it with
JUDGE_URL=<local judge URL> JUDGE_MODEL=<name> python tests/benchmark/general/run.py.
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. Each IndoxHub judge has at most INDOXJUDGE_MAX_CONCURRENCY calls in flight (default 8),
however many metrics, samples or evaluators share it; set the variable to stay inside your provider's
rate limit. max_concurrency= on an evaluator limits how many metrics it runs at once.
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))
# a progress bar shows on a terminal; show_progress=False hides it
print(runner.mean_score) # 0.78
print(runner.per_metric_means()) # {"Faithfulness": 0.81, "AnswerRelevancy": 0.75}
runner.save("results.csv") # or .json / .jsonl - see "Saving a report"
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.
Saving a report
save() writes the results of an evaluator or a dataset run to a file; the extension picks the format:
evaluator.judge()
evaluator.save("report.json") # summary + full results
evaluator.save("report.csv") # one row per metric, opens in Excel or pandas
runner.save("results.jsonl") # one sample per line
| Format | Shape | Use it for |
|---|---|---|
.json |
{"summary": {...}, "results": {...}} (or "samples" for a dataset) |
Keeping the whole run: every score, reason, verdict and error, plus the summary |
.jsonl |
One sample per line: {"sample_id": ..., "<Metric>": {...}, "evaluation_score": ...} |
Large datasets, streaming, appending runs, loading with pandas.read_json(lines=True) |
.csv |
One row per sample and metric | Spreadsheets, BI tools, pandas.read_csv |
The CSV columns are sample_id, metric, score, success, threshold, reason, input_tokens, output_tokens, cached_calls, error, details. Each sample also gets an evaluation_score row. Extras
such as verdicts or a breakdown go into details as JSON, a failed metric fills error, and a value
that does not apply is left blank. It is written with the csv module (RFC 4180 quoting) in UTF-8; pass
encoding="utf-8-sig" if Excel shows the accents wrongly. For one column per metric instead:
pd.read_csv("report.csv").pivot(index="sample_id", columns="metric", values="score").
The summary in the JSON report holds the number of samples, the mean evaluation score, each
metric's mean score, pass rate and count, the number of errors, token totals, the judge model, a UTC
timestamp and the indoxJudge version. The layout follows what other evaluation tools save: Ragas gives
one row per sample, DeepEval nests metric results per test case, and lm-evaluation-harness keeps a JSON
summary next to per-sample JSONL.
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. Token counts
are estimates (tiktoken cl100k_base, or words when it cannot load), not what the provider bills.
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.
Verbose logging
indoxJudge is quiet by default. To watch each judge call, its token counts, every metric's score and any error as it happens, turn verbose on:
import indoxJudge
indoxJudge.verbose() # show the log
indoxJudge.verbose(False) # hide it again
or set it for a whole run without touching code:
export INDOXJUDGE_VERBOSE=1
The log goes to Python's standard logging, under the indoxJudge logger, so an application's own
logging setup applies: logging.getLogger("indoxJudge").setLevel(logging.INFO) lets it through your
handlers, and a logging.FileHandler keeps it in a file. Errors are reported in the results either way: a
metric that fails shows up as {"error": "..."}.
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.4.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.4.0.tar.gz | 169.5 kB | Without provenance | Details for indoxjudge-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| indoxjudge-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for indoxjudge-0.4.0-py3-none-any.whl |
Total release size: 392.9 kB
Release files / indoxjudge-0.4.0.tar.gz
| Download URL | indoxjudge-0.4.0.tar.gz |
|---|---|
| Size | 169.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fabf7e2f21cdc16bd346c73b20eba253e1858de4ea283314bc88b90fd4689bb
|
|
BLAKE2b-256 checksum How to use checksums |
b830180067e120a25193fd27043f4bcb82ff8d352be618e303e8f7f92a3d9509
|
| 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.4.0-py3-none-any.whl
| Download URL | indoxjudge-0.4.0-py3-none-any.whl |
|---|---|
| Size | 223.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6251a4c41f8168f6d1bafdfe229665f01c218a2b2f45c343d647f4830b406555
|
|
BLAKE2b-256 checksum How to use checksums |
d21b810983922ff1457d375d6d1c090d61fb61f76f9ac4741a119580f70fadad
|
| 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.4.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.