pub struct PriorConfig {
pub provider: String,
pub model: String,
pub api_key_env: String,
pub base_url: String,
pub timeout_ms: u64,
pub strength: f64,
pub rungs: Vec<String>,
}Expand description
Verified predictive routing config: a pre-generation decision-model prior (TypeSafe’s
Jev today — provider is a discriminator on purpose, so a future second provider is an
additive match arm, not a breaking rename) that answers, per query, “which is the least
capable ladder rung that fully and correctly handles this?” The answer’s probabilities become
a P(pass | rung) prior fed into the existing start-rung expected-cost argmin
(crate::prior::cumulative_pass).
This is a PRIOR, not a verifier: the enforce gate still runs on every served attempt exactly
as before. A confident prior can only change where the ladder starts, never whether a
failing output is served. None (default) = off = byte-identical to today.
Fields§
§provider: StringDecision-model provider. Only "typesafe" is built in today; validated by
Config::parse.
model: StringModel name passed to the provider’s API.
api_key_env: StringEnv var naming the API key. Read once at startup; never logged, never put on the trace.
base_url: StringProvider API base URL.
timeout_ms: u64Hard timeout for the prior call. A timeout or any other error fails open (no prior for
this request, decision_prior absent, start rung falls back to the prior-free choice) —
this is a cost hint, never a serving dependency.
strength: f64Beta pseudo-count weight: how many observations the prior is worth relative to the
bandit’s own learned counts at a context. Higher = the prior dominates longer before
real data overrides it. Must be finite and > 0; validated by Config::parse.
rungs: Vec<String>Ladder rung names, in the same order as the route’s ladder, used as the choice
question’s criteria labels (r0, r1, … map to rungs[0], rungs[1], …). Must be
non-empty and match the length of every enforce route’s ladder; validated by
Config::parse.