NVIDIA
NVIDIA
NVIDIA LM-Evaluation-Harness
Container
NVIDIA
NVIDIA
NVIDIA LM-Evaluation-Harness

NVIDIA NeMo Evaluator-compatible container with LM-Evaluation-Harness support. Based on lm-evaluation-harness available at: https://github.com/EleutherAI/lm-evaluation-harness

NVIDIA NeMo Evaluator

The goal of NVIDIA NeMo Evaluator is to advance and refine state-of-the-art methodologies for model evaluation, and deliver them as modular evaluation packages (evaluation containers and pip wheels) that teams can use as standardized building blocks.

Quick start guide: Evaluation containers

NVIDIA NeMo Evaluator containers provide you with evaluation clients, that are specifically built to evaluate model endpoints using our Standard API.

Prerequisites

  1. Ensure docker is installed and running on the machine where you want to run the evaluation.
  2. Verify you have access to NVIDIA NeMo Evaluator container registry.
  3. Deploy your model as an endpoint with an API compatible with OpenAI or NIM.

Launching an evaluation for an LLM

List the available evaluations:

$ nemo-evaluator ls
lm-evaluation-harness:
  * adlr_agieval_en_cot
  * adlr_arc_challenge_llama_25_shot
  * adlr_commonsense_qa_7_shot
  * adlr_global_mmlu_lite_5_shot
  * adlr_gpqa_diamond_cot_5_shot
  * adlr_gsm8k_cot_8_shot
  * adlr_humaneval_greedy
  * adlr_humaneval_sampled
  * adlr_math_500_4_shot_sampled
  * adlr_mbpp_sanitized_3_shot_greedy
  * adlr_mbpp_sanitized_3_shot_sampled
  * adlr_mgsm_native_cot_8_shot
  * adlr_minerva_math_nemo_4_shot
  * adlr_mmlu
  * adlr_mmlu_pro_5_shot_base
  * adlr_race
  * adlr_truthfulqa_mc2
  * adlr_winogrande_5_shot
  * agieval
  * arc_challenge
  * arc_challenge_chat
  * arc_multilingual
  * bbh
  * bbh_instruct
  * bbq_chat
  * bbq_completions
  * commonsense_qa
  * global_mmlu
  * global_mmlu_ar
  * global_mmlu_bn
  * global_mmlu_de
  * global_mmlu_en
  * global_mmlu_es
  * global_mmlu_fr
  * global_mmlu_full
  * global_mmlu_full_am
  * global_mmlu_full_ar
  * global_mmlu_full_bn
  * global_mmlu_full_cs
  * global_mmlu_full_de
  * global_mmlu_full_el
  * global_mmlu_full_en
  * global_mmlu_full_es
  * global_mmlu_full_fa
  * global_mmlu_full_fil
  * global_mmlu_full_fr
  * global_mmlu_full_ha
  * global_mmlu_full_he
  * global_mmlu_full_hi
  * global_mmlu_full_id
  * global_mmlu_full_ig
  * global_mmlu_full_it
  * global_mmlu_full_ja
  * global_mmlu_full_ko
  * global_mmlu_full_ky
  * global_mmlu_full_lt
  * global_mmlu_full_mg
  * global_mmlu_full_ms
  * global_mmlu_full_ne
  * global_mmlu_full_nl
  * global_mmlu_full_ny
  * global_mmlu_full_pl
  * global_mmlu_full_pt
  * global_mmlu_full_ro
  * global_mmlu_full_ru
  * global_mmlu_full_si
  * global_mmlu_full_sn
  * global_mmlu_full_so
  * global_mmlu_full_sr
  * global_mmlu_full_sv
  * global_mmlu_full_sw
  * global_mmlu_full_te
  * global_mmlu_full_tr
  * global_mmlu_full_uk
  * global_mmlu_full_vi
  * global_mmlu_full_yo
  * global_mmlu_full_zh
  * global_mmlu_hi
  * global_mmlu_id
  * global_mmlu_it
  * global_mmlu_ja
  * global_mmlu_ko
  * global_mmlu_pt
  * global_mmlu_sw
  * global_mmlu_yo
  * global_mmlu_zh
  * gpqa
  * gpqa_diamond_cot
  * gsm8k
  * gsm8k_cot_instruct
  * gsm8k_cot_llama
  * gsm8k_cot_zeroshot
  * gsm8k_cot_zeroshot_llama
  * hellaswag
  * hellaswag_multilingual
  * humaneval_instruct
  * ifeval
  * m_mmlu_id_str_chat
  * m_mmlu_id_str_completions
  * mbpp_plus_chat
  * mbpp_plus_completions
  * mgsm
  * mgsm_cot_chat
  * mgsm_cot_completions
  * mmlu
  * mmlu_cot_0_shot_chat
  * mmlu_instruct
  * mmlu_instruct_completions
  * mmlu_logits
  * mmlu_pro
  * mmlu_pro_instruct
  * mmlu_prox_chat
  * mmlu_prox_completions
  * mmlu_prox_de_chat
  * mmlu_prox_de_completions
  * mmlu_prox_es_chat
  * mmlu_prox_es_completions
  * mmlu_prox_fr_chat
  * mmlu_prox_fr_completions
  * mmlu_prox_it_chat
  * mmlu_prox_it_completions
  * mmlu_prox_ja_chat
  * mmlu_prox_ja_completions
  * mmlu_redux
  * mmlu_redux_instruct
  * musr
  * openbookqa
  * piqa
  * social_iqa
  * truthfulqa
  * wikilingua
  * wikitext
  * winogrande
  1. Pull the LLM evaluation container image
  2. Run the container
  3. (Optional) Set a token to your API endpoint if it's protected
export MY_API_KEY="your_api_key_here"

Run the evaluation of your choice:

nemo-evaluator run_eval \
    --eval_type mmlu_pro \
    --model_id meta/llama-3.1-70b-instruct \
    --model_url https://integrate.api.nvidia.com/v1/chat/completions \
    --model_type chat \
    --api_key_name MY_API_KEY \
    --output_dir /workspace/results

Gather the results:

cat /workspace/results/results.yml

Command-Line Tool

Each container comes pre-installed with a set of command-line tools, designed to simplify the execution of evaluation tasks. Below are the available commands and their usage for the lm_eval (lm-evaluation-harness):

Commands

1. List Evaluation Types

nemo-evaluator ls

Displays the evaluation types available within the harness.

2. Run an evaluation

The nemo-evaluator run_eval command executes the evaluation process. Below are the flags and their descriptions:

Required flags

  • --eval_type <string>
    The type of evaluation to perform
  • --model_id <string>
    The name or identifier of the model to evaluate.
  • --model_url <url>
    The API endpoint where the model is accessible.
  • --model_type <string>
    The type of the model to evaluate, currently either "chat", "completions", or "vlm".
  • --output_dir <directory>
    The directory to use as the working directory for the evaluation. The results, including the results.yml output file, will be saved here.

Optional flags

  • --api_key_name <string>
    The name of the environment variable that stores the Bearer token for the API, if authentication is required.
  • --run_config <path>
    Specifies the path to a YAML file containing the evaluation definition.

Example

nemo-evaluator run_eval \
    --eval_type ifeval \
    --model_id my_model \
    --model_type chat \
    --model_url http://localhost:8000 \
    --output_dir ./evaluation_results

If the model API requires authentication, set the API key in an environment variable and reference it using the --api_key_name flag:

export MY_API_KEY="your_api_key_here"

nemo-evaluator run_eval \
    --eval_type ifeval \
    --model_id my_model \
    --model_type chat \
    --model_url http://localhost:8000 \
    --api_key_name MY_API_KEY \
    --output_dir ./evaluation_results

Configuring evaluations via YAML

Evaluations in NVIDIA NeMo Evaluator are configured using YAML files that define the parameters and settings required for the evaluation process. These configuration files follow a standard API which ensures consistency across evaluations.

Example of a YAML config:

config:
  type: ifeval
  params:
    parallelism: 50
    limit_samples: 20
target:
  api_endpoint:
    model_id: meta/llama-3.1-8b-instruct
    type: chat
    url: https://integrate.api.nvidia.com/v1/chat/completions
    api_key: NVIDIA_API_KEY

The priority of overrides is as follows:

  1. command line arguments
  2. user config (as seen above)
  3. task defaults (defined per task type)
  4. framework defaults

--dry_run option allows you to print the final run configuration and command without executing the evaluation.

Example:

nemo-evaluator run_eval \
    --eval_type mmlu_pro_instruct \
    --model_id my_model \
    --model_type chat \
    --model_url http://localhost:8000 \
    --output_dir .evaluation_results \
    --dry_run

Output:

Rendered config:

command: '{% if target.api_endpoint.api_key is not none %}OPENAI_API_KEY=${{target.api_endpoint.api_key}}{%
  endif %} lm-eval --tasks {{config.params.task}}{% if config.params.extra.num_fewshot
  is defined %} --num_fewshot {{ config.params.extra.num_fewshot }}{% endif %} --model
  {% if target.api_endpoint.type == "completions" %}local-completions{% elif target.api_endpoint.type
  == "chat" %}local-chat-completions{% endif %} --model_args "base_url={{target.api_endpoint.url}},model={{target.api_endpoint.model_id}},tokenized_requests=false,{%
  if target.api_endpoint.type == "completions" %}tokenizer={{config.params.extra.tokenizer}}{%
  endif %},num_concurrent={{config.params.parallelism}}{% if config.params.max_new_tokens
  is not none %},max_gen_toks={{ config.params.max_new_tokens }}{% endif %},timeout={{
  config.params.timeout }},max_retries={{ config.params.max_retries }},stream={{ target.api_endpoint.stream
  }}" --log_samples --output_path {{config.output_dir}} --use_cache {{config.output_dir}}/lm_cache
  {% if config.params.limit_samples is not none %}--limit {{config.params.limit_samples}}{%
  endif %} {% if target.api_endpoint.type == "chat" %}--fewshot_as_multiturn --apply_chat_template
  {% endif %} {% if config.params.extra.args is defined %} {{config.params.extra.args}}
  {% endif %} {% if config.params.temperature is not none or config.params.top_p is
  not none %}--gen_kwargs="{% if config.params.temperature is not none %}temperature={{
  config.params.temperature }},{% endif %}{% if config.params.top_p is not none %}top_p={{
  config.params.top_p}}{% endif %}"{% endif %}'
framework_name: lm-evaluation-harness
pkg_name: lm_eval
config:
  output_dir: .evaluation_results
  params:
    limit_samples: null
    max_new_tokens: 1024
    max_retries: 5
    parallelism: 10
    task: mmlu_pro
    temperature: 1.0e-07
    timeout: 30
    top_p: 0.9999999
    extra:
      tokenizer: meta-llama/Llama-3.1-70B-Instruct
      num_fewshot: 0
  supported_endpoint_types:
  - chat
  type: mmlu_pro_instruct
target:
  api_endpoint:
    api_key: null
    model_id: my_model
    stream: false
    type: chat
    url: http://localhost:8000


Rendered command:

 lm-eval --tasks mmlu_pro --num_fewshot 0 --model local-chat-completions --model_args "base_url=http://localhost:8000,model=my_model,tokenized_requests=false,,num_concurrent=10,max_gen_toks=1024,timeout=30,max_retries=5,stream=False" --log_samples --output_path .evaluation_results --use_cache .evaluation_results/lm_cache  --fewshot_as_multiturn --apply_chat_template   --gen_kwargs="temperature=1e-07,top_p=0.9999999"

FAQ

Deploying a model as an endpoint

NVIDIA NeMo Evaluator containers utilize a client-server communication architecture to interact with the model. As a prerequisite, the model must be deployed as an endpoint with a NIM-compatible API.

Users have the flexibility to deploy their model using their own infrastructure and tooling.

Servers with APIs that conform to the OpenAI/NIM API standard are expected to work seamlessly out of the box.

3rd Party Source Code

Users can download the third party source code through the URL provided in the container's README located in workdir.

Publisher
NVIDIA
NVIDIA
Latest Taglatest
UpdatedMarch 15, 2026 UTC
Compressed Size600.79 MB
Multinode SupportNo
Multi-Arch SupportYes