Python API

These pages are maintainer-facing interfaces, not a separately versioned third-party SDK.

Versioned YAML configuration for MUDIDI commands.

The models in this module are the public configuration boundary. Runtime credentials deliberately remain outside these models and are loaded from the separate local subscription store by the selected backend.

InferenceConfig

Bases: _ExtractionConfig

Production inference configuration.

BenchmarkRunConfig

Bases: _ExtractionConfig

Benchmark extraction configuration.

Stage1EvaluationConfig

Bases: _EvaluationConfig

Stage2EvaluationConfig

Bases: _EvaluationConfig

load_yaml_config(path, *, expected_kind=None)

Load and validate a MUDIDI YAML configuration file.

merge_explicit_overrides(config, overrides)

Return config with sparse dotted-path CLI overrides applied.

Bounded evaluator-optimizer loop.

Two models check each other. The Evaluator judges an output against its source and proposes targeted edits. The Editor verifies every proposed edit against the same source and decides which to apply; each applied edit is carried out by :func:apply_edit, an exact text replacement on one line. The Editor's verdicts go back to the Evaluator, which reviews the result and may accept, propose further edits, or answer a refusal.

The loop is stage-agnostic: stage-specific code supplies the model calls, and this module owns the round structure, stop conditions and audit artifacts.

AgenticLoopConfig

Bases: BaseModel

Loop controls shared by Stage 1 and Stage 2 agentic modes.

AgenticVerifierDecision

Bases: BaseModel

Structured Evaluator response used by both stages.

run_bounded_verifier_loop(*, stage, initial_output, artifact_dir, output_suffix, verify, edit, config, redo=None)

Run a bounded stage-local evaluator-optimizer loop.

One iteration is one Evaluator-to-Editor round. max_iterations caps the rounds; the Evaluator gets one more look after the last one. verify is given every earlier round so the Evaluator can see what the Editor did with its proposals. redo produces the output again from scratch and is omitted for stages that cannot do that.

Besides the cap, the loop stops when it detects no progress: the Evaluator repeats a proposal the Editor refused or the same set of edits, two rounds in a row change nothing, or the output returns to an earlier version.