Drex for LlamaIndex
llama-index-evaluation-nace
Replace your LLM judge. LlamaIndex evaluators backed by Drex decision models from Nace: Drex returns probabilities, not text that has to be parsed.
Install
pip install llama-index-evaluation-nace
Set NACE_API_KEY. Optional: NACE_BASE_URL, NACE_DEFAULT_DECISION_MODEL. For OpenRouter, pass base_url="https://openrouter.ai/api/v1" and set OPENROUTER_API_KEY. See Backends and credentials in the repository README.
The default model is drex-max-v1.1. An explicit model= is sent exactly as given; without one, NACE_DEFAULT_DECISION_MODEL is used when set, else drex-max-v1.1. If that default is a text-only model (drex-v1.5, drex-v2.0) and the request has images, drex-max-v1.1 is used for that request. OpenRouter doesn't list v1.1 yet, so there the default is the original Drex Max, nace-ai/drex-max.
Usage
from llama_index.evaluation.nace import NaceFaithfulnessEvaluator
result = NaceFaithfulnessEvaluator().evaluate(
query="When was the Eiffel Tower completed?",
response="It was completed in 1889.",
contexts=["The Eiffel Tower was completed in March 1889."],
)
print(result.passing, result.score, result.feedback) # True 0.95 P(faithful)=0.95
evaluate() is sync and works in Jupyter; aevaluate() is async. evaluate_response() reads source nodes, so the evaluators work with BatchEvalRunner.
| Evaluator | Question | score / passing |
|---|---|---|
NaceFaithfulnessEvaluator |
Is every claim supported by the context? (strict) | P(yes); passing = P >= threshold (0.5) |
NaceRelevancyEvaluator |
Does the response answer the query, in line with the context? | P(yes); same threshold |
NaceCorrectnessEvaluator |
5-level score, against reference= when given |
1 to 5; passing = score >= score_threshold (4.0) |
raise_error=True (faithfulness, relevancy) raises ValueError on a failing result, as LlamaIndex's evaluators do. The question text is editable through update_prompts({"instructions": ...}).
Results are NaceEvaluationResult: probability, probabilities (score levels), model, request_id, usage.
Closing
Call close() (or await aclose()) to release the HTTP connections an evaluator opened; a client= you passed in stays open.
Images
Evaluators read ImageNode sources (image_path, base64 image, or a data: URL) and send them to Drex. The default model, drex-max-v1.1, reads images; when NACE_DEFAULT_DECISION_MODEL names a text-only model, requests with images still go to drex-max-v1.1, and an explicit text-only model= with images raises NaceImageModelError. image_urls= and ImageNode.image_url take data: URLs only; pass files as image_paths (a file path in a URL field is refused, never read). http(s) image URLs are refused, because Drex never fetches URLs. max_images=N keeps the N highest-scored image nodes, whatever their count; without it, more than 8 images (Drex's per-request limit) raise NaceImageLimitError rather than being trimmed silently. Strict faithfulness on image-only sources tends to score lower than on text; compare probabilities rather than trusting the default cut-off.
See examples/ for runnable scripts and notebooks.
Security
Versions 0.1.0 and 0.1.1 could send NACE_API_KEY (or DREX_API_KEY) to a custom base_url or to OpenRouter, and could forward internal deployment headers to other hosts, including through an HTTP client that follows redirects. Upgrade to 0.1.2. See the security note and changelog for details.
Metadata
Release files for llama-index-evaluation-nace 0.1.2
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 |
|---|---|---|---|---|
| llama_index_evaluation_nace-0.1.2.tar.gz | 22.1 kB | With provenance | Details for llama_index_evaluation_nace-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_evaluation_nace-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for llama_index_evaluation_nace-0.1.2-py3-none-any.whl |
Total release size: 52.0 kB
Release files / llama_index_evaluation_nace-0.1.2.tar.gz
| Download URL | llama_index_evaluation_nace-0.1.2.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9eac4ee4b9b91aa0bfce55145867883789b86849626649458507262973800767
|
|
BLAKE2b-256 checksum How to use checksums |
d2958b4d817fe35e860df491567185982533fa1bbd5ecdd19962783c32eb6403
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / llama_index_evaluation_nace-0.1.2-py3-none-any.whl
| Download URL | llama_index_evaluation_nace-0.1.2-py3-none-any.whl |
|---|---|
| Size | 30.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
671d752e3b5406ed1348608baaec6347465d6560688509be90ea6550a812ee53
|
|
BLAKE2b-256 checksum How to use checksums |
4feb2522cb4d8f0399d83cc0820cd3f64a2e13d5c35df6b94d77629810f4b5e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for llama-index-evaluation-nace 0.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for llama_index_evaluation_nace-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA 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.