Skip to content

Index

diapason.recipes

Recipe system — composable primitive configurations.

Recipe dataclass

A composable primitive configuration loaded from TOML.

Covers both discrete agents (benchmarking / one-shot) and operator agents (persistent / scheduled) through the kind field.

to_builder_kwargs()

Convert recipe fields to kwargs for SystemBuilder/Diapason.

Returns a dict with only the non-None fields, keyed to match the SystemBuilder fluent API or Diapason constructor parameters.

to_eval_suite(benchmarks=None, max_samples=None, judge_model=None)

Convert this recipe into an EvalSuiteConfig.

Uses the recipe's model/engine as the single [[models]] entry and the recipe's benchmarks (or benchmarks override) as [[benchmarks]], inheriting agent type and tools.

to_operator_manifest()

Convert this recipe into an OperatorManifest.

discover_recipes(extra_dirs=None, *, kind=None)

Discover all TOML recipes from known directories.

Search order (later entries override earlier ones by name): 1. Project recipes/data/ directory (discrete recipes) 2. Project recipes/data/operators/ directory (operator recipes) 3. User ~/.diapason/recipes/ directory 4. User ~/.diapason/operators/ directory 5. Any additional directories in extra_dirs

Parameters:

Name Type Description Default
extra_dirs Optional[List[str | Path]]

Additional directories to scan.

None
kind Optional[str]

If set, filter to only "discrete" or "operator" recipes.

None

load_recipe(path)

Load a recipe from a TOML file.

Supports the unified format with [recipe], [intelligence], [engine], [agent], [learning], [eval], [schedule], and [channels] sections. Also auto-detects legacy operator manifests that use [operator] as the top-level key.

Raises:

Type Description
FileNotFoundError

If path does not exist.

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.

resolve_recipe(name)

Find a recipe by name from all known directories.

Returns None if no recipe with the given name is found.