Skip to main content

strands/models/routing/
mod.rs

1//! Strategy-based model routing.
2//!
3//! A [`ModelRouter`] passed as the agent's model asks its [`RoutingStrategy`] for a candidate
4//! before the first model call and after each failure no retry strategy claimed. The default
5//! [`FallbackStrategy`] fails over to the healthiest untried candidate; [`ClassifierStrategy`]
6//! asks a classifier model which candidate fits the request. The API is provisional.
7
8mod classifier_strategy;
9mod fallback_strategy;
10mod router;
11mod strategy;
12
13pub use classifier_strategy::{ClassifierStrategy, ClassifierStrategyOptions};
14pub use fallback_strategy::FallbackStrategy;
15pub use router::{CandidateModel, ModelRouter, ModelRouterOptions, RoutingCandidate, RoutingCandidateOptions};
16pub(crate) use router::{ModelRouterPlugin, RouterAttachment, same_model};
17pub use strategy::{RoutingAttempt, RoutingContext, RoutingFailure, RoutingStrategy};