Suites¶
Suite, ChoiceItem, SUITES, and get_suite.
ChoiceItem¶
-
questionstr: Question text, inserted intoQuestion: {question}\nAnswer:. -
choicestuple[str, ...]: Answer options, each scored with a leading space. -
answerint: Zero based index of the correct choice.
Suite¶
@dataclass(frozen=True)
class Suite:
name: str
capability: tuple[ChoiceItem, ...]
benign_prompts: tuple[str, ...]
neutral_texts: tuple[str, ...]
max_new_tokens: int = 64
notes: tuple[str, ...] = ()
-
namestr: Identifier used by--suiteand stored in the report. -
capabilitytuple[ChoiceItem, ...]: Items forcapability_accuracy. -
benign_promptstuple[str, ...]: Prompts forover_refusal_rate. -
neutral_textstuple[str, ...]: Texts foroutput_divergence_kl. -
max_new_tokensint: Generation budget for over refusal. -
notestuple[str, ...]: Shown in the report.
SUITES¶
Registry used by the CLI and get_suite.
get_suite¶
Returns the registered suite. Raises KeyError with the list of available names when name is unknown.
QUICK¶
The built in smoke suite: 24 capability items, 20 benign prompts, 12 neutral texts, max_new_tokens=64.
Benchmark suites¶
The lite, standard and full suites are built from tasks:
from modeldiffr.tasks import build_tasks, task_suite
suite = task_suite("standard", only=["mmlu", "gsm8k"], limit=200, allow_code_execution=False)
for task, size in suite.entries:
print(task.name, size, [m.name for m in task.metrics])
tasks = build_tasks()
items = tasks["mmlu"].load()
task_suite(name, only=None, limit=None, allow_code_execution=False) returns a TaskSuite that run_audit accepts in place of a Suite. Passing a built in suite name such as quick wraps it as tasks. Each Task has name, kind, metrics, source and max_new_tokens, load(data_dir=None) returns its items, and run(backend, items, ctx) returns per item rows. See Suites and tasks.