NVIDIA NeMo Evaluator-compatible container with SciCode support. Based on the SciCode available at: https://github.com/scicode-bench/SciCode
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
NVIDIA NeMo Evaluator provide you with evaluation clients, that are specifically built to evaluate model endpoints using our Standard API.
Launching an evaluation for an LLM
List the available evaluations:
$ nemo-evaluator ls
scicode:
* scicode
* scicode_aa_v2
* scicode_background
Run the evaluation of your choice:
nemo-evaluator run_eval \
--eval_type aa_scicode \
--model_id meta/llama-3.1-8b-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 package 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 ifbench:
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 aa_scicode \
--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 aa_scicode \
--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: aa_scicode
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:
- command line arguments
- user config (as seen above)
- task defaults (defined per task type)
- 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 aa_scicode \
--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 %}API_KEY=${{target.api_endpoint.api_key}}{%
endif %} scicode_eval --model {{target.api_endpoint.model_id}} --url {{target.api_endpoint.url}}
--output-dir {{config.output_dir}} --log-dir {{config.output_dir}}/logs {% if config.params.temperature
is not none %}--temperature={{config.params.temperature}}{% endif %} {% if config.params.limit_samples
is not none %}--limit-samples={{config.params.limit_samples}}{% endif %} --n-samples={{config.params.extra.n_samples}}
--extra-params top_p={{config.params.top_p}},timeout={{config.params.request_timeout}},max_tokens={{config.params.max_new_tokens}},max_retries={{config.params.max_retries}}
{% if config.params.extra.with_background %}--with-background {% endif %} {% if
config.params.extra.include_dev %}--include-dev{% endif %} {% if config.params.extra.eval_threads
is not none %}--eval-threads={{config.params.extra.eval_threads}}{% endif %}'
framework_name: scicode
pkg_name: scicode
config:
output_dir: ./evaluation_results
params:
limit_samples: null
max_new_tokens: 4096
max_retries: 2
parallelism: null
task: null
temperature: 0.0
request_timeout: 60
top_p: 1.0e-05
extra:
with_background: true
include_dev: true
n_samples: 3
eval_threads: null
supported_endpoint_types:
- chat
type: aa_scicode
target:
api_endpoint:
api_key: null
model_id: my_model
stream: false
type: chat
url: http://localhost:8000
adapter_config: null
Rendered command:
scicode_eval --model my_model --url http://localhost:8000 --output-dir ./evaluation_results --log-dir ./evaluation_results/logs --temperature=0.0 --n-samples=3 --extra-params top_p=1e-05,timeout=60,max_tokens=4096,max_retries=2 --with-background --include-dev
FAQ
Deploying a model as an endpoint
NVIDIA NeMo Evaluator 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.