pub struct RouterConfig {
pub strategy: RouterStrategyConfig,
pub thompson_state_path: Option<String>,
pub cascade: Option<CascadeConfig>,
pub reputation: Option<ReputationConfig>,
pub bandit: Option<BanditConfig>,
pub quality_gate: Option<f32>,
pub asi: Option<AsiConfig>,
pub embed_concurrency: usize,
}Expand description
Routing configuration for multi-provider setups.
Fields§
§strategy: RouterStrategyConfigRouting strategy: "ema" (default), "thompson", "cascade", or "bandit".
thompson_state_path: Option<String>Path for persisting Thompson Sampling state. Defaults to ~/.zeph/router_thompson_state.json.
§Security
This path is user-controlled. The application writes and reads a JSON file at
this location. Ensure the path is within a directory that is not world-writable
(e.g., avoid /tmp). The file is created with mode 0o600 on Unix.
cascade: Option<CascadeConfig>Cascade routing configuration. Only used when strategy = "cascade".
reputation: Option<ReputationConfig>Bayesian reputation scoring configuration (RAPS). Disabled by default.
bandit: Option<BanditConfig>PILOT bandit routing configuration. Only used when strategy = "bandit".
quality_gate: Option<f32>Embedding-based quality gate threshold for Thompson/EMA routing. Default: disabled.
When set, after provider selection, the cosine similarity between the query embedding and the response embedding is computed. If below this threshold, the next provider in the ordered list is tried. On exhaustion, the best response seen is returned.
Only applies to Thompson and EMA strategies. Cascade uses its own quality classifier. Fail-open: embedding errors disable the gate for that request.
asi: Option<AsiConfig>Agent Stability Index configuration. Disabled by default.
embed_concurrency: usizeMaximum number of concurrent embed_batch calls through the router.
Limits simultaneous embedding HTTP requests to prevent provider rate-limiting and memory pressure during indexing or high-frequency recall. Default: 4. Set to 0 to disable the semaphore (unlimited concurrency).
Trait Implementations§
Source§impl Clone for RouterConfig
impl Clone for RouterConfig
Source§fn clone(&self) -> RouterConfig
fn clone(&self) -> RouterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more