pub enum AlgorithmSpec {
Noop {},
Random {
targets: Vec<String>,
weights: Option<Vec<f64>>,
seed: Option<u64>,
},
Passthrough {
target: String,
subagents: Option<SubagentRouteConfig>,
},
PlanExecute {
capable_target: String,
efficient_target: String,
tool_semantics: ToolSemantics,
planning_prompt: Option<String>,
handoff_prompt: Option<String>,
planner_reasoning_as_text: bool,
},
LlmClassifier {
config: LlmClassifierRouteConfig,
},
StageRouter {
tiers: StageTierConfig,
picker: PickerMode,
classifier: Option<StageClassifierConfig>,
subagents: Option<SubagentRouteConfig>,
},
Auto {
capable_target: String,
efficient_target: String,
},
Composite {
classifier: StageClassifierConfig,
stage: StageTierConfig,
subagents: Option<SubagentRouteConfig>,
},
Advisor {Show 13 fields
executor_target: String,
advisor_target: String,
reviewer_system_prompt: Option<String>,
redo_feedback_prefix: Option<String>,
gate_trigger: AdvisorTriggerConfig,
gate_trigger_pattern: Option<String>,
max_reviews: u32,
gate_stall_turns: u32,
gate_min_tool_results: u32,
advisor_max_tokens: u64,
advisor_temperature: Option<f64>,
transcript_max_chars: usize,
fail_open: bool,
},
Vgr {
config: VgrRouteConfig,
},
PrefillRouter {
targets: Vec<String>,
checkpoint: PathBuf,
device: Option<String>,
cache_dir: Option<PathBuf>,
max_length: Option<usize>,
batch_size: Option<usize>,
},
}Expand description
A routing algorithm described by configured target names.
Variants§
Noop
Replies OK without calling any model. Useful for smoke tests.
Random
Splits traffic across several targets.
Fields
Passthrough
Sends every request to one target.
Fields
subagents: Option<SubagentRouteConfig>Separate policy for delegated sub-agent work.
PlanExecute
Plans on the capable target, then permanently hands off after the first mutation.
Fields
tool_semantics: ToolSemanticsAdditional tool names whose mutations trigger handoff.
LlmClassifier
Asks a judge model which target should serve the request.
Fields
config: LlmClassifierRouteConfigJudge and tier settings, written directly in the route table.
StageRouter
Picks a tier per turn by scoring signals from recent tool results.
Fields
tiers: StageTierConfigpicker: PickerModeTier to use when the signals are not confident.
classifier: Option<StageClassifierConfig>Judge consulted for turns the tool signals cannot decide.
subagents: Option<SubagentRouteConfig>Separate policy for delegated sub-agent work.
Auto
Picks a routing strategy automatically, preset with recommended knobs.
Currently a stage_router with picker = "efficient_first" and
confidence_threshold = 0.5; change build_algorithm’s Auto arm to
repoint it at a different algorithm or preset.
Composite
A judge picks the tier at each user turn; a stage router runs the turns within it.
Fields
classifier: StageClassifierConfigJudge that picks the tier. Called through its own target.
stage: StageTierConfigThe stage router the judge hands off to.
subagents: Option<SubagentRouteConfig>Separate policy for delegated sub-agent work.
Advisor
Serves every turn from one target, and has a second model review some of those turns before the caller sees them.
Fields
gate_trigger: AdvisorTriggerConfigWhat fires a review.
gate_trigger_pattern: Option<String>Regular expression for the pattern trigger. Required by it, and unused otherwise.
gate_stall_turns: u32Reviews a turn after this many assistant turns, as a mid-task checkpoint. Zero turns the checkpoint off.
gate_min_tool_results: u32Tool results a turn needs before it can be reviewed. Skips early chatty turns.
Vgr
Fields
config: VgrRouteConfigPrefillRouter
Routes using a checkpoint-backed prefill classifier.
Implementations§
Source§impl AlgorithmSpec
impl AlgorithmSpec
Sourcepub fn routing_target_names(&self) -> Vec<&str>
pub fn routing_target_names(&self) -> Vec<&str>
Completion targets in algorithm order; judge-only targets are excluded.
Sourcepub fn callable_target_names(&self) -> Vec<&str>
pub fn callable_target_names(&self) -> Vec<&str>
Every target the algorithm may call, including judge-only targets.
routing_target_names covers completion destinations;
a classifier also calls its judge, and that call needs a client too.
Sourcepub fn build(
&self,
route_name: &str,
targets: &BTreeMap<String, ModelId>,
) -> Result<Arc<dyn Algorithm>, AlgorithmConfigError>
pub fn build( &self, route_name: &str, targets: &BTreeMap<String, ModelId>, ) -> Result<Arc<dyn Algorithm>, AlgorithmConfigError>
Builds this algorithm after resolving configured target names.
Sourcepub fn build_with_runtime_models(
&self,
route_name: &str,
targets: &BTreeMap<String, ModelId>,
) -> Result<(Arc<dyn Algorithm>, RuntimeModels), AlgorithmConfigError>
pub fn build_with_runtime_models( &self, route_name: &str, targets: &BTreeMap<String, ModelId>, ) -> Result<(Arc<dyn Algorithm>, RuntimeModels), AlgorithmConfigError>
Resolves target names to host model IDs and builds the algorithm and runtime groups.
Trait Implementations§
Source§impl Clone for AlgorithmSpec
impl Clone for AlgorithmSpec
Source§fn clone(&self) -> AlgorithmSpec
fn clone(&self) -> AlgorithmSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more