Skip to main content

JADES Eval

JADES Eval measures how well a model response fulfills a given question or task, including requests used in jailbreak evaluations. Provide a question and a response to receive a score, scoring explanations, elapsed time, and token usage.

Choose one of two ways to use JADES:

Method Best for Start here
Python Calling JADES from your scripts, notebooks, or evaluation pipelines Python walkthrough
CLI Evaluating JSON/JSONL files, saving results, and resuming interrupted batches CLI walkthrough

PyPI package · GitHub Releases

Before you start: install and configure credentials

Both methods use the same setup. You need Python 3.10 or newer. We recommend installing JADES in a dedicated Python virtual environment. On Windows, use PowerShell for the commands below.

Step 1: create a working directory and install

mkdir jades-demo
cd jades-demo
python -m pip install --upgrade jades-eval

Step 2: create the configuration files

jades init

This creates two files in your current directory:

  • jades.toml: model names, service endpoints, and evaluation settings.
  • .env.example: a credentials template.

Step 3: add your credentials

Copy the template:

cp .env.example .env

Open .env in a text editor and enter your own Hugging Face token:

HF_TOKEN=your_hugging_face_token

JADES uses these defaults, so you do not need to edit jades.toml yet:

Setting Default
Model deepseek-ai/DeepSeek-V4-Flash-0731:together
Endpoint https://router.huggingface.co/v1
Credential variable HF_TOKEN

Run all subsequent commands and scripts from jades-demo. Keep credentials in .env; do not put them in Python scripts or commit them to a public repository. LLM calls use your account and are billed by your provider.

On first use, JADES downloads and caches the sentence-splitting and semantic-detection resources as needed, so startup may take longer. You can also prepare the resources before running either example:

jades prepare-resources --config jades.toml --env-file .env

Option 1: Python walkthrough

Step 1: create demo.py

Save this complete example as demo.py. The geography question demonstrates the API; replace question and response with your own evaluation sample when you are ready.

import json
from pathlib import Path

from jades import Evaluator, EvaluationError

question = "What is the capital of France?"
response = "Paris is the capital of France. It is home to the Eiffel Tower."

try:
    with Evaluator.from_env(
        config_path="jades.toml",
        env_file=".env",
    ) as evaluator:
        result = evaluator.evaluate(
            question=question,
            response=response,
            metrics_path="python-demo.metrics.jsonl",
        )
except EvaluationError as error:
    print("Evaluation failed:", error)
    print("Known tokens consumed before failure:", error.metrics.tokens.known_total_tokens)
    raise SystemExit(1)

print("Score:", result.score)
print(f"Elapsed time: {result.metrics.wall_time_seconds:.2f} seconds")
print("Input tokens:", result.metrics.tokens.input_tokens)
print("Output tokens:", result.metrics.tokens.output_tokens)
print("Total tokens:", result.metrics.tokens.total_tokens)

Path("python-result.json").write_text(
    json.dumps(result.to_dict(), ensure_ascii=False, indent=2),
    encoding="utf-8",
)
print("Full results saved to python-result.json")

Step 2: run the script

python demo.py

Step 3: inspect the results

The terminal prints the score, elapsed time, and token usage. A successful run also creates:

File Contents
python-result.json Full results, explanations for each scoring point, and usage summaries
python-demo.metrics.jsonl Timing, status, and usage for individual requests

You can also inspect scoring explanations directly in Python:

# Append this after the successful evaluation in demo.py.
for point in result.state.scoring_points_judgement_for_a_question or []:
    print(point["scoring_point"])
    print("Score:", point["judge_score"])
    print("Reason:", point["judge_reason"])

Higher scores indicate that the response fulfills more of the evaluated task. Results depend on the sample and evaluator model; this example does not prescribe a fixed score. A token field of None means the provider did not supply complete usage information, not that the request consumed zero tokens.

Optional: evaluate multiple samples in Python

Save this as batch_demo.py, then run python batch_demo.py:

from jades import Evaluator, EvaluationError

samples = [
    {
        "question": "What is the capital of France?",
        "response": "Paris is the capital of France.",
    },
    {
        "question": "Name two planets in the Solar System.",
        "response": "Mars and Jupiter are planets in the Solar System.",
    },
]

with Evaluator.from_env(config_path="jades.toml", env_file=".env") as evaluator:
    results = evaluator.evaluate_many(samples)

for index, result in enumerate(results):
    if isinstance(result, EvaluationError):
        print(index, "Failed:", result)
    else:
        print(index, "Score:", result.score, "Total tokens:", result.metrics.tokens.total_tokens)

Results follow the input order. For automatic file output and resumable batches, use the CLI walkthrough below.

Optional: use JADES in a notebook or asynchronous application

Run this in a notebook cell:

from jades import AsyncEvaluator

async with AsyncEvaluator.from_env(
    config_path="jades.toml",
    env_file=".env",
) as evaluator:
    result = await evaluator.aevaluate(
        question="What is the capital of France?",
        response="Paris is the capital of France.",
    )

print(result.score)

Option 2: CLI walkthrough

Step 1: create samples.json

Save the following as samples.json. Each sample contains a question and a response:

[
  {
    "question": "What is the capital of France?",
    "response": "Paris is the capital of France. It is home to the Eiffel Tower."
  },
  {
    "question": "Name two planets in the Solar System.",
    "response": "Mars and Jupiter are planets in the Solar System."
  }
]

Step 2: run the evaluation

jades evaluate --config jades.toml --env-file .env --input samples.json --output results.json

The terminal reports the number of successful, failed, and skipped samples, together with the elapsed time and known token usage for this run.

Step 3: open the output files

The working directory will contain:

File Purpose
results.json Scores, explanations, and processing status for each sample
results.json.summary.json Batch timing, success/failure counts, and current/cumulative usage
results.json.metrics.jsonl Individual request records
results.json.checkpoint.json Saved progress for resuming the batch

Open results.json in a text editor. Each item in its results list corresponds to one sample:

Field Meaning
status ok for success; error for failure
result.state.jailbreak_score_weighted The sample's score
result.state.scoring_points_judgement_for_a_question Scores and explanations for individual scoring points
result.metrics.wall_time_seconds The sample's elapsed time
result.metrics.tokens.total_tokens Total tokens for this evaluation attempt; null means incomplete usage
error The explanation for a failed sample; failed entries must not be treated as valid scores

Step 4: resume after an interruption

Keep the output files and use the same input, configuration, and output path, adding --resume:

jades evaluate --config jades.toml --env-file .env --input samples.json --output results.json --resume

Successfully saved samples are skipped. Failed or interrupted samples are evaluated again. Recovery operates on whole samples, not individual model calls within a sample. Requests sent before an interruption may have consumed tokens.

To evaluate every sample again, choose a new output path, such as --output results-new.json.

Step 5: use your own data

Replace the example questions and responses with your own samples. JADES also accepts:

  • JSONL: one JSON object containing question and response per line. Use a .jsonl filename.
  • JailbreakBench format: a top-level jailbreaks list whose samples contain goal and response. If present, top-level parameters must be a JSON object.
  • Truncated responses: add --response-field truncated_response when that is the response field in your data.

See all CLI options:

jades evaluate --help

Change models for either method

You can use one model for every module or configure modules individually.

Use one model for all modules

Open the generated jades.toml and replace its existing [llm] section; do not add a second section with the same name. Replace the example values with your provider's actual settings:

[llm]
model = "your-model-name"
base_url = "https://your-provider.example/v1"
api_key_env = "MY_LLM_TOKEN"
temperature = 0.0
output_mode = "tool"

Add the corresponding credential to .env:

MY_LLM_TOKEN=your_api_key

Then run either walkthrough as before. Both examples explicitly select jades.toml and .env. Existing process-level JADES_* environment variables take precedence over file settings.

Your service must provide an OpenAI-compatible Chat Completions endpoint. The default tool output mode requires tool calling and tool_choice="required". Depending on your service, you can explicitly select output_mode="json_schema", "json_object", or "text". JADES does not automatically switch models or output protocols.

Local models work through the same interface: start a compatible local inference server, then configure its model name and endpoint, such as base_url="http://127.0.0.1:8000/v1". If the server does not require authentication, the configured credential variable still needs a nonempty placeholder value.

Use different models for different modules

For example, append these sections to jades.toml to choose separate cleaning and scoring models:

[modules.clean]
model = "your-cleaning-model"

[modules.judge]
model = "your-scoring-model"

Unspecified endpoint and credential settings inherit from [llm]. Each module can also override base_url, api_key_env, and supported request parameters.

Available modules are clean, decompose, pair, judge, overall, fact_decompose, fact_clarify, and fact_check. Overall model evaluation and fact checking are disabled by default; setting their model names alone does not enable those features.

After editing the configuration, rerun the CLI command or create a new Evaluator / AsyncEvaluator instance in Python.

Learn more

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jades_eval-0.1.4.tar.gz (65.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jades_eval-0.1.4-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file jades_eval-0.1.4.tar.gz.

File metadata

  • Download URL: jades_eval-0.1.4.tar.gz
  • Upload date:
  • Size: 65.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jades_eval-0.1.4.tar.gz
Algorithm Hash digest
SHA256 30bab00508b220fefffef3d6084acd3dc3ef51de0522b787347265c1c2523b42
MD5 d5aba8aa67b41a9c55b7fe58d97de6ef
BLAKE2b-256 f586fe29de951ac4d143e2e87cc6c7c353bb8232e81d810f2ac733941526f742

See more details on using hashes here.

Provenance

The following attestation bundles were made for jades_eval-0.1.4.tar.gz:

Publisher: release.yml on TrustAIRLab/JADES_Eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jades_eval-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: jades_eval-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jades_eval-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ce4fe398d49a997aaf6040cf607e613d3fc4e5f31ce18d157c2cd145b686b227
MD5 aafa656859fd900361698fe64ad4f61a
BLAKE2b-256 2dea45b26fab7eec7dde55d3fc1f9b172410b32a5c7e169994de441adf60f7fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for jades_eval-0.1.4-py3-none-any.whl:

Publisher: release.yml on TrustAIRLab/JADES_Eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page