cosmotron_mcp.inference.compiler¶
compile_inference ¶
Compile a validated InferenceSpec to Firecrown YAML + CosmoSIS INI, then dry-run it.
Deterministic templating (no LLM) — the model already chose the spec's values; this
owns every emitted byte. Refuses (writing nothing) on an invalid spec, an existing
label without overwrite, etc. When run_dry_run is set (default), also runs the
deterministic dry-run gate — one test-sampler evaluation plus static coverage checks
— and returns its verdict ("PASS"/"FAIL"). A FAIL still returns the
compiled paths + report so a human can inspect; the verdict is prominent so a caller
never launches a chain on a failed config by accident.
Launch a PASSing config with run_inference(session_dir,
config_dir=<compiled_dir>).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_dir
|
str
|
Session directory. |
required |
spec_path
|
str
|
Path to the validated spec JSON. |
required |
run_dry_run
|
bool
|
Run the dry-run gate after compiling (default True). |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
The compiler result ( |
dict
|
|
dict
|
exception to the repo-relative-paths convention: these paths are |
dict
|
ABSOLUTE, because they are consumed directly by the CosmoSIS |
dict
|
subprocess launched from |
dict
|
a dispatch message. Do not persist them into |
dict
|
|