Skip to main content

score

Function score 

Source
pub async fn score(model_path: String, embedding: Vec<f64>) -> Result<f64>
Expand description

Score a query embedding with a trained FastGRNN model (raw forward pass).

Loads the .safetensors produced by {@link train_router} and runs the model directly on embedding (which must match the model’s input_dim). Returns the sigmoid output in 0..1 — high means “the cheap model is good enough” (route to the cheaper model); low means route to a stronger model.

This is the inference path that matches trainRouter (trained on raw embeddings); it does not run Router’s feature engineering.