API Reference
Core Types
SeedResult
Returned by EvalEnvironment.seed().
| Field | Type | Description |
|---|---|---|
prompt | str | The prompt to send to the model |
expected_answer | str | Ground-truth answer for verification |
metadata | dict[str, Any] | Arbitrary metadata (category, difficulty, aliases) |
VerifyResult
Returned by EvalEnvironment.verify().
| Field | Type | Description |
|---|---|---|
reward | float | Score (0.0 = wrong, 1.0 = correct) |
extracted_answer | str | None | What was extracted from the model response |
scoring_details | dict[str, Any] | Method used, intermediate values |
metadata | dict[str, Any] | Additional verification metadata |
EvalEnvironment
Abstract base class for all benchmarks.
1 from nemo_evaluator.environments import EvalEnvironment, SeedResult, VerifyResult, register 2 3 @register("my_benchmark") 4 class MyBenchmark(EvalEnvironment): 5 def __init__(self): 6 super().__init__() 7 self._dataset = [...] 8 9 def __len__(self) -> int: 10 return len(self._dataset) 11 12 async def seed(self, idx: int) -> SeedResult: 13 ... 14 15 async def verify(self, response: str, expected: str, **metadata) -> VerifyResult: 16 ...
Runner
ModelClient
Async client for OpenAI-compatible endpoints.
| Parameter | Type | Default | Description |
|---|---|---|---|
base_url | str | https://inference-api.nvidia.com/v1 | API base URL |
model | str | azure/openai/gpt-5.2 | Model identifier |
api_key | str | None | None (uses NEMO_API_KEY) | API key |
temperature | float | None | None | Sampling temperature (0.0-2.0) |
max_tokens | int | None | None | Max completion tokens |
top_p | float | None | None | Nucleus sampling threshold (0.0-1.0) |
seed | int | None | None | RNG seed for reproducibility |
stop | list[str] | None | None | Stop sequences |
frequency_penalty | float | None | None | Frequency penalty (-2.0 to 2.0) |
presence_penalty | float | None | None | Presence penalty (-2.0 to 2.0) |
timeout | float | 120.0 | Request timeout in seconds |
max_concurrent | int | 8 | Max parallel requests |
1 from nemo_evaluator.engine import ModelClient 2 3 client = ModelClient( 4 base_url="https://inference-api.nvidia.com/v1", 5 model="azure/openai/gpt-5.2", 6 api_key="sk-...", 7 max_concurrent=16, 8 ) 9 response = await client.chat("What is 2+2?", system="Answer briefly.")
run_evaluation()
Core evaluation loop.
1 async def run_evaluation( 2 env: EvalEnvironment, 3 solver: Solver, 4 n_repeats: int = 1, 5 max_problems: int | None = None, 6 config: dict[str, Any] | None = None, 7 progress: ProgressTracker | None = None, 8 problem_range: tuple[int, int] | None = None, 9 max_concurrent: int = 32, 10 judge_client: Any = None, 11 shard_info: tuple[int, int] | None = None, 12 ) -> dict[str, Any]:
| Parameter | Description |
|---|---|
env | EvalEnvironment instance |
solver | Solver instance (e.g. ChatSolver, HarborSolver, GymSolver) |
n_repeats | Number of times to evaluate each problem |
max_problems | Limit to first N problems |
config | Metadata included in the output bundle |
progress | Progress tracker (default: no-op) |
problem_range | (start, end) for sharded execution |
max_concurrent | Max parallel solve tasks (default: 32) |
judge_client | Optional ModelClient for LLM-as-judge post-processing |
shard_info | (shard_idx, total_shards) — auto-computes problem_range if not set |
Returns a bundle dict containing metrics, results, config, and artifacts.
write_all()
Write all artifacts to disk.
1 from nemo_evaluator.engine import write_all 2 3 write_all(bundle, "./eval_results")
Writes: eval-*.json (bundle), results.jsonl, trajectories.jsonl, runtime_stats.json, failure_analysis.json.
compare_runs()
Compare two evaluation bundles for regression.
1 from nemo_evaluator.engine import compare_runs 2 3 report = compare_runs("baseline/eval-*.json", "candidate/eval-*.json")
Environment Integrations
GymEnvironment
HTTP client for consuming nel serve endpoints or Gym resource servers.
1 from nemo_evaluator.environments.gym import GymEnvironment 2 from nemo_evaluator.solvers import ChatSolver 3 4 env = GymEnvironment("http://localhost:9090") 5 solver = ChatSolver(client) 6 bundle = await run_evaluation(env, solver, n_repeats=4)
SkillsEnvironment
Wraps any NeMo Skills benchmark as an EvalEnvironment.
1 from nemo_evaluator.environments.skills import SkillsEnvironment 2 3 env = SkillsEnvironment("gpqa") 4 solver = ChatSolver(client) 5 bundle = await run_evaluation(env, solver, n_repeats=4)
| Parameter | Type | Default | Description |
|---|---|---|---|
benchmark | str | required | Skills benchmark name (e.g., gpqa, aime24) |
split | str | None | None | Dataset split (default from benchmark config) |
data_dir | str | None | None | Override data directory |
prompt_template | str | None | None | Custom prompt template with {problem} placeholder |
eval_type | str | None | None | Override scoring type (default from benchmark config) |
VLMEvalKitEnvironment
Wraps VLMEvalKit datasets as an EvalEnvironment. Supports MCQ, VQA, and Y/N dataset types.
1 from nemo_evaluator.environments.vlmevalkit import VLMEvalKitEnvironment 2 3 env = VLMEvalKitEnvironment("MMBench_DEV_EN") 4 solver = VLMSolver(client) 5 bundle = await run_evaluation(env, solver, n_repeats=1)
generate_app()
Serve an EvalEnvironment as a Gym-compatible HTTP endpoint.
1 from nemo_evaluator.serving.app import generate_app 2 3 app = generate_app(env, gym_compat=True) 4 # Use with uvicorn: uvicorn.run(app, port=9090)
Observability
ModelResponse
| Field | Type | Description |
|---|---|---|
content | str | Model output text |
model | str | Model identifier |
finish_reason | str | stop, length, etc. |
prompt_tokens | int | Input tokens |
completion_tokens | int | Output tokens |
total_tokens | int | Total tokens |
reasoning_tokens | int | Reasoning tokens (if available) |
latency_ms | float | Request latency |
raw_response | dict | Full API response |
StepRecord
Complete record for one seed → model → verify cycle.
| Field | Type | Description |
|---|---|---|
problem_idx | int | Problem index |
repeat | int | Repeat index |
prompt | str | The prompt sent |
expected_answer | str | Ground truth |
model_response | ModelResponse | None | Full model response |
reward | float | Verification score |
extracted_answer | str | None | Extracted from response |
scoring_method | str | Method used for scoring |
scoring_details | dict | Scoring intermediaries |
seed_ms | float | Time to seed |
model_ms | float | Time for model call |
verify_ms | float | Time to verify |
total_ms | float | Total step time |
model_error | str | None | Error if model call failed |
CLI Commands
| Command | Description |
|---|---|
nel eval run | Run evaluation (benchmark name or YAML config) |
nel eval report | Generate evaluation report |
nel eval merge | Merge sharded evaluation results |
nel serve | Start HTTP server for an environment |
nel validate | Quick validation of a benchmark |
nel list | Show available benchmarks and environments |
nel export | Export bundles to a registered exporter |
nel cache-sqsh | Build a SLURM .sqsh cache image |
nel report | Generate a multi-benchmark report |
nel compare | Compare two evaluation bundles |
nel gate | Apply a multi-benchmark gate policy |
nel config | Persistent user config |
nel package | Containerize BYOB benchmark |
nel eval run
nel eval run [CONFIG_FILE] --bench, -b TEXT Benchmark name --repeats, -n INT Repeats per problem [1] --max-problems INT Limit problem count --model-url TEXT Model API base URL --model-id TEXT Model identifier --api-key TEXT Model API key --system-prompt TEXT System prompt --temperature FLOAT Sampling temperature --max-tokens INT Maximum generated tokens --output-dir, -o TEXT Output directory [./eval_results] --dry-run Generate scripts without running --submit Submit to cluster via SSH --background Run locally in background --resume Resume partially completed suite -O, --override TEXT Dot-path config overrides (e.g. services.model.model=foo) --verbose, -v Enable verbose logging
nel serve
nel serve --bench, -b TEXT Benchmark to serve --port INT Port [9090] --host TEXT Host [0.0.0.0] --gym-compat Enable Gym-compatible endpoints --export-data TEXT Export JSONL to path and exit
nel validate
nel validate --benchmark, -b TEXT Benchmark to validate --samples, -s INT Number of samples [5] --model-url TEXT Model endpoint URL --model-id TEXT Model identifier --api-key TEXT Model API key --verbose, -v Enable verbose logging
nel list
nel list --source TEXT Filter by source (e.g., lm-eval)
nel eval report
nel eval report RESULTS_DIR --format, -f TEXT Output format (markdown, html, csv, json, latex) --output, -o TEXT Output report path --all-formats Generate all formats
nel eval merge
nel eval merge OUTPUT_DIR --repeats, -n INT Override n_repeats (auto-detected if omitted)
nel compare
nel compare BASELINE CANDIDATE --max-drop FLOAT Max acceptable drop [0.05] --strict Exit non-zero on regression --output TEXT Write JSON report
nel gate
nel gate BASELINE_DIR CANDIDATE_DIR --policy TEXT Gate policy YAML file [required] --output TEXT Write JSON gate report --format [text|json] Output format [text] --strict Exit non-zero on NO-GO or INCONCLUSIVE --verbose Show per-benchmark reasons