Skip to content

LM Evaluation Harness Configuration

name: lm-eval-example
model:
name: meta-llama/Llama-3.1-8B-Instruct
url: http://model-endpoint:8080/v1
benchmarks:
- id: arc_easy
provider_id: lm_evaluation_harness
parameters:
num_examples: 10
num_few_shot: 5

The adapter recognizes the common parameters below. Individual tasks may impose additional constraints, so use the task definition and its README as the source of truth.

ParameterDescription
num_examplesLimit the number of evaluated samples; useful for smoke tests but not final metrics
num_few_shotNumber of few-shot examples, when supported by the task
batch_sizeRequest batch size; defaults to 1
num_concurrentNumber of concurrent requests, capped by the adapter at 128
timeout_secondsRequest timeout in seconds; defaults to 300
tokenizerHugging Face tokenizer ID or local path used with the OpenAI-compatible endpoint
random_seedRandom seed used by LM Evaluation Harness; defaults to 42
parametersNested scalar generation parameters serialized as LM Evaluation Harness generation kwargs

Only the top-level keys listed above are interpreted by the adapter. Keys in the nested parameters object are serialized as generation kwargs; other top-level keys are not automatically translated into task configuration.

Some tasks require additional image-level configuration:

Benchmark(s)Requirement
careqa_open_perplexityevaluate and bert-score (the runner image also needs matplotlib for bert_score import)
tinyTruthfulQAtinyBenchmarks
humaneval, humaneval_instruct, mbppHF_ALLOW_CODE_EVAL=1; generated code is executed and requires isolation
Gated Hugging Face datasetsHF_TOKEN, or an hf-token key in the model authentication Secret

These requirements belong in the ta-lmes-job image or its runtime configuration. Adding a benchmark to config/providers/lm_evaluation_harness.yaml does not install missing packages.

humaneval, humaneval_instruct, and mbpp use the code_eval metric, which executes model-generated Python code. Run these benchmarks only in an appropriately isolated evaluation environment. The runner must explicitly set HF_ALLOW_CODE_EVAL=1 before the benchmark is executed.

In the current LM Evaluation Harness integration, this code runs inside the evaluation Job container; it is not delegated to a separate code-execution sandbox.

Do not enable this setting for an untrusted, shared host environment.

Review the task’s dataset_path, dataset_name, and download code before deployment. Tasks may download data at runtime, require a Hugging Face token, or require data to be pre-staged for disconnected clusters. For air-gapped deployments, see Disconnected Cluster Evaluation.