Skip to content

composer

diapason.recipes.composer

Composer bridges — convert a Recipe into EvalSuiteConfig or OperatorManifest.

These are pure-function transformations that let the unified Recipe format drive both the eval framework and the operator system without those systems needing to know about recipes directly.

recipe_to_eval_suite(recipe, benchmarks=None, max_samples=None, judge_model=None)

Build an EvalSuiteConfig from a recipe.

The recipe's model / engine become the single [[models]] entry. The recipe's eval_benchmarks (or the benchmarks override) become [[benchmarks]] entries. Agent type and tools are inherited so the eval runner constructs the right backend automatically.

Parameters:

Name Type Description Default
recipe Recipe

Source recipe.

required
benchmarks Optional[List[str]]

Override benchmark list (defaults to recipe.eval_benchmarks).

None
max_samples Optional[int]

Override per-benchmark sample cap.

None
judge_model Optional[str]

Override LLM judge model.

None

Raises:

Type Description
ValueError

If no model or benchmarks can be resolved.

recipe_to_operator(recipe)

Build an OperatorManifest from a recipe.

Maps the recipe's agent, schedule, and channel fields into the operator manifest format used by OperatorManager.

Raises:

Type Description
ValueError

If schedule information is missing.