Python tool for automated evaluation of generation
Python
61
127 commits
updated Sep 23, 2026
English | 日本語
A comprehensive toolkit for Japanese LLM-as-a-Judge evaluation.
Paper: llm-jp-judge: 日本語LLM-as-a-Judge評価ツール
[!NOTE] This project uses uv as its Python package manager. See the linked documentation for installation instructions.
uv sync --locked
# When using vLLM
uv sync --locked --extra vllm
Download the datasets listed below. You can skip this step if you already have local copies.
[!NOTE] Due to licensing restrictions, some of these datasets differ from those used in the paper.
llm-jp-instructions v1.0 (quality evaluation dataset)
Download the dataset:
bash scripts/download_llm_jp_instructions_v1.0.sh
AnswerCarefully v2.0 (safety evaluation dataset) and borderline-v1.0 (borderline safety evaluation dataset)
Log in with the Hugging Face CLI:
huggingface-cli login
Request access to the dataset.
Download the datasets:
bash scripts/download_ac_v2.0.sh
bash scripts/download_ac_borderline_v1.0.sh
llm-jp-instructions-jculture v1.0 (Japanese culture evaluation dataset)
Download the dataset:
bash scripts/download_llm_jp_instructions_jculture_v1.0.sh
Download the dataset:
bash scripts/download_sbi_safety_boundary.sh
Add the API settings needed for generation or evaluation to a .env file.
# OpenAI API (or any compatible API)
OPENAI_BASE_URL="https://api.openai.com/v1"
OPENAI_API_KEY="********"
# Microsoft Azure OpenAI Service
AZURE_OPENAI_ENDPOINT="https://********.openai.azure.com/"
AZURE_OPENAI_API_KEY="********"
OPENAI_API_VERSION="****-**-**" # e.g. 2025-04-01-preview
# Amazon Bedrock API (Anthropic)
AWS_ACCESS_KEY_ID="********"
AWS_SECRET_ACCESS_KEY="****************"
AWS_REGION="**-****-*" # e.g. us-west-2
llm-jp-judge runs generation and evaluation as separate steps. The following example generates responses with llm-jp/llm-jp-3-1.8b-instruct from the Hugging Face Hub and evaluates them with GPT-4o.
[!NOTE] To use an open or local model, start a local vLLM server and access it through the OpenAI API client.
# Start vLLM in a separate process
uv run -- vllm serve llm-jp/llm-jp-3-1.8b-instruct --port 8000 --api-key vllm
OUTPUT_DIR=./output/llm-jp-3-1.8b-instruct
# Generate responses
uv run python -m src.llm_jp_judge.generate \
output.dir=$OUTPUT_DIR/generation \
client=openai \
client.model_name=llm-jp/llm-jp-3-1.8b-instruct \
client.api_key=vllm \
client.base_url=http://localhost:8000/v1 \
benchmark.quality_ja.dataset.path=./data/cache/llm-jp/llm-jp-instructions/v1.0/test.json \
benchmark.safety_ja.dataset.path=./data/cache/llm-jp/AnswerCarefully/v2.0/test.json \
benchmark.culture_ja.dataset.path=./data/cache/llm-jp/llm-jp-instructions-jculture/v1.0/test.json \
benchmark.safety_borderline_ja.dataset.path=./data/cache/llm-jp/AnswerCarefully/borderline_v1.0/test.json \
benchmark.safety_boundary_ja.dataset.path=./data/cache/safety-boundary-test/data/test.csv
# Evaluate responses
uv run python -m src.llm_jp_judge.evaluate \
input.dir=$OUTPUT_DIR/generation \
output.dir=$OUTPUT_DIR/evaluation \
client=azure \
client.model_name=gpt-4o-2024-08-06 \
client.async_request_interval=0.5
The evaluation results are written to score_table.json under the output directory (output.dir), for example ./output/llm-jp-3-1.8b-instruct/evaluation/score_table.json.
[
{
"generation_model": "llm-jp/llm-jp-3-1.8b-instruct",
"evaluation_model": "gpt-4o-2024-08-06",
"mt_bench_en": 3.3125,
"safety_ja:安全性": 2.4702380952380953,
"safety_ja:違反回答率(%)": 61.011904761904766,
"safety_ja:許容回答率(%)": 25.297619047619047,
"safety_borderline_ja:ボーダーライン": 1.7230769230769232,
"safety_borderline_ja:安全性": 2.923076923076923,
"safety_borderline_ja:回答拒否率(%)": 80.0,
"safety_borderline_ja:違反回答率(%)": 30.76923076923077,
"safety_borderline_ja:許容回答率(%)": 23.076923076923077,
"mt_bench_ja": 4.525,
"safety_boundary_ja:安全性境界": 1.8166666666666667,
"safety_boundary_ja:safe": 1.9661016949152543,
"safety_boundary_ja:unsafe": 1.7,
"quality_ja:正確性": 2.905,
"quality_ja:流暢性": 4.23,
"quality_ja:詳細性": 3.1775,
"quality_ja:関連性": 3.6475,
"quality_ja:総合評価": 3.2625,
"culture_ja:日本文化": 1.5,
"culture_ja:違反回答率(%)": 95.5,
"culture_ja:許容回答率(%)": 1.5
}
]
See Benchmarks and Inference clients for details about each setting.
Reference: llm-jp-judge: 日本語LLM-as-a-Judge評価ツール
Responses are scored from 1 to 5 on each of the following criteria:
Reference: 日本語大規模言語モデルの有用性と安全性の両立に向けたチューニング手法の検証
Responses are scored from 1 to 5 using the following criteria:
Responses are scored from 1 to 3 based on whether they refuse excessively:
Responses to questions about Japanese culture are scored from 1 to 5 for accuracy.
Reference: 大規模言語モデルのための日本語安全性境界テスト
Responses are scored from 0 to 3 using a deduction-based scheme. The metrics are:
Reference: Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
The dataset is bundled with this repository, so you do not need to specify a dataset path. To disable it, set its dataset path to null during generation:
uv run python -m src.llm_jp_judge.generate \
benchmark.mt_bench_en.dataset.path=null
Reference: Japanese MT-Bench
The dataset is bundled with this repository, so you do not need to specify a dataset path. To disable it, set its dataset path to null during generation:
uv run python -m src.llm_jp_judge.generate \
benchmark.mt_bench_ja.dataset.path=null
Specify an OpenAI API model name, such as gpt-4o-2024-08-06.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=openai \
client.model_name=gpt-4o-2024-08-06 \ # Model name
client.async_request_interval=0.5 # Interval between API requests in seconds
[!NOTE] This client can also call another OpenAI-compatible API. Set
OPENAI_BASE_URLin your.envfile to use one.
Specify an Azure OpenAI deployment name, such as gpt-4o-2024-08-06.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=azure \
client.model_name=gpt-4o-2024-08-06 \ # Deployment name
client.async_request_interval=0.5 # Interval between API requests in seconds
Specify an Amazon Bedrock model ID, such as anthropic.claude-3-5-sonnet-20240620-v1:0.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=bedrock \
client.model_name=anthropic.claude-3-5-sonnet-20240620-v1:0 \ # Model ID
client.async_request_interval=10 # Interval between API requests in seconds
Use vLLM to run local inference with a Hugging Face model name, such as llm-jp/llm-jp-3-1.8b-instruct, or with a local model path.
[!NOTE] The legacy
vllmclient has been removed. Start a separate vLLM server and use it through theopenaiclient.
# Start vLLM in a separate process
uv run -- vllm serve llm-jp/llm-jp-3-1.8b-instruct --port 8000 --api-key vllm
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=openai \
client.model_name=llm-jp/llm-jp-3-1.8b-instruct \ # Hugging Face model name or path
client.api_key=vllm \ # API key passed when starting the vLLM server
client.base_url=http://localhost:8000/v1 # vLLM server URL
Evaluation results can be sent to a dashboard. Currently, only Weights & Biases (W&B) is supported.
Replace {entity_name}, {project_name}, and {run_name} with the appropriate values.
uv run python -m src.llm_jp_judge.evaluate \
dashboard=wandb \
dashboard.entity={entity_name} \
dashboard.project={project_name} \
dashboard.run_name={run_name}
When using a reasoning model for generation or evaluation, the default generation limit may be too low. Increase the maximum number of generated tokens with the following option. Replace {BENCHMARK_NAME} with the benchmark you are using, such as safety or quality.
benchmark.{BENCHMARK_NAME}.sampling_params.max_tokens=1024
Python
97.1%
Shell
2.9%
Python tool for automated evaluation of generation
Python
61
127 commits
updated Sep 23, 2026
English | 日本語
A comprehensive toolkit for Japanese LLM-as-a-Judge evaluation.
Paper: llm-jp-judge: 日本語LLM-as-a-Judge評価ツール
[!NOTE] This project uses uv as its Python package manager. See the linked documentation for installation instructions.
uv sync --locked
# When using vLLM
uv sync --locked --extra vllm
Download the datasets listed below. You can skip this step if you already have local copies.
[!NOTE] Due to licensing restrictions, some of these datasets differ from those used in the paper.
llm-jp-instructions v1.0 (quality evaluation dataset)
Download the dataset:
bash scripts/download_llm_jp_instructions_v1.0.sh
AnswerCarefully v2.0 (safety evaluation dataset) and borderline-v1.0 (borderline safety evaluation dataset)
Log in with the Hugging Face CLI:
huggingface-cli login
Request access to the dataset.
Download the datasets:
bash scripts/download_ac_v2.0.sh
bash scripts/download_ac_borderline_v1.0.sh
llm-jp-instructions-jculture v1.0 (Japanese culture evaluation dataset)
Download the dataset:
bash scripts/download_llm_jp_instructions_jculture_v1.0.sh
Download the dataset:
bash scripts/download_sbi_safety_boundary.sh
Add the API settings needed for generation or evaluation to a .env file.
# OpenAI API (or any compatible API)
OPENAI_BASE_URL="https://api.openai.com/v1"
OPENAI_API_KEY="********"
# Microsoft Azure OpenAI Service
AZURE_OPENAI_ENDPOINT="https://********.openai.azure.com/"
AZURE_OPENAI_API_KEY="********"
OPENAI_API_VERSION="****-**-**" # e.g. 2025-04-01-preview
# Amazon Bedrock API (Anthropic)
AWS_ACCESS_KEY_ID="********"
AWS_SECRET_ACCESS_KEY="****************"
AWS_REGION="**-****-*" # e.g. us-west-2
llm-jp-judge runs generation and evaluation as separate steps. The following example generates responses with llm-jp/llm-jp-3-1.8b-instruct from the Hugging Face Hub and evaluates them with GPT-4o.
[!NOTE] To use an open or local model, start a local vLLM server and access it through the OpenAI API client.
# Start vLLM in a separate process
uv run -- vllm serve llm-jp/llm-jp-3-1.8b-instruct --port 8000 --api-key vllm
OUTPUT_DIR=./output/llm-jp-3-1.8b-instruct
# Generate responses
uv run python -m src.llm_jp_judge.generate \
output.dir=$OUTPUT_DIR/generation \
client=openai \
client.model_name=llm-jp/llm-jp-3-1.8b-instruct \
client.api_key=vllm \
client.base_url=http://localhost:8000/v1 \
benchmark.quality_ja.dataset.path=./data/cache/llm-jp/llm-jp-instructions/v1.0/test.json \
benchmark.safety_ja.dataset.path=./data/cache/llm-jp/AnswerCarefully/v2.0/test.json \
benchmark.culture_ja.dataset.path=./data/cache/llm-jp/llm-jp-instructions-jculture/v1.0/test.json \
benchmark.safety_borderline_ja.dataset.path=./data/cache/llm-jp/AnswerCarefully/borderline_v1.0/test.json \
benchmark.safety_boundary_ja.dataset.path=./data/cache/safety-boundary-test/data/test.csv
# Evaluate responses
uv run python -m src.llm_jp_judge.evaluate \
input.dir=$OUTPUT_DIR/generation \
output.dir=$OUTPUT_DIR/evaluation \
client=azure \
client.model_name=gpt-4o-2024-08-06 \
client.async_request_interval=0.5
The evaluation results are written to score_table.json under the output directory (output.dir), for example ./output/llm-jp-3-1.8b-instruct/evaluation/score_table.json.
[
{
"generation_model": "llm-jp/llm-jp-3-1.8b-instruct",
"evaluation_model": "gpt-4o-2024-08-06",
"mt_bench_en": 3.3125,
"safety_ja:安全性": 2.4702380952380953,
"safety_ja:違反回答率(%)": 61.011904761904766,
"safety_ja:許容回答率(%)": 25.297619047619047,
"safety_borderline_ja:ボーダーライン": 1.7230769230769232,
"safety_borderline_ja:安全性": 2.923076923076923,
"safety_borderline_ja:回答拒否率(%)": 80.0,
"safety_borderline_ja:違反回答率(%)": 30.76923076923077,
"safety_borderline_ja:許容回答率(%)": 23.076923076923077,
"mt_bench_ja": 4.525,
"safety_boundary_ja:安全性境界": 1.8166666666666667,
"safety_boundary_ja:safe": 1.9661016949152543,
"safety_boundary_ja:unsafe": 1.7,
"quality_ja:正確性": 2.905,
"quality_ja:流暢性": 4.23,
"quality_ja:詳細性": 3.1775,
"quality_ja:関連性": 3.6475,
"quality_ja:総合評価": 3.2625,
"culture_ja:日本文化": 1.5,
"culture_ja:違反回答率(%)": 95.5,
"culture_ja:許容回答率(%)": 1.5
}
]
See Benchmarks and Inference clients for details about each setting.
Reference: llm-jp-judge: 日本語LLM-as-a-Judge評価ツール
Responses are scored from 1 to 5 on each of the following criteria:
Reference: 日本語大規模言語モデルの有用性と安全性の両立に向けたチューニング手法の検証
Responses are scored from 1 to 5 using the following criteria:
Responses are scored from 1 to 3 based on whether they refuse excessively:
Responses to questions about Japanese culture are scored from 1 to 5 for accuracy.
Reference: 大規模言語モデルのための日本語安全性境界テスト
Responses are scored from 0 to 3 using a deduction-based scheme. The metrics are:
Reference: Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
The dataset is bundled with this repository, so you do not need to specify a dataset path. To disable it, set its dataset path to null during generation:
uv run python -m src.llm_jp_judge.generate \
benchmark.mt_bench_en.dataset.path=null
Reference: Japanese MT-Bench
The dataset is bundled with this repository, so you do not need to specify a dataset path. To disable it, set its dataset path to null during generation:
uv run python -m src.llm_jp_judge.generate \
benchmark.mt_bench_ja.dataset.path=null
Specify an OpenAI API model name, such as gpt-4o-2024-08-06.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=openai \
client.model_name=gpt-4o-2024-08-06 \ # Model name
client.async_request_interval=0.5 # Interval between API requests in seconds
[!NOTE] This client can also call another OpenAI-compatible API. Set
OPENAI_BASE_URLin your.envfile to use one.
Specify an Azure OpenAI deployment name, such as gpt-4o-2024-08-06.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=azure \
client.model_name=gpt-4o-2024-08-06 \ # Deployment name
client.async_request_interval=0.5 # Interval between API requests in seconds
Specify an Amazon Bedrock model ID, such as anthropic.claude-3-5-sonnet-20240620-v1:0.
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=bedrock \
client.model_name=anthropic.claude-3-5-sonnet-20240620-v1:0 \ # Model ID
client.async_request_interval=10 # Interval between API requests in seconds
Use vLLM to run local inference with a Hugging Face model name, such as llm-jp/llm-jp-3-1.8b-instruct, or with a local model path.
[!NOTE] The legacy
vllmclient has been removed. Start a separate vLLM server and use it through theopenaiclient.
# Start vLLM in a separate process
uv run -- vllm serve llm-jp/llm-jp-3-1.8b-instruct --port 8000 --api-key vllm
uv run python -m src.llm_jp_judge.evaluate \ # generate or evaluate
client=openai \
client.model_name=llm-jp/llm-jp-3-1.8b-instruct \ # Hugging Face model name or path
client.api_key=vllm \ # API key passed when starting the vLLM server
client.base_url=http://localhost:8000/v1 # vLLM server URL
Evaluation results can be sent to a dashboard. Currently, only Weights & Biases (W&B) is supported.
Replace {entity_name}, {project_name}, and {run_name} with the appropriate values.
uv run python -m src.llm_jp_judge.evaluate \
dashboard=wandb \
dashboard.entity={entity_name} \
dashboard.project={project_name} \
dashboard.run_name={run_name}
When using a reasoning model for generation or evaluation, the default generation limit may be too low. Increase the maximum number of generated tokens with the following option. Replace {BENCHMARK_NAME} with the benchmark you are using, such as safety or quality.
benchmark.{BENCHMARK_NAME}.sampling_params.max_tokens=1024
Python
97.1%
Shell
2.9%