"`max_input_length` must be < `max_total_tokens`".to_string(),
));
}
ifmax_input_lengthasu32>max_batch_prefill_tokens{
ifmax_input_lengthasu32>max_batch_prefill_tokens{
panic!("{}",format!("`max_batch_prefill_tokens` must be >= `max_input_length`. Given: {max_batch_prefill_tokens} and {max_input_length}"));
returnErr(RouterError::ArgumentValidation(format!("`max_batch_prefill_tokens` must be >= `max_input_length`. Given: {max_batch_prefill_tokens} and {max_input_length}")));
panic!("{}",format!("`max_batch_prefill_tokens` must be <= `max_batch_total_tokens`. Given: {max_batch_prefill_tokens} and {max_batch_total_tokens}"));
returnErr(RouterError::ArgumentValidation(format!("`max_batch_prefill_tokens` must be <= `max_batch_total_tokens`. Given: {max_batch_prefill_tokens} and {max_batch_total_tokens}")));
}
}
ifmax_total_tokensasu32>max_batch_total_tokens{
ifmax_total_tokensasu32>max_batch_total_tokens{
panic!("{}",format!("`max_total_tokens` must be <= `max_batch_total_tokens`. Given: {max_total_tokens} and {max_batch_total_tokens}"));
returnErr(RouterError::ArgumentValidation(format!("`max_total_tokens` must be <= `max_batch_total_tokens`. Given: {max_total_tokens} and {max_batch_total_tokens}")));
}
}
ifvalidation_workers==0{
ifvalidation_workers==0{
panic!("`validation_workers` must be > 0");
returnErr(RouterError::ArgumentValidation(
"`validation_workers` must be > 0".to_string(),
));
}
}
// CORS allowed origins
// CORS allowed origins
...
@@ -331,6 +338,8 @@ pub async fn get_model_info(
...
@@ -331,6 +338,8 @@ pub async fn get_model_info(
#[derive(Debug,Error)]
#[derive(Debug,Error)]
enumRouterError{
enumRouterError{
#[error("Argument validation error: {0}")]
ArgumentValidation(String),
#[error("Unable to connect to the Python model shards: {0}")]
#[error("Unable to connect to the Python model shards: {0}")]
Connection(ClientError),
Connection(ClientError),
#[error("Unable to clear the Python model shards cache: {0}")]
#[error("Unable to clear the Python model shards cache: {0}")]