mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
add comments
This commit is contained in:
parent
60b1bdca06
commit
80ce215293
3 changed files with 4 additions and 3 deletions
|
|
@ -802,7 +802,7 @@ static_resources:
|
|||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: host.docker.internal
|
||||
address: 0.0.0.0
|
||||
port_value: 9091
|
||||
hostname: localhost
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ def docker_start_archgw_detached(
|
|||
|
||||
volume_mappings = [
|
||||
f"{arch_config_file}:/app/arch_config.yaml:ro",
|
||||
# "/Users/adilhafeez/src/intelligent-prompt-gateway/crates/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins:ro",
|
||||
]
|
||||
volume_mappings_args = [
|
||||
item for volume in volume_mappings for item in ("-v", volume)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ pub async fn list_preferences(
|
|||
llm_providers: Arc<tokio::sync::RwLock<Vec<LlmProvider>>>,
|
||||
) -> Response<BoxBody<Bytes, hyper::Error>> {
|
||||
let prov = llm_providers.read().await;
|
||||
// select providers that have usage information
|
||||
let providers_with_usage = prov
|
||||
.iter()
|
||||
.filter(|provider| provider.usage.is_some())
|
||||
|
|
@ -56,7 +57,6 @@ pub async fn update_preferences(
|
|||
request: Request<hyper::body::Incoming>,
|
||||
llm_providers: Arc<tokio::sync::RwLock<Vec<LlmProvider>>>,
|
||||
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
|
||||
info!("Updating preferences...");
|
||||
let request_body = request.collect().await?.to_bytes();
|
||||
|
||||
let usage: Vec<UsageBasedProvider> = match serde_json::from_slice(&request_body) {
|
||||
|
|
@ -76,6 +76,8 @@ pub async fn update_preferences(
|
|||
let usage_model_map: HashMap<String, UsageBasedProvider> =
|
||||
usage.into_iter().map(|u| (u.model.clone(), u)).collect();
|
||||
|
||||
info!("Updating usage preferences for models: {:?}", usage_model_map.keys());
|
||||
|
||||
let mut llm_providers = llm_providers.write().await;
|
||||
|
||||
// ensure that models coming in the request are valid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue