A toolkit for building narrow, calibrated decision models — trained on synthetic data with a known answer key, so the confidence they report is trustworthy by construction, not patched on afterward.
pip install certo
research preview
MIT
non-generative · typed probabilities
Inspired by Jev / “System-1” decision models. Independent project — not affiliated with TypeSafe.
A decision model earns its keep when it says “route to billing, 0.82” and the 0.82 is real — so you can escalate on doubt or trade quality against cost. Train on hard labels (the usual way) and the model still picks well but turns overconfident; you’re left patching calibration after the fact.
certo trains against the full answer distribution (a proper scoring rule), so probabilities mean what they say — calibrated by construction.
Because the data is generated from a known posterior, every model is scored against the exact answer — not just accuracy, but fidelity.
You define a decision as a synthetic world whose answer is computable. certo renders it to natural language, and a small encoder learns to read the state and each option and emit calibrated, typed probabilities. The answer key both trains and grades.
Measured against the exact posterior (KL, lower is better) on held-out wording. Training on the full distribution lands essentially on the answer; single-label targets sit near “ignore the evidence.”
The interface certo ships (research preview — API stabilizing).
# 1 — describe your decision as a known-answer synthetic world from certo.synth import EvidenceWorld world = EvidenceWorld(classes=["billing", "tech", "refunds"], features=12) data = world.generate(n=20_000) # (state, options, EXACT target) # 2 — train, calibrated by construction (soft/distributional targets) from certo import train model = train(data, backbone="ModernBERT-base", target="soft") model.save("my-router") # 3 — use it locally: state + runtime options -> calibrated probabilities from certo import DecisionModel m = DecisionModel.load("my-router") r = m.decide(state="card charged twice, refund please", options=[{"name":"billing", "description":"charges & payments"}, {"name":"tech", "description":"app problems"}], kind="choice") r.probs # {"billing": 0.86, "tech": 0.08, "OUT": 0.06} — calibrated r.abstain # True when the top probability is below your threshold