Skip to main content

bitrouter_core/routers/
routing_table.rs

1use crate::errors::Result;
2
3/// The target to route a request to.
4pub struct RoutingTarget {
5    /// The provider name to route to.
6    pub provider_name: String,
7    /// The actual upstream provider's model ID to route to.
8    pub model_id: String,
9}
10
11/// A routing table that maps incoming model names to routing targets (provider + model ID).
12pub trait RoutingTable {
13    /// Routes an incoming model name to a routing target.
14    fn route(
15        &self,
16        incoming_model_name: &str,
17    ) -> impl Future<Output = Result<RoutingTarget>> + Send;
18}