mirror of
https://github.com/katanemo/plano.git
synced 2026-07-23 16:51:04 +02:00
add top-level routing_preferences with selection_policy and model metrics fetch
This commit is contained in:
parent
406fa92802
commit
2ef938ac5f
9 changed files with 568 additions and 49 deletions
|
|
@ -104,6 +104,33 @@ pub enum StateStorageType {
|
|||
Postgres,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum SelectionPreference {
|
||||
Cheapest,
|
||||
Fastest,
|
||||
Random,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SelectionPolicy {
|
||||
pub prefer: SelectionPreference,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TopLevelRoutingPreference {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub models: Vec<String>,
|
||||
pub selection_policy: SelectionPolicy,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ModelMetricsSources {
|
||||
pub url: String,
|
||||
pub refresh_interval: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Configuration {
|
||||
pub version: String,
|
||||
|
|
@ -122,6 +149,8 @@ pub struct Configuration {
|
|||
pub filters: Option<Vec<Agent>>,
|
||||
pub listeners: Vec<Listener>,
|
||||
pub state_storage: Option<StateStorageConfig>,
|
||||
pub routing_preferences: Option<Vec<TopLevelRoutingPreference>>,
|
||||
pub model_metrics_sources: Option<ModelMetricsSources>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
|
|
@ -317,7 +346,7 @@ impl LlmProviderType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Clone, Serialize, Deserialize, Debug)]
|
||||
pub struct ModelUsagePreference {
|
||||
pub model: String,
|
||||
pub routing_preferences: Vec<RoutingPreference>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue