Configuration¶
Guard Eval Harness supports three ways to configure a run:
| Mode | Command | Best For |
|---|---|---|
| Inline | geh run --dataset ... --model ... |
Quick one-off evaluations |
| YAML Config | geh run --config path.yaml |
Reproducible, version-controlled runs |
| Benchmark Pack | geh run --pack core --model ... |
Curated multi-dataset evaluations |
These are mutually exclusive — pick one per run.
YAML Config Reference¶
full-config.yaml
version: 1 # (1)!
run_name: my-evaluation # (2)!
threshold: 0.5 # (3)!
model:
adapter: hf # (4)!
model_name: meta-llama/Llama-Guard-3-8B # (5)!
args: # (6)!
apply_chat_template: true
drop_failed_predictions: true
datasets: # (7)!
- name: xstest
adapter: xstest
split: test
options: {}
- name: toxic_chat
adapter: toxic_chat
execution:
batch_size: 16 # (8)!
concurrency: 1 # (9)!
retries: 8 # (10)!
retry_backoff: 2.0 # (11)!
limit: null # (12)!
resume: false # (13)!
output:
run_dir: out/my-evaluation # (14)!
overwrite: false # (15)!
- Config format version. Always
1. - Human-readable name. Used in artifact directory naming.
- Classification threshold (0.0–1.0). Scores above this are classified as
unsafe. - Model backend alias. Use any registered adapter returned by
geh list backends; most users start withmock,hf,vllm,openai_moderation,openai_compatible,anthropic, orhttp. - Model identifier — HuggingFace repo ID, API model name, etc.
- Backend-specific arguments. See Models for each adapter's options.
- One or more datasets to evaluate. At least one is required.
- Batch size for inference. Use
"auto"for adaptive sizing (local models only). - Parallel workers for API adapters.
- Retry attempts on transient failures.
- Exponential backoff multiplier between retries.
- Max samples per dataset.
null= use all samples. - Resume from cached predictions if the run directory exists.
- Output directory (required).
- Allow overwriting an existing run directory.
Dataset Config¶
Each dataset entry supports these fields:
| Field | Type | Default | Description |
|---|---|---|---|
name |
str |
required | Name used in artifact paths |
adapter |
str |
same as name |
Dataset adapter name |
path |
str |
null |
Local file/directory path |
split |
str |
"test" |
Dataset split |
id_field |
str |
"id" |
Sample ID column |
prompt_field |
str |
"prompt" |
Text input column |
response_field |
str |
null |
Optional response/output column |
messages_field |
str |
null |
Structured messages column |
label_field |
str |
"unsafe" |
Safety label column |
metadata_fields |
list[str] |
[] |
Extra columns to preserve |
options |
dict |
{} |
Adapter-specific options |
Environment Variables¶
Config values can reference environment variables with ${VAR_NAME} syntax:
model:
adapter: openai_compatible
model_name: ${OPENAI_VISION_MODEL}
args:
api_key_env: OPENAI_API_KEY
Validation¶
Validate a config file without running it:
This checks that all adapters exist, required fields are present, and dataset/model configurations are valid.
CLI Overrides¶
Several config values can be overridden from the command line: