Skip to main content

Module config

Module config 

Source
Expand description

Routing configuration (SPEC §8.4) — declarative, agent-first.

Config is the policy an operator (or agent) hands Firstpass: an ordered list of routes, each matching a slice of traffic to a mode, a model ladder, and gates; plus budget caps and escalation rules. The first matching route wins, so specific routes go first and a bare match = {} catch-all goes last.

Structs§

AdaptiveConfig
Config for online/adaptive conformal serving (crate::conformal::AdaptiveConformal).
BanditConfig
Config for the UCB1 start-rung bandit (firstpass_proxy::bandit::StartRungBandit).
Budget
Spend caps. None means “no cap”.
Config
Top-level configuration document.
ConsistencyDef
Configuration for a self-consistency uncertainty gate: resample the original request k times on the same model and score the candidate by agreement with the fresh samples.
Escalation
Escalation limits and session-level promotion.
ExplorationConfig
Epsilon-greedy start-rung exploration: a fraction epsilon of requests start at a uniformly-random rung so that propensities are logged and IPS/SNIPS off-policy estimates are valid (Horvitz-Thompson 1952; SNIPS: Swaminathan & Joachims 2015). The bandit still observes all gate verdicts — including from exploration draws — so learning is uninterrupted.
GateDef
A user-defined gate (SPEC §8.1). Exactly one kind per definition:
JudgeDef
Configuration for a native LLM-judge gate (SPEC §8.3): a separate model grades the candidate against a rubric. The runner enforces maker ≠ checker (a model never grades its own output) and treats the candidate as data, not instructions.
Match
Predicate over a request’s Features. Every present field is an AND-constraint; absent fields are wildcards.
ModelRef
A parsed provider/model reference.
PriceDef
A per-deployment price override for one model (provider/model), USD per 1M tokens.
ProviderDef
A model provider a ladder can route to. Declared as [[provider]] in TOML; referenced from a ladder as <id>/<model> (e.g. groq/llama-3.3-70b-versatile).
Route
One routing rule.
SessionPromotion
“After N failures within a window, promote this session’s starting rung.”

Enums§

AbstainPolicy
Per-gate abstain policy (§7.2): what happens to serving when the gate can’t produce a verdict.
AuthScheme
How a provider call is credentialed — orthogonal to Dialect (ADR 0006): dialect shapes the request/response body, auth scheme shapes how the request is signed/credentialed. Default (api_key_env / BYOK header) is unchanged for every existing [[provider]] entry.
BanditAlgorithm
Start-rung bandit selection algorithm.
Dialect
The wire API a provider speaks. anthropic = Messages API; openai = Chat Completions API (the de-facto standard that nearly every hosted and open-source model host implements); gemini = Google’s Generative Language API (generateContent).
Mode
Serving mode for a route (SPEC glossary).
OnExhausted
What to do when a spend cap is hit (SPEC §8.4 — never brick the customer).
StringOrVec
A field that accepts either a single string or a list of strings in TOML/JSON.