use serde::{Deserialize, Serialize};
use super::tracker::EventSource;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KvEventConsolidatorConfig {
pub engine_event_endpoint: String,
pub consolidated_event_endpoint: String,
pub engine_source: EventSource,
}
impl Default for KvEventConsolidatorConfig {
fn default() -> Self {
Self {
engine_event_endpoint: "tcp://localhost:5557".to_string(),
consolidated_event_endpoint: "tcp://*:5558".to_string(),
engine_source: EventSource::Vllm,
}
}
}
impl KvEventConsolidatorConfig {
pub fn new(
engine_event_endpoint: String,
consolidated_event_endpoint: String,
engine_source: EventSource,
) -> Self {
Self {
engine_event_endpoint,
consolidated_event_endpoint,
engine_source,
}
}
pub fn new_vllm(engine_event_endpoint: String, consolidated_event_endpoint: String) -> Self {
Self {
engine_event_endpoint,
consolidated_event_endpoint,
engine_source: EventSource::Vllm,
}
}
pub fn new_trtllm(engine_event_endpoint: String, consolidated_event_endpoint: String) -> Self {
Self {
engine_event_endpoint,
consolidated_event_endpoint,
engine_source: EventSource::Trtllm,
}
}
}