pub struct ModelInfo {
pub provider: String,
pub model: String,
pub context_window: Option<usize>,
pub supports_streaming: bool,
}
pub struct RoutingDecision {
pub model: ModelInfo,
pub strategy: String,
pub score: Option<f32>,
}
pub trait RoutingStrategy: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn name(&self) -> &'static str;
fn select(
&self,
query: &str,
candidates: &[ModelInfo],
) -> Result<RoutingDecision, Self::Error>;
}
pub trait RoutingMetrics: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn record(&self, decision: &RoutingDecision, latency_ms: u64, success: bool) -> Result<(), Self::Error>;
fn summary(&self) -> Result<String, Self::Error>;
}