Skip to content
GitHub
View on GitHub

HarborEval

Evaluate a deployed model on a Harbor dataset using sandbox execution.

from modal_training_gym.common.eval import HarborEval

Evaluate a deployed model on a Harbor dataset using sandbox execution.

Automates the common pattern of generating code from a Harbor task, extracting it from the LLM response, running it in a Modal sandbox, and comparing stdout against expected test-case outputs.

When neither eval_fn nor eval_response_fn is provided, a default sandbox-backed scorer is used automatically. Pass extract_code_fn to override how code is pulled from the model response, or supply your own eval_fn to take full control.

Inherits from: EvalConfig

FieldTypeDefaultDescription
dataset'DatasetConfig'
eval_fnEvalFn | NoneNone
eval_response_fnEvalResponseFn | NoneNone
prompt_columnstr | NoneNone
eval_config_idstr | NoneNone
generate_kwargsdict[str, Any]{}
model'ModelConfig | None'None
test_caseslist[dict[str, str]] | NoneNone
sandbox_timeoutint60
sandbox_cpufloat1.0
sandbox_memoryint1024
sandbox_cpu_policystr"limit"
sandbox_memory_policystr"limit"
sandbox_python_versionstr"3.11"
extract_code_fnCallable[[str], str] | NoneNone

build_prompt(self, row: 'DatasetRow') -> 'str'

Section titled “build_prompt(self, row: 'DatasetRow') -> 'str'”

evaluate(self, deployment: "'ModelDeployment'", debug: 'bool' = False, max_concurrency: 'int' = 1, ready_timeout: 'int' = 3000) -> 'EvalResult'

Section titled “evaluate(self, deployment: "'ModelDeployment'", debug: 'bool' = False, max_concurrency: 'int' = 1, ready_timeout: 'int' = 3000) -> 'EvalResult'”

Source: modal_training_gym/common/eval.py